forked from Taggic/xsSnipper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.php
More file actions
110 lines (104 loc) · 4.39 KB
/
action.php
File metadata and controls
110 lines (104 loc) · 4.39 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/**
* Action Plugin: Inserts a button into the toolbar to add file tags
*
* @author Heiko Barth
*/
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_xssnipper extends DokuWiki_Action_Plugin {
/**
* Return some info
*/
function getInfo() {
return array (
'author' => 'Heiko Barth',
'date' => '2016-06-02',
'name' => 'Toolbar Code Button',
'desc' => 'Inserts a code button into the toolbar',
'url' => 'http://www.heiko-barth.de/download.php?id=dw_codebutton',
);
}
/**
* Register the eventhandlers
*/
function register(Doku_Event_Handler $controller) {
$controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array ());
}
/**
* Inserts the toolbar button
*/
function insert_button(&$event, $param) {
$event->data[] = array (
'type' => 'picker',
'title' => 'Code select',
'icon' => '../../plugins/xssnipper/images/code.png',
'list' => array(
array(
'type' => 'format',
'title' => 'xssnip',
'icon' => '../../plugins/xssnipper/images/code_xssnip.png',
'open' => '{(xssnipper>',
'close' => ')}',
),
array(
'type' => 'format',
'title' => 'code',
'icon' => '../../plugins/xssnipper/images/code_code.png',
'open' => '<code>\n',
'close' => '\n</code>',
),
array(
'type' => 'format',
'title' => 'php',
'icon' => '../../plugins/xssnipper/images/code_php.png',
'open' => '<code php>\n',
'close' => '\n</code>',
),
array(
'type' => 'format',
'title' => 'html',
'icon' => '../../plugins/xssnipper/images/code_html.png',
'open' => '<code html>\n',
'close' => '\n</code>',
),
array(
'type' => 'format',
'title' => 'js',
'icon' => '../../plugins/xssnipper/images/code_js.png',
'open' => '<code php>\n',
'close' => '\n</code>',
),
array(
'type' => 'format',
'title' => 'code',
'icon' => '../../plugins/xssnipper/images/code_css.png',
'open' => '<code css>\n',
'close' => '\n</code>',
),
array(
'type' => 'format',
'title' => 'txt',
'icon' => '../../plugins/xssnipper/images/code_txt.png',
'open' => '<code txt>\n',
'close' => '\n</code>',
),
array(
'type' => 'format',
'title' => 'xml',
'icon' => '../../plugins/xssnipper/images/code_xml.png',
'open' => '<code xml>\n',
'close' => '\n</code>',
),
array(
'type' => 'format',
'title' => 'file',
'icon' => '../../plugins/xssnipper/images/code_file.png',
'open' => '<file>\n',
'close' => '\n</file>',
)
)
);
}
}