forked from giterlizzi/dokuwiki-template-bootstrap3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtpl_global.php
executable file
·49 lines (39 loc) · 1.61 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
<?php
/**
* DokuWiki Bootstrap3 Template: Global Configurations
*
* @link http://dokuwiki.org/template:bootstrap3
* @author Giuseppe Di Terlizzi <[email protected]>
* @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);
}
$EVENT_HANDLER->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', null, 'bootstrap3_metaheaders');
$page_on_panel = bootstrap3_conf('pageOnPanel');
$bootstrap_theme = bootstrap3_conf('bootstrapTheme');
$bootswatch_theme = bootstrap3_bootswatch_theme();
$JSINFO['bootstrap3'] = array(
'tableFullWidth' => (int) bootstrap3_conf('tableFullWidth'),
'tableStyle' => bootstrap3_conf('tableStyle'),
'tagsOnTop' => (int) bootstrap3_conf('tagsOnTop'),
'useAnchorJS' => (int) bootstrap3_conf('useAnchorJS'),
'collapsibleSections' => (int) bootstrap3_conf('collapsibleSections'),
'mode' => $ACT,
);
if ($ACT == 'admin') {
$JSINFO['bootstrap3']['admin'] = $INPUT->str('page');
}
$body_classes = array();
$body_classes[] = (($bootstrap_theme == 'bootswatch') ? $bootswatch_theme : $bootstrap_theme);
$body_classes[] = ($page_on_panel ? ' page-on-panel' : null);
$body_classes[] = tpl_classes();