-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathaction.php
72 lines (65 loc) · 1.71 KB
/
action.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* Composant Action pour HowHard (Toolbar)
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Fabrice DEJAIGHER <[email protected]>
*/
if (!defined('DOKU_INC'))
{
die();
}
if (!defined('DOKU_PLUGIN'))
{
define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
}
require_once(DOKU_PLUGIN . 'action.php');
class action_plugin_howhard extends DokuWiki_Action_Plugin
{
function register(Doku_Event_Handler $controller)
{
$controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'handle_toolbar', array ());
}
function handle_toolbar(&$event, $param)
{
$event->data[] = array
(
'type' => 'picker',
'title' => 'HowHard',
'class' => 'howhard_toolbar',
'icon' => '../../plugins/howhard/images/toolbar/level_select.png',
'list' => array (
array (
'type' => 'insert',
'title' => $this->getLang('level1'),
'icon' => '../../plugins/howhard/images/toolbar/1.png',
'insert' => '{{howhard>1}}',
),
array (
'type' => 'insert',
'title' => $this->getLang('level2'),
'icon' => '../../plugins/howhard/images/toolbar/2.png',
'insert' => '{{howhard>2}}',
),
array (
'type' => 'insert',
'title' => $this->getLang('level3'),
'icon' => '../../plugins/howhard/images/toolbar/3.png',
'insert' => '{{howhard>3}}',
),
array (
'type' => 'insert',
'title' => $this->getLang('level4'),
'icon' => '../../plugins/howhard/images/toolbar/4.png',
'insert' => '{{howhard>4}}',
),
array (
'type' => 'insert',
'title' => $this->getLang('level5'),
'icon' => '../../plugins/howhard/images/toolbar/5.png',
'insert' => '{{howhard>5}}',
)
)
);
}
}