-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathaction.php
53 lines (50 loc) · 1.7 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
/**
* AcMenu plugin: an accordion menu for namespaces and relative pages.
*
* action.php: methods used by Acmenu plugin that interact with DokuWiki events.
*
* @author Torpedo <[email protected]>
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @package action
*/
/**
* Defines the methods used by AcMenu plugin to interact with DokuWiki's events.
*
* @package action_pycode
*/
class action_plugin_acmenu extends DokuWiki_Action_Plugin
{
/**
* Register the event handlers
*/
function register(Doku_Event_Handler $controller)
{
$controller->register_hook("DOKUWIKI_STARTED", "AFTER", $this, "_add_user_conf", array());
}
/**
* Add some user's configuration to the $JSINFO variable.
*
* @param object $event
* the event object
* @param array $param
* data passed when this handler was registered
*/
function _add_user_conf(Doku_Event $event, $param)
{
global $conf;
global $INFO;
global $JSINFO;
$JSINFO["plugin_acmenu"]["doku_base"] = DOKU_BASE;
$JSINFO["plugin_acmenu"]["doku_url"] = DOKU_URL;
$JSINFO["plugin_acmenu"]["doku_script"] = DOKU_SCRIPT;
$JSINFO["plugin_acmenu"]["start"] = $conf["start"];
$JSINFO["plugin_acmenu"]["useslash"] = $conf["useslash"];
$JSINFO["plugin_acmenu"]["canonical"] = $conf["canonical"];
$JSINFO["plugin_acmenu"]["userewrite"] = $conf["userewrite"];
// namespace genealogy doesn't exist for an id deleated
if(isset($INFO["meta"]["plugin"]["plugin_acmenu"]["sub_ns"])) {
$JSINFO["plugin_acmenu"]["sub_ns"] = $INFO["meta"]["plugin"]["plugin_acmenu"]["sub_ns"];
}
}
}