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