forked from giterlizzi/dokuwiki-template-bootstrap3
/
tpl_global.php
executable file
·119 lines (103 loc) · 4.76 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?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)
*/
$showTools = tpl_getConf('showTools') != 'never' &&
( tpl_getConf('showTools') == 'always' || !empty($_SERVER['REMOTE_USER']) );
$individualTools = tpl_getConf('individualTools');
$showUserHomeLink = tpl_getConf('showUserHomeLink');
$showLoginOnFooter = tpl_getConf('showLoginOnFooter');
$showLoginLink = ! tpl_getConf('hideLoginLink') || ! empty($_SERVER['REMOTE_USER']);
$showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
$sidebarPosition = tpl_getConf('sidebarPosition');
$showRightSidebar = page_findnearest(tpl_getConf('rightSidebar')) && ($ACT=='show');
$rightSidebar = tpl_getConf('rightSidebar');
$showCookieLawBanner = tpl_getConf('showCookieLawBanner');
$cookieLawBannerPage = tpl_getConf('cookieLawBannerPage');
$cookieLawPolicyPage = tpl_getConf('cookieLawPolicyPage');
$browserTitle = str_replace(array('@WIKI@', '@TITLE@'),
array(strip_tags($conf['title']), tpl_pagetitle(null, true)),
tpl_getConf('browserTitle'));
$showThemeSwitcher = tpl_getConf('showThemeSwitcher');
$fixedTopNavbar = tpl_getConf('fixedTopNavbar');
$inverseNavbar = tpl_getConf('inverseNavbar');
$bootstrapTheme = tpl_getConf('bootstrapTheme');
$customTheme = tpl_getConf('customTheme');
$bootswatchTheme = tpl_getConf('bootswatchTheme');
$pageOnPanel = tpl_getConf('pageOnPanel');
$fluidContainer = tpl_getConf('fluidContainer');
$showPageInfo = tpl_getConf('showPageInfo');
$showBadges = tpl_getConf('showBadges');
$semantic = tpl_getConf('semantic');
$schemaOrgType = tpl_getConf('schemaOrgType');
$leftSidebarGrid = tpl_getConf('leftSidebarGrid');
$rightSidebarGrid = tpl_getConf('rightSidebarGrid');
$contentGrid = _tpl_get_container_grid();
$hideInThemeSwitcher = explode(',', tpl_getConf('hideInThemeSwitcher'));
$bootstrapStyles = array();
$tplConfigJSON = array(
'tableFullWidth' => (int) tpl_getConf('tableFullWidth'),
);
// Tools Menu
$tools = array(
'user' => array(
'icon' => 'glyphicon glyphicon-user',
'items' => array(
'admin' => _tpl_action_item('admin', 'glyphicon glyphicon-cog'),
'profile' => _tpl_action_item('profile', 'glyphicon glyphicon-refresh'),
#'register' => _tpl_action_item('register', 'glyphicon glyphicon-edit'),
#'login' => _tpl_action_item('login', 'glyphicon glyphicon-log-'.(!empty($_SERVER['REMOTE_USER']) ? 'out' : 'in')),
)
),
'site' => array(
'icon' => 'glyphicon glyphicon-cog',
'items' => array(
'recent' => _tpl_action_item('recent', 'glyphicon glyphicon-list-alt'),
'media' => _tpl_action_item('media', 'glyphicon glyphicon-picture'),
'index' => _tpl_action_item('index', 'glyphicon glyphicon-list'),
)
),
'page' => array(
'icon' => 'glyphicon glyphicon-file',
'items' => array(
'edit' => _tpl_action_item('edit', 'glyphicon glyphicon-edit'),
'discussion' => _tpl_action_item('discussion', 'glyphicon glyphicon-comment'),
'revert' => _tpl_action_item('revert', 'glyphicon glyphicon-repeat'),
'revisions' => _tpl_action_item('revisions', 'glyphicon glyphicon-time'),
'backlink' => _tpl_action_item('backlink', 'glyphicon glyphicon-link'),
'subscribe' => _tpl_action_item('subscribe', 'glyphicon glyphicon-bookmark'),
'top' => _tpl_action_item('top', 'glyphicon glyphicon-chevron-up'),
)
),
);
if ($showThemeSwitcher && $bootstrapTheme == 'bootswatch') {
if (get_doku_pref('bootswatchTheme', null) !== null && get_doku_pref('bootswatchTheme', null) !== '') {
$bootswatchTheme = get_doku_pref('bootswatchTheme', null);
}
global $INPUT;
if ($INPUT->str('bootswatchTheme')) {
$bootswatchTheme = $INPUT->str('bootswatchTheme');
set_doku_pref('bootswatchTheme', $bootswatchTheme);
}
}
switch ($bootstrapTheme) {
case 'optional':
$bootstrapStyles[] = DOKU_TPL.'assets/bootstrap/css/bootstrap.min.css';
$bootstrapStyles[] = DOKU_TPL.'assets/bootstrap/css/bootstrap-theme.min.css';
break;
case 'custom':
$bootstrapStyles[] = $customTheme;
break;
case 'bootswatch':
//$bootstrapStyles[] = "//bootswatch.com/$bootswatchTheme/bootstrap.min.css";
$bootstrapStyles[] = "//maxcdn.bootstrapcdn.com/bootswatch/3.3.5/$bootswatchTheme/bootstrap.min.css";
break;
case 'default':
default:
$bootstrapStyles[] = DOKU_TPL.'assets/bootstrap/css/bootstrap.min.css';
break;
}