-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.php
48 lines (40 loc) · 1.44 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
<?php
/**
* Site Export Plugin
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author i-net software <[email protected]>
* @author Gerry Weissbach <[email protected]>
*/
// must be run within Dokuwiki
if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/');
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
require_once(DOKU_PLUGIN.'action.php');
class action_plugin_nodetailsxhtml extends DokuWiki_Action_Plugin {
/**
* for backward compatability
* @see inc/DokuWiki_Plugin#getInfo()
*/
function getInfo(){
if ( method_exists(parent, 'getInfo')) {
$info = parent::getInfo();
}
return is_array($info) ? $info : confToHash(dirname(__FILE__).'/../plugin.info.txt');
}
/**
* Register Plugin in DW
**/
function register(Doku_Event_Handler $controller) {
$controller->register_hook('TPL_TOC_RENDER', 'BEFORE', $this, 'check_toc');
}
/**
* Check for Template changes
**/
function check_toc( Doku_Event $event ) {
global $conf, $INFO;
if ( empty($event->data) && array_key_exists( 'forceTOC', $INFO['meta'] ) && $INFO['meta']['forceTOC'] == true ) {
$event->data = $INFO['meta']['description']['tableofcontents'];
}
}
}
//Setup VIM: ex: et ts=4 enc=utf-8 :