register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array ()); $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button_copy', array ()); $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button_inline', array ()); $controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this,'_hookjs'); } /** * Insert a toolbar button */ function insert_button(& $event, $param) { $event->data[] = array ( 'type' => 'format', 'title' => $this->getLang('insertcode'), 'icon' => '../../plugins/codebuttonmod1/image/code.png', 'open' => '\n', 'close' => '\n', ); } /** * Insert a toolbar button */ function insert_button_inline(& $event, $param) { $event->data[] = array ( 'type' => 'format', 'title' => $this->getLang('insertcodeinline'), 'icon' => '../../plugins/codebuttonmod1/image/inline-button+.png', 'open' => "''%%", 'close' => "%%''", ); } /** * Insert a toolbar button */ function insert_button_copy(& $event, $param) { $event->data[] = array ( 'type' => 'format', 'title' => $this->getLang('insertcodecopy'), 'icon' => '../../plugins/codebuttonmod1/image/copy_code_small.png', 'open' => '\n', 'close' => '\n', ); } /** * Hook js script into page headers. * * @author Samuele Tognini */ public function _hookjs(Doku_Event $event, $param) { $event->data['script'][] = array( 'type' => 'text/javascript', 'charset' => 'utf-8', '_data' => '', 'src' => DOKU_BASE.'lib/plugins/codebuttonmod1/'.'src/codebutton.js' ); #'src' => DOKU_PLUGIN.'src/codebutton.js'); } } ?>