1<?php
2/**
3 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
4 * @author     Andreas Gohr <andi@splitbrain.org>
5 * @author     Rainbow-Spike <rainbow_spike@derpy.ru>
6 */
7
8// must be run within Dokuwiki
9if(!defined('DOKU_INC')) die();
10
11if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
12require_once(DOKU_PLUGIN.'action.php');
13
14class action_plugin_fontfamily extends DokuWiki_Action_Plugin {
15
16    /**
17     * register the eventhandlers
18     *
19     * @author Andreas Gohr <andi@splitbrain.org>
20     */
21    function register(Doku_Event_Handler $controller){
22        $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'handle_toolbar', array ());
23    }
24
25    function handle_toolbar(&$event, $param) {
26        $event->data[] = array (
27            'type' => 'picker',
28            'title' => $this->getLang('ff_picker'),
29            'icon' => '/lib/plugins/fontfamily/images/toolbar_icon.png',
30            'list' => array(
31                array(
32                    'type'   => 'format',
33                    'title'  => $this->getLang('Arial'),
34                    'icon'   => '/lib/plugins/fontfamily/images/Arial.png',
35                    'open'   => '<ff Arial>',
36                    'close'  => '</ff>',
37                ),
38                array(
39                    'type'   => 'format',
40                    'title'  => $this->getLang('BrushScriptMS'),
41                    'icon'   => '/lib/plugins/fontfamily/images/BrushScriptMS.png',
42                    'open'   => '<ff BrushScriptMS>',
43                    'close'  => '</ff>',
44                ),
45                array(
46                    'type'   => 'format',
47                    'title'  => $this->getLang('ComicSansMS'),
48                    'icon'   => '/lib/plugins/fontfamily/images/ComicSansMS.png',
49                    'open'   => '<ff ComicSansMS>',
50                    'close'  => '</ff>',
51                ),
52                array(
53                    'type'   => 'format',
54                    'title'  => $this->getLang('Georgia'),
55                    'icon'   => '/lib/plugins/fontfamily/images/Georgia.png',
56                    'open'   => '<ff Georgia>',
57                    'close'  => '</ff>',
58                ),
59                array(
60                    'type'   => 'format',
61                    'title'  => $this->getLang('Impact'),
62                    'icon'   => '/lib/plugins/fontfamily/images/Impact.png',
63                    'open'   => '<ff Impact>',
64                    'close'  => '</ff>',
65                ),
66                array(
67                    'type'   => 'format',
68                    'title'  => $this->getLang('TimesNewRoman'),
69                    'icon'   => '/lib/plugins/fontfamily/images/TimesNewRoman.png',
70                    'open'   => '<ff TimesNewRoman>',
71                    'close'  => '</ff>',
72                ),
73                array(
74                    'type'   => 'format',
75                    'title'  => $this->getLang('TrebuchetMS'),
76                    'icon'   => '/lib/plugins/fontfamily/images/TrebuchetMS.png',
77                    'open'   => '<ff TrebuchetMS>',
78                    'close'  => '</ff>',
79                ),
80                array(
81                    'type'   => 'format',
82                    'title'  => $this->getLang('Verdana'),
83                    'icon'   => '/lib/plugins/fontfamily/images/Verdana.png',
84                    'open'   => '<ff Verdana>',
85                    'close'  => '</ff>',
86                ),
87                array(
88                    'type'   => 'format',
89                    'title'  => $this->getLang('Webdings'),
90                    'icon'   => '/lib/plugins/fontfamily/images/Webdings.png',
91                    'open'   => '<ff Webdings>',
92                    'close'  => '</ff>',
93                ),
94            )
95        );
96    }
97}
98