1<?php
2/**
3 * Action Plugin: Inserts a button into the toolbar to add file tags
4 *
5 * @author Georg Schmidt, Heiko Barth
6 */
7
8if (!defined('DOKU_INC')) die();
9if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
10require_once (DOKU_PLUGIN . 'action.php');
11
12class action_plugin_codebuttonmod1 extends DokuWiki_Action_Plugin {
13
14    /**
15     * Register the eventhandlers
16     */
17    function register(Doku_Event_Handler $controller) {
18        $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array ());
19    }
20
21    /**
22     * Inserts the toolbar button
23     */
24    function insert_button(& $event, $param) {
25        $event->data[] = array (
26            'type' => 'format',
27            'title' => $this->getLang('insertcode'),
28            'icon' => '../../plugins/codebuttonmod1/image/code.png',
29            'open' => '<code | download>\n',
30            'close' => '\n</code>',
31        );
32    }
33}
34