1<?php 2/** 3 * Composant Action pour Konsole (Toolbar) 4 * 5 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 6 * @author Fabrice DEJAIGHER <fabrice@chtiland.com> 7 */ 8 9if (!defined('DOKU_INC')) 10{ 11 die(); 12} 13 14if (!defined('DOKU_PLUGIN')) 15{ 16 define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/'); 17} 18require_once(DOKU_PLUGIN.'action.php'); 19 20class action_plugin_konsole extends DokuWiki_Action_Plugin 21{ 22 23 24 function register(Doku_Event_Handler $controller) 25 { 26 $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'handle_toolbar', array ()); 27 } 28 29 function handle_toolbar(&$event, $param) 30 { 31 $event->data[] = array ( 32 'type' => 'picker', 33 'title' => 'Konsole', 34 'class' => 'konsole_toolbar', 35 'icon' => '../../plugins/konsole/images/konsole_select.png', 36 'list' => array( 37 array( 38 'type' => 'format', 39 'title' => $this->getLang('konsoleuser'), 40 'icon' => '../../plugins/konsole/images/konsole.png', 41 'open' => '<konsole>\n', 42 'close' => '\n</konsole>\n', 43 ), 44 array( 45 'type' => 'format', 46 'title' => $this->getLang('konsoleroot'), 47 'icon' => '../../plugins/konsole/images/konsole_root.png', 48 'open' => '<konsole root>\n', 49 'close' => '\n</konsole>\n', 50 ) 51 52 ) 53 ); 54 } 55} 56 57