rather crude (e.g. without translation …), works in new dokuwiki Release rc2008-04-11 (older versions probably, too)
use at your own risk, this is my first dokuwiki plugin, I am still testing this (and no professionel php coder)
uwtoolbar01.alpha.tar.gz … should be installable with the plugin manager
GPL Remark is missing, but it is GPL, basing on Dokuwiki, http://wiki.splitbrain.org/wiki:plugins:action, http://wiki.splitbrain.org/wiki:plugins:cookbook
<?php class action_plugin_uwtoolbar01 extends DokuWiki_Action_Plugin { function getInfo(){ return array( 'author' => 'Hella Breitkopf', 'email' => 'web.0804@unixwitch.de', 'date' => '2008-05-01', 'name' => 'uwtoolbar01', 'desc' => 'adds a <code> and a <file> button to the toolbar (alpha Version)', 'url' => 'www.unixwitch.de/en/dokuwiki/uwtoolbar01', ); } function register(&$controller) { $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array ()); } /** * Inserts a toolbar button */ function insert_button(& $event, $param) { global $lang; global $conf; // no translation and no language file // include_once (dirname(__FILE__) . '/lang/en/lang.php'); // @ include_once (dirname(__FILE__) . '/lang/' . $conf['lang'] . '/lang.php'); $event->data[] = array ( 'type' => 'format', 'title' => 'PRE-file', 'icon' => '../../plugins/uwtoolbar01/file.png', 'open' => '<file>', 'close' => '</file>', ); $event->data[] = array ( 'type' => 'format', 'title' => 'PRE-code', 'icon' => '../../plugins/uwtoolbar01/code.png', 'open' => '< code>', // remove the space 'close' => '</ code>', // remove the space ); } }