1<?php 2/** 3 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 4 */ 5 6// must be run within Dokuwiki 7if(!defined('DOKU_INC')) die(); 8 9if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 10require_once(DOKU_PLUGIN.'action.php'); 11 12class action_plugin_note extends DokuWiki_Action_Plugin { 13 14 /** 15 * register the eventhandlers 16 * 17 * @author Andreas Gohr <andi@splitbrain.org> 18 */ 19 function register(Doku_Event_Handler $controller){ 20 $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'handle_toolbar', array ()); 21 } 22 23 function handle_toolbar(&$event, $param) { 24 $event->data[] = array ( 25 'type' => 'picker', 26 'title' => $this->getLang('note_picker'), 27 'icon' => '../../plugins/note/images/note_picker.png', 28 'list' => array( 29 array( 30 'type' => 'format', 31 'title' => $this->getLang('tb_note'), 32 'icon' => '../../plugins/note/images/tb_note.png', 33 'open' => '<note>', 34 'close' => '</note>', 35 ), 36 array( 37 'type' => 'format', 38 'title' => $this->getLang('tb_tip'), 39 'icon' => '../../plugins/note/images/tb_tip.png', 40 'open' => '<note tip>', 41 'close' => '</note>', 42 ), 43 array( 44 'type' => 'format', 45 'title' => $this->getLang('tb_important'), 46 'icon' => '../../plugins/note/images/tb_important.png', 47 'open' => '<note important>', 48 'close' => '</note>', 49 ), 50 array( 51 'type' => 'format', 52 'title' => $this->getLang('tb_warning'), 53 'icon' => '../../plugins/note/images/tb_warning.png', 54 'open' => '<note warning>', 55 'close' => '</note>', 56 ), 57 ) 58 ); 59 } 60} 61