Creates a print view button using the do=export_html option. It's quite similar to the Print View Button, but it uses (action) buttons.
Open inc/template.php. Find (line 468)
case 'profile': if($conf['useacl'] && $_SERVER['REMOTE_USER'] && $auth->canDo('Profile') && ($ACT!='profile')){ print html_btn('profile',$ID,'',array('do' => 'profile')); return true; } return false; default: print '[unknown button type]'; return true; }
and change it to
case 'profile': if($conf['useacl'] && $_SERVER['REMOTE_USER'] && $auth->canDo('Profile') && ($ACT!='profile')){ print html_btn('profile',$ID,'',array('do' => 'profile')); return true; } return false; case 'print': tpl_link(wl($ID,'do=export_html'), $pre.$suf, 'class="action print" accesskey="p" rel="nofollow"'); return true; default: print '[unknown button type]'; return true; }
Find (line 600)
case 'profile': if($conf['useacl'] && $_SERVER['REMOTE_USER'] && $auth->canDo('Profile') && ($ACT!='profile')){ tpl_link(wl($ID,'do=profile'),$pre.$lang['btn_profile'].$suf, 'class="action profile" rel="nofollow"'); return true; } return false; default: print '[unknown link type]'; return true;
change it to
case 'profile': if($conf['useacl'] && $_SERVER['REMOTE_USER'] && $auth->canDo('Profile') && ($ACT!='profile')){ tpl_link(wl($ID,'do=profile'),$pre.$lang['btn_profile'].$suf, 'class="action profile" rel="nofollow"'); return true; } return false; case 'print': tpl_link(wl($ID,'do=export_html'), $pre.$suf, 'class="action print" accesskey="p" rel="nofollow"'); return true; default: print '[unknown link type]'; return true;
Next open /lib/tpl/default/design.css. Find “a.index” and copy the lines changing a.index into a.print. So
div.dokuwiki div.toolbox_sidebar a.index,
becomes
div.dokuwiki div.toolbox_sidebar a.index, div.dokuwiki div.toolbox_sidebar a.print,
And
div.dokuwiki div.toolbox_sidebar a.index { background: transparent url(images/tool-index.png) 1px 1px no-repeat; }
becomes
div.dokuwiki div.toolbox_sidebar a.index { background: transparent url(images/tool-index.png) 1px 1px no-repeat; } div.dokuwiki div.toolbox_sidebar a.print { background: transparent url(images/tool-print.gif) 1px 1px no-repeat; }
Where url(images/tool-print.gif) is you print icon.
[...]
Do the same for the other instances of a.index
Next open /lib/tpl/default/main.php and add
<?php tpl_button('print')?>
wherever you want the print icon to appear. For example change
<?php tpl_button('edit')?> <?php tpl_button('history')?>
to
<?php tpl_button('edit')?> <?php tpl_button('print')?> <?php tpl_button('history')?>
And you should see your print icon appear between the edit and the histroy button