-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.php
53 lines (46 loc) · 1.22 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
<?php
/**
* AutoIndentControl Plugin for DokuWiki / action.php
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Kazutaka Miyasaka <[email protected]>
*/
// must be run within DokuWiki
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_autoindentcontrol extends DokuWiki_Action_Plugin
{
/**
* Returns some info
*/
function getInfo()
{
return confToHash(DOKU_PLUGIN . 'autoindentcontrol/plugin.info.txt');
}
/**
* Registers an event handler
*/
function register(&$controller)
{
$controller->register_hook(
'DOKUWIKI_STARTED', 'AFTER', $this, 'exportToJSINFO'
);
}
/**
* Exports configuration settings to $JSINFO
*/
function exportToJSINFO(&$event)
{
global $JSINFO;
$JSINFO['plugin_autoindentcontrol'] = array(
'defaultOFF' => (boolean) !$this->getConf('default_behavior'),
'showToggle' => (boolean) $this->getConf('show_toggle_switch'),
'isLemming' => (boolean) !function_exists('valid_input_set'),
);
}
}