forked from selfthinker/dokuwiki_template_writr
-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.php
205 lines (184 loc) · 9.32 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
<?php
/**
* DokuWiki Writr Template
*
* @link http://dokuwiki.org/template:writr
* @author Louis Ouellet <[email protected]>
* @author Anika Henke <[email protected]>
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*/
if (!defined('DOKU_INC')) die();
@require_once(dirname(__FILE__).'/tpl_functions.php');
header('X-UA-Compatible: IE=edge,chrome=1');
$showSidebar = page_findnearest($conf['sidebar']);
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang'] ?>"
lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>" class="no-js">
<head>
<meta charset="UTF-8" />
<title><?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title']) ?>]</title>
<script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
<?php tpl_metaheaders() ?>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<?php echo tpl_favicon(array('favicon', 'mobile')) ?>
<?php tpl_includeFile('meta.html') ?>
</head>
<body id="dokuwiki__top" class="sidebar-closed <?php if(tpl_getConf('makeFullWidth')){ echo "makeFullWidth"; } ?> <?php if(tpl_getConf('useTooltips')){ echo "enableTooltips"; } ?> <?php echo tpl_classes(); ?> <?php if(tpl_getConf('useToolbar')){ echo "enableToolbar"; } else { echo "disableToolbar"; } ?>">
<div id="writr__toolbar">
<div class="hook"><?php tpl_include_page('topbar', 1, 1) ?></div>
<?php if ($conf['useacl']): ?>
<!-- USER TOOLS -->
<?php echo tpl_getMenu('usermenu'); ?>
<?php endif ?>
</div>
<div id="writr__page" class="hfeed <?php echo ($showSidebar) ? 'hasSidebar' : ''; ?>">
<?php tpl_includeFile('header.html') ?>
<div class="sidebar-area group" id="writr__sidebar">
<a id="writr__sidebar-toggle" href="#writr__secondary" title="<?php echo $lang['sidebar'] ?>">
<span class="genericon genericon-close"></span>
<span class="a11y"><?php echo $lang['sidebar'] ?></span>
</a>
<!-- ********** HEADER ********** -->
<header id="writr__masthead" class="site-header" role="banner">
<?php echo tpl_getSiteBranding(); ?>
<div class="search-form widget">
<?php tpl_searchform() ?>
</div>
<?php if (page_findnearest('topnav')): ?>
<nav id="writr__site-navigation" class="main-navigation" role="navigation">
<h3 class="menu-toggle genericon genericon-menu" title="<?php echo tpl_getLang('menu') ?>">
<span class="a11y"><?php echo tpl_getLang('menu') ?></span>
</h3>
<div class="a11y skip-link">
<a href="#writr__content"><?php echo $lang['skip_to_content'] ?></a>
</div>
<?php tpl_include_page('topnav', 1, 1) ?>
</nav><!-- #writr__site-navigation -->
<?php endif; ?>
</header><!-- #writr__masthead -->
<div id="writr__secondary" class="widget-area" role="complementary">
<?php if ($conf['sidebar']): ?>
<div class="widget">
<?php tpl_includeFile('sidebarheader.html') ?>
<?php tpl_include_page($conf['sidebar'], 1, 1) ?>
<?php tpl_includeFile('sidebarfooter.html') ?>
</div>
<?php endif ?>
<div class="tools widget_links widget">
<?php if(!tpl_getConf('doSiteToolsRequireLogin') || !$conf['useacl'] || (tpl_getConf('doSiteToolsRequireLogin') && isset($INFO['userinfo']))){ ?>
<!-- SITE TOOLS -->
<div class="site-tools">
<h3 <?php if(!tpl_getConf('showSiteToolsTitle')){ echo 'class="a11y"'; } ?>><?php echo $lang['site_tools'] ?></h3>
<ul>
<?php $items = (new \dokuwiki\Menu\SiteMenu())->getItems();
foreach($items as $item) {
echo '<li>'
.'<a href="'.$item->getLink().'" class="action '.strtolower($item->getType()).'" rel="nofollow" title="'.$item->getTitle().'">'
.'<span></span> '
.$item->getLabel()
.'</a></li>';
} ?>
</ul>
</div>
<?php } ?>
</div>
<footer id="writr__colophon" class="site-footer" role="contentinfo">
<div class="site-info">
<?php tpl_license('button') ?>
<?php tpl_includeFile('footer.html') ?>
</div><!-- .site-info -->
</footer><!-- #writr__colophon -->
</div>
<?php echo tpl_getMenu('sidebarmenu'); ?>
</div>
<!-- PAGE TOOLS -->
<div class="page-tools">
<h3 <?php if(!tpl_getConf('showPageToolsTitle')){ echo 'class="a11y"'; } ?>><?php echo $lang['page_tools'] ?></h3>
<ul>
<?php if (!$conf['useacl'] || ($conf['useacl'] && $INFO['perm'] >= 4)): ?>
<?php
$instructions = '{{NEWPAGE';
if(tpl_getConf('defaultAddNewPage') !== ''){
$instructions .= '>';
$instructions .= tpl_getConf('defaultAddNewPage');
}
$instructions .= '}}';
$instructions = p_get_instructions($instructions);
if(count($instructions) > 0) {
$render = p_render('xhtml',$instructions,$info);
echo '<li>'
.'<a href="#" class="action AddNewPage" title="'.tpl_getLang('AddNewPage').'">'
.'<span class="icon"></span>'
.'<span class="a11y">'.tpl_getLang('AddNewPage').'</span>'
.'</a>'
.$render
.'</li>';
}
?>
<?php endif ?>
<?php
$starred = plugin_load('action','starred');
if ($starred) {
$render = $starred->tpl_starred(false,false);
echo '<li>'.$render.'</li>';
}
?>
<?php $translation = plugin_load('helper','translation');
if ($translation){
$render = $translation->showTranslations(false);
echo '<li>'
.'<a href="#" class="action Translation" title="'.tpl_getLang('Language').'">'
.'<span class="icon"></span>'
.'<span class="a11y">'.tpl_getLang('Language').'</span>'
.'</a>'
.$render
.'</li>';
} ?>
<?php $items = (new \dokuwiki\Menu\PageMenu())->getItems();
foreach($items as $item) {
$attributes = $item->getLinkAttributes();
$html = '<li><a';
foreach($attributes as $key => $value) {
$html .= ' '.$key.'="'.$value.'"';
}
$html .= '><span class="icon"></span>'
.'<span class="a11y">'.$item->getLabel().'</span>'
.'</a></li>';
echo $html;
} ?>
</ul>
</div>
<div id="writr__content" class="site-content">
<div id="writr__primary" class="content-area">
<div class="writr-message-area">
<!-- Translation Notication -->
<?php if($translation) { $translation->checkage(); } ?>
<!-- Message Area -->
<?php html_msgarea() ?>
</div>
<!-- BREADCRUMBS -->
<?php if($conf['breadcrumbs']){ ?>
<div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div>
<?php } ?>
<?php if($conf['youarehere']){ ?>
<div class="breadcrumbs"><?php tpl_youarehere() ?></div>
<?php } ?>
<main id="writr__main" class="site-main group" role="main">
<?php tpl_flush() ?>
<?php tpl_includeFile('pageheader.html') ?>
<!-- wikipage start -->
<?php tpl_content() ?>
<!-- wikipage stop -->
<?php tpl_flush() ?>
<?php tpl_includeFile('pagefooter.html') ?>
</main><!-- #writr__main -->
<div class="page-footer">
<?php tpl_pageinfo(); ?>
</div>
</div><!-- #writr__primary -->
</div><!-- #writr__content -->
</div><!-- #writr__page -->
<div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
</body>
</html>