1<?php 2 3/** 4 * Doodle Plugin 3 Toolbar: adds a toolbar button for easy use of the plugin doodle3 5 * 6 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 7 * @url http://www.dokuwiki.org/plugin:doodle3toolbar 8 * @author Matthias Jung <matzekuh@web.de> 9 */ 10 11if (!defined('DOKU_INC')) die(); 12 13class action_plugin_doodle3toolbar extends DokuWiki_Action_Plugin { 14 15 /** 16 * Register its handlers with the dokuwiki's event controller 17 */ 18 public function register(&$controller) { 19 $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array()); 20 } 21 22 /** 23 * Define a toolbar button, that inserts a text defined in the addon conf 24 */ 25 public function insert_button(&$event, $param) { 26 $event->data[] = array ( 27 'type' => 'insert', 28 'title' => 'doodle3', 29 'icon' => '../../plugins/doodle3toolbar/icon.png', 30 'insert' => $this->getConf('inserttext') 31 ); 32 } 33} 34?> 35