1<?php
2/**
3 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
4 * @author     Andreas Gohr <andi@splitbrain.org>
5 */
6
7// must be run within Dokuwiki
8if(!defined('DOKU_INC')) die();
9
10class action_plugin_fontsize2 extends DokuWiki_Action_Plugin {
11
12    /**
13     * register the eventhandlers
14     *
15     * @author Andreas Gohr <andi@splitbrain.org>
16     */
17    public function register(Doku_Event_Handler $controller){
18        $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'fontsize2_toolbar', array ());
19    }
20
21    public function fontsize2_toolbar($event, $param) {
22        $event->data[] = array (
23            'type' => 'picker',
24            'title' => $this->getLang('fs_picker'),
25            'icon' => '../../plugins/fontsize2/images/toolbar/picker.png',
26            'list' => array(
27                array(
28                    'type'   => 'format',
29                    'title'  => $this->getLang('fs_xxs'),
30                    'sample' => $this->getLang('fs_xxs_sample'),
31                    'icon'   => '../../plugins/fontsize2/images/toolbar/xxs.png',
32                    'open'   => '<fs xx-small>',
33                    'close'  => '</fs>',
34                ),
35                array(
36                    'type'   => 'format',
37                    'title'  => $this->getLang('fs_xs'),
38                    'sample' => $this->getLang('fs_xs_sample'),
39                    'icon'   => '../../plugins/fontsize2/images/toolbar/xs.png',
40                    'open'   => '<fs x-small>',
41                    'close'  => '</fs>',
42                ),
43                array(
44                    'type'   => 'format',
45                    'title'  => $this->getLang('fs_s'),
46                    'sample' => $this->getLang('fs_s_sample'),
47                    'icon'   => '../../plugins/fontsize2/images/toolbar/s.png',
48                    'open'   => '<fs small>',
49                    'close'  => '</fs>',
50                ),
51                array(
52                    'type'   => 'format',
53                    'title'  => $this->getLang('fs_m'),
54                    'sample' => $this->getLang('fs_m_sample'),
55                    'icon'   => '../../plugins/fontsize2/images/toolbar/m.png',
56                    'open'   => '<fs medium>',
57                    'close'  => '</fs>',
58                ),
59                array(
60                    'type'   => 'format',
61                    'title'  => $this->getLang('fs_l'),
62                    'sample' => $this->getLang('fs_l_sample'),
63                    'icon'   => '../../plugins/fontsize2/images/toolbar/l.png',
64                    'open'   => '<fs large>',
65                    'close'  => '</fs>',
66                ),
67                array(
68                    'type'   => 'format',
69                    'title'  => $this->getLang('fs_xl'),
70                    'sample' => $this->getLang('fs_xl_sample'),
71                    'icon'   => '../../plugins/fontsize2/images/toolbar/xl.png',
72                    'open'   => '<fs x-large>',
73                    'close'  => '</fs>',
74                ),
75                array(
76                    'type'   => 'format',
77                    'title'  => $this->getLang('fs_xxl'),
78                    'sample' => $this->getLang('fs_xxl_sample'),
79                    'icon'   => '../../plugins/fontsize2/images/toolbar/xxl.png',
80                    'open'   => '<fs xx-large>',
81                    'close'  => '</fs>',
82                ),
83                array(
84                    'type'   => 'format',
85                    'title'  => $this->getLang('fs_smaller'),
86                    'sample' => $this->getLang('fs_smaller_sample'),
87                    'icon'   => '../../plugins/fontsize2/images/toolbar/smaller.png',
88                    'open'   => '<fs smaller>',
89                    'close'  => '</fs>',
90                ),
91                array(
92                    'type'   => 'format',
93                    'title'  => $this->getLang('fs_larger'),
94                    'sample' => $this->getLang('fs_larger_sample'),
95                    'icon'   => '../../plugins/fontsize2/images/toolbar/larger.png',
96                    'open'   => '<fs larger>',
97                    'close'  => '</fs>',
98                ),
99            )
100        );
101    }
102}
103
104