forked from giterlizzi/dokuwiki-template-bootstrap3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tpl_global.php
executable file
·50 lines (41 loc) · 1.59 KB
/
tpl_global.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
<?php
/**
* DokuWiki Bootstrap3 Template: Global Configurations
*
* @link http://dokuwiki.org/template:bootstrap3
* @author Giuseppe Di Terlizzi <giuseppe.diterlizzi@gmail.com>
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*/
// must be run from within DokuWiki
if (!defined('DOKU_INC')) die();
global $ID;
global $JSINFO;
global $INPUT;
global $ACT;
global $EVENT_HANDLER;
// Get the template info (useful for debug)
if ($INFO['isadmin'] && $INPUT->str('do') && $INPUT->str('do') == 'check') {
$template_info = confToHash(dirname(__FILE__).'/template.info.txt');
msg('bootstrap3 template version: v' . $template_info['date'], 1, '', '', MSG_ADMINS_ONLY);
}
if ($INPUT->str('bootswatch-theme')) {
set_doku_pref('bootswatchTheme', $INPUT->str('bootswatch-theme'));
}
$EVENT_HANDLER->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', null, 'bootstrap3_metaheaders');
$page_on_panel = bootstrap3_conf('pageOnPanel');
// Populate JSINFO object
$JSINFO['bootstrap3'] = array(
'mode' => $ACT,
'config' => array(
'collapsibleSections' => (int) bootstrap3_conf('collapsibleSections'),
'sidebarOnNavbar' => (int) bootstrap3_conf('sidebarOnNavbar'),
'tagsOnTop' => (int) bootstrap3_conf('tagsOnTop'),
'tocAffix' => (int) bootstrap3_conf('tocAffix'),
'tocCollapseOnScroll' => (int) bootstrap3_conf('tocCollapseOnScroll'),
'tocCollapsed' => (int) bootstrap3_conf('tocCollapsed'),
'showSemanticPopup' => (int) bootstrap3_conf('showSemanticPopup'),
),
);
if ($ACT == 'admin') {
$JSINFO['bootstrap3']['admin'] = $INPUT->str('page');
}