forked from dokufreaks/plugin-folded
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.php
40 lines (36 loc) · 1.26 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
<?php
/**
* Folded plugin: enables folded text font size with syntax ++ text ++
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Michael Hamann <michael@content-space.de>
*/
if(!defined('DOKU_INC')) die(); // no Dokuwiki, no go
/**
* Action part: makes the show/hide strings available in the browser
*/
class action_plugin_folded extends DokuWiki_Action_Plugin {
/**
* Register the handle function in the controller
*
* @param Doku_event_handler $controller The event controller
*/
function register(Doku_Event_Handler $controller) {
$controller->register_hook('DOKUWIKI_STARTED', 'AFTER', $this, 'addhidereveal');
}
/**
* Add the hide and reveal strings to $JSINFO so it can be used in the javascript
*
* @param Doku_Event $event The event
* @param array $params The parameters for the event
*/
function addhidereveal($event, $params) {
global $JSINFO;
$hide = $this->getConf('hide') ? $this->getConf('hide') : $this->getLang('hide');
$reveal = $this->getConf('reveal') ? $this->getConf('reveal') : $this->getLang('reveal');
$JSINFO['plugin_folded'] = array(
'hide' => $hide,
'reveal' => $reveal
);
}
}