forked from chimeric/dokuwiki-template-arctic
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmain.php
258 lines (228 loc) · 8.25 KB
/
main.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<?php
/**
* DokuWiki Arctic Template.
*
* This is the template you need to change for the overall look
* of DokuWiki.
*
* You should leave the doctype at the very top - It should
* always be the very first line of a document.
*
* @author Mark C. Prins <[email protected]>
* @author Andreas Gohr <[email protected]>
* @author Michael Klier <[email protected]>
* @link http://www.dokuwiki.org/template:arctic
*/
// must be run from within DokuWiki
if (!defined('DOKU_INC')) die();
global $ACT;
// include custom arctic template functions
require_once(dirname(__FILE__).'/tpl_functions.php');
?>
<!DOCTYPE html>
<html lang="<?php echo $conf['lang']?>" id="document" dir="<?php echo $lang['direction']?>">
<head<?php if (tpl_getConf('opengraphheading')) { ?> prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article# fb: http://ogp.me/ns/fb# place: http://ogp.me/ns/place# book: http://ogp.me/ns/book#"<?php } ?>>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>
<?php tpl_pagetitle()?>
[<?php echo strip_tags($conf['title'])?>]
</title>
<?php tpl_metaheaders()?>
<?php echo tpl_favicon() ?>
<?php tpl_includeFile('meta.html') ?>
</head>
<body>
<div id="skiplinks" class="skiplinks">
<a href="#dokuwiki__content" class="skiplink"><?php echo $lang['skip_to_content']; ?></a>
</div>
<?php tpl_includeFile('topheader.html') ?>
<div id="wrapper" class='<?php echo $ACT ?>'>
<div class="dokuwiki">
<?php html_msgarea()?>
<header class="stylehead">
<div class="header">
<div class="pagename">
[[<?php tpl_link(wl($ID,'do=backlink'),tpl_pagetitle($ID,true))?>]]
</div>
<div class="logo">
<?php tpl_link(wl(),$conf['title'],'id="dokuwiki__top" accesskey="h" title="[ALT+H]"')?>
</div>
</div>
<?php if(tpl_getConf('trace')) {?>
<div class="breadcrumbs">
<?php ($conf['youarehere'] != 1) ? tpl_breadcrumbs() : tpl_youarehere();?>
</div>
<?php } ?>
<?php tpl_includeFile('header.html') ?>
</header>
<?php if(!$toolb) { ?>
<?php if(!tpl_getConf('hideactions') || tpl_getConf('hideactions') && isset($_SERVER['REMOTE_USER'])) { ?>
<div class="bar" id="bar__top">
<div class="bar-left">
<?php
if(!tpl_getConf('closedwiki') || (tpl_getConf('closedwiki') && isset($_SERVER['REMOTE_USER']))) {
switch(tpl_getConf('wiki_actionlinks')) {
case('buttons'):
// check if new page button plugin is available
if(!plugin_isdisabled('npd') && ($npd =& plugin_load('helper', 'npd'))) {
$npd->html_new_page_button();
}
tpl_button('edit');
break;
case('links'):
// check if new page button plugin is available
if(!plugin_isdisabled('npd') && ($npd =& plugin_load('helper', 'npd'))) {
$npd->html_new_page_button();
}
tpl_actionlink('edit');
break;
}
}
?>
</div>
<div class="bar-right">
<?php
switch(tpl_getConf('wiki_actionlinks')) {
case('buttons'):
if(!tpl_getConf('closedwiki') || (tpl_getConf('closedwiki') && isset($_SERVER['REMOTE_USER']))) {
tpl_button('admin');
tpl_button('revert');
tpl_button('profile');
tpl_button('recent');
tpl_button('index');
tpl_button('login');
if(tpl_getConf('sidebar') == 'none') arctic_tpl_searchform();
} else {
tpl_button('login');
}
break;
case('links'):
if(!tpl_getConf('closedwiki') || (tpl_getConf('closedwiki') && isset($_SERVER['REMOTE_USER']))) {
tpl_actionlink('admin');
tpl_actionlink('revert');
tpl_actionlink('profile');
tpl_actionlink('recent');
tpl_actionlink('index');
tpl_actionlink('login');
if(tpl_getConf('sidebar') == 'none') arctic_tpl_searchform();
} else {
tpl_actionlink('login');
}
break;
}
?>
</div>
</div>
<?php } ?>
<?php } ?>
<?php tpl_includeFile('pageheader.html') ?>
<?php flush()?>
<?php if(tpl_getConf('sidebar') == 'left') { ?>
<?php if(!arctic_tpl_sidebar_hide()) { ?>
<div class="left_sidebar">
<?php arctic_tpl_searchform() ?>
<?php arctic_tpl_sidebar('left') ?>
</div>
<main class="right_page" id="dokuwiki__content" tabindex="-1">
<?php ($notoc) ? tpl_content(false) : tpl_content() ?>
</main>
<?php } else { ?>
<main class="page" id="dokuwiki__content" tabindex="-1">
<?php tpl_content()?>
</main>
<?php } ?>
<?php } elseif(tpl_getConf('sidebar') == 'right') { ?>
<?php if(!arctic_tpl_sidebar_hide()) { ?>
<main class="left_page" id="dokuwiki__content" tabindex="-1">
<?php ($notoc) ? tpl_content(false) : tpl_content() ?>
</main>
<div class="right_sidebar">
<?php arctic_tpl_searchform() ?>
<?php arctic_tpl_sidebar('right') ?>
</div>
<?php } else { ?>
<main class="page" id="dokuwiki__content" tabindex="-1">
<?php tpl_content() ?>
</main>
<?php }?>
<?php } elseif(tpl_getConf('sidebar') == 'both') { ?>
<?php if(!arctic_tpl_sidebar_hide()) { ?>
<div class="left_sidebar">
<?php if(tpl_getConf('search') == 'left') arctic_tpl_searchform() ?>
<?php arctic_tpl_sidebar('left') ?>
</div>
<main class="center_page" id="dokuwiki__content" tabindex="-1">
<?php ($notoc) ? tpl_content(false) : tpl_content() ?>
</main>
<div class="right_sidebar">
<?php if(tpl_getConf('search') == 'right') arctic_tpl_searchform() ?>
<?php arctic_tpl_sidebar('right') ?>
</div>
<?php } else { ?>
<main class="page" id="dokuwiki__content" tabindex="-1">
<?php tpl_content()?>
</main>
<?php }?>
<?php } elseif(tpl_getConf('sidebar') == 'none') { ?>
<main class="page" id="dokuwiki__content" tabindex="-1">
<?php tpl_content() ?>
</main>
<?php } ?>
<footer class="stylefoot">
<div class="meta">
<div class="user">
<?php tpl_userinfo()?>
</div>
<div class="doc">
<?php tpl_pageinfo()?>
</div>
</div>
</footer>
<div class="clearer"></div>
<?php flush()?>
<?php if(!$toolb) { ?>
<?php if(!tpl_getConf('hideactions') || tpl_getConf('hideactions') && isset($_SERVER['REMOTE_USER'])) { ?>
<?php if(!tpl_getConf('closedwiki') || (tpl_getConf('closedwiki') && isset($_SERVER['REMOTE_USER']))) { ?>
<div class="bar" id="bar__bottom">
<div class="bar-left">
<?php
switch(tpl_getConf('wiki_actionlinks')) {
case('buttons'):
tpl_button('edit');
tpl_button('history');
break;
case('links'):
tpl_actionlink('edit');
tpl_actionlink('history');
break;
}
?>
</div>
<div class="bar-right">
<?php
switch(tpl_getConf('wiki_actionlinks')) {
case('buttons'):
tpl_button('media');
tpl_button('subscribe');
tpl_button('top');
break;
case('links'):
tpl_actionlink('media');
tpl_actionlink('subscribe');
tpl_actionlink('top');
break;
}
?>
</div>
</div>
<div class="clearer"></div>
<?php } ?>
<?php } ?>
<?php } ?>
<?php tpl_includeFile('footer.html') ?>
</div>
</div>
<div class="no"><?php /* provide DokuWiki housekeeping, required in all templates */ tpl_indexerWebBug()?></div>
</body>
</html>