1<?php
2/**
3 * DokuWiki Writr Template
4 *
5 * @link     http://dokuwiki.org/template:writr
6 * @author   Louis Ouellet <support@laswitchtech.com>
7 * @author   Anika Henke <anika@selfthinker.org>
8 * @license  GPL 2 (http://www.gnu.org/licenses/gpl.html)
9 */
10
11if (!defined('DOKU_INC')) die();
12@require_once(dirname(__FILE__).'/tpl_functions.php');
13header('X-UA-Compatible: IE=edge,chrome=1');
14$showSidebar = page_findnearest($conf['sidebar']);
15?>
16<!DOCTYPE html>
17<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang'] ?>"
18  lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>" class="no-js">
19<head>
20    <meta charset="UTF-8" />
21    <title><?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title']) ?>]</title>
22    <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
23    <?php tpl_metaheaders() ?>
24    <meta name="viewport" content="width=device-width,initial-scale=1" />
25    <?php echo tpl_favicon(array('favicon', 'mobile')) ?>
26    <?php tpl_includeFile('meta.html') ?>
27</head>
28
29<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"; } ?>">
30    <div id="writr__toolbar">
31        <div class="hook"><?php tpl_include_page('topbar', 1, 1) ?></div>
32        <?php if ($conf['useacl']): ?>
33            <!-- USER TOOLS -->
34            <?php echo tpl_getMenu('usermenu'); ?>
35        <?php endif ?>
36    </div>
37    <div id="writr__page" class="hfeed <?php echo ($showSidebar) ? 'hasSidebar' : ''; ?>">
38        <?php tpl_includeFile('header.html') ?>
39
40        <div class="sidebar-area group" id="writr__sidebar">
41            <a id="writr__sidebar-toggle" href="#writr__secondary" title="<?php echo $lang['sidebar'] ?>">
42                <span class="genericon genericon-close"></span>
43                <span class="a11y"><?php echo $lang['sidebar'] ?></span>
44            </a>
45
46            <!-- ********** HEADER ********** -->
47            <header id="writr__masthead" class="site-header" role="banner">
48                <?php echo tpl_getSiteBranding(); ?>
49
50                <div class="search-form widget">
51                    <?php tpl_searchform() ?>
52                </div>
53
54                <?php if (page_findnearest('topnav')): ?>
55                    <nav id="writr__site-navigation" class="main-navigation" role="navigation">
56                        <h3 class="menu-toggle genericon genericon-menu" title="<?php echo tpl_getLang('menu') ?>">
57                            <span class="a11y"><?php echo tpl_getLang('menu') ?></span>
58                        </h3>
59                        <div class="a11y skip-link">
60                            <a href="#writr__content"><?php echo $lang['skip_to_content'] ?></a>
61                        </div>
62                        <?php tpl_include_page('topnav', 1, 1) ?>
63                    </nav><!-- #writr__site-navigation -->
64                <?php endif; ?>
65            </header><!-- #writr__masthead -->
66
67            <div id="writr__secondary" class="widget-area" role="complementary">
68                <?php if ($conf['sidebar']): ?>
69                    <div class="widget">
70                        <?php tpl_includeFile('sidebarheader.html') ?>
71                        <?php tpl_include_page($conf['sidebar'], 1, 1) ?>
72                        <?php tpl_includeFile('sidebarfooter.html') ?>
73                    </div>
74                <?php endif ?>
75
76                <div class="tools widget_links widget">
77                    <?php if(!tpl_getConf('doSiteToolsRequireLogin') || !$conf['useacl'] || (tpl_getConf('doSiteToolsRequireLogin') && isset($INFO['userinfo']))){ ?>
78                        <!-- SITE TOOLS -->
79                        <div class="site-tools">
80                            <h3 <?php if(!tpl_getConf('showSiteToolsTitle')){ echo 'class="a11y"'; } ?>><?php echo $lang['site_tools'] ?></h3>
81                            <ul>
82                                <?php $items = (new \dokuwiki\Menu\SiteMenu())->getItems();
83                                foreach($items as $item) {
84                                    echo '<li>'
85                                        .'<a href="'.$item->getLink().'" class="action '.strtolower($item->getType()).'" rel="nofollow" title="'.$item->getTitle().'">'
86                                        .'<span></span> '
87                                        .$item->getLabel()
88                                        .'</a></li>';
89                                } ?>
90                            </ul>
91                        </div>
92                    <?php } ?>
93                </div>
94
95                <footer id="writr__colophon" class="site-footer" role="contentinfo">
96                    <div class="site-info">
97                        <?php tpl_license('button') ?>
98                        <?php tpl_includeFile('footer.html') ?>
99                    </div><!-- .site-info -->
100                </footer><!-- #writr__colophon -->
101
102            </div>
103
104            <?php echo tpl_getMenu('sidebarmenu'); ?>
105        </div>
106
107        <!-- PAGE TOOLS -->
108        <div class="page-tools">
109            <h3 <?php if(!tpl_getConf('showPageToolsTitle')){ echo 'class="a11y"'; } ?>><?php echo $lang['page_tools'] ?></h3>
110            <ul>
111                <?php if (!$conf['useacl'] || ($conf['useacl'] && $INFO['perm'] >= 4)): ?>
112                    <?php
113                    $instructions = '{{NEWPAGE';
114                    if(tpl_getConf('defaultAddNewPage') !== ''){
115                        $instructions .= '>';
116                        $instructions .= tpl_getConf('defaultAddNewPage');
117                    }
118                    $instructions .= '}}';
119                    $instructions = p_get_instructions($instructions);
120                    if(count($instructions) > 0) {
121                        $render = p_render('xhtml',$instructions,$info);
122                        echo '<li>'
123                            .'<a href="#" class="action AddNewPage" title="'.tpl_getLang('AddNewPage').'">'
124                            .'<span class="icon"></span>'
125                            .'<span class="a11y">'.tpl_getLang('AddNewPage').'</span>'
126                            .'</a>'
127                            .$render
128                            .'</li>';
129                    }
130                    ?>
131                <?php endif ?>
132                <?php
133                    $starred = plugin_load('action','starred');
134                    if ($starred) {
135                        $render = $starred->tpl_starred(false,false);
136                        echo '<li>'.$render.'</li>';
137                    }
138                ?>
139                <?php $translation = plugin_load('helper','translation');
140                if ($translation){
141                    $render = $translation->showTranslations(false);
142                    echo '<li>'
143                        .'<a href="#" class="action Translation" title="'.tpl_getLang('Language').'">'
144                        .'<span class="icon"></span>'
145                        .'<span class="a11y">'.tpl_getLang('Language').'</span>'
146                        .'</a>'
147                        .$render
148                        .'</li>';
149                } ?>
150                <?php $items = (new \dokuwiki\Menu\PageMenu())->getItems();
151                foreach($items as $item) {
152                    $attributes = $item->getLinkAttributes();
153                    $html = '<li><a';
154                    foreach($attributes as $key => $value) {
155                        $html .= ' '.$key.'="'.$value.'"';
156                    }
157                    $html .= '><span class="icon"></span>'
158                        .'<span class="a11y">'.$item->getLabel().'</span>'
159                        .'</a></li>';
160                    echo $html;
161                } ?>
162            </ul>
163        </div>
164
165        <div id="writr__content" class="site-content">
166            <div id="writr__primary" class="content-area">
167
168                <div class="writr-message-area">
169                    <!-- Translation Notication -->
170                    <?php if($translation) { $translation->checkage(); } ?>
171                    <!-- Message Area -->
172                    <?php html_msgarea() ?>
173                </div>
174
175                <!-- BREADCRUMBS -->
176                <?php if($conf['breadcrumbs']){ ?>
177                    <div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div>
178                <?php } ?>
179                <?php if($conf['youarehere']){ ?>
180                    <div class="breadcrumbs"><?php tpl_youarehere() ?></div>
181                <?php } ?>
182
183                <main id="writr__main" class="site-main group" role="main">
184
185                    <?php tpl_flush() ?>
186                    <?php tpl_includeFile('pageheader.html') ?>
187
188                    <!-- wikipage start -->
189                    <?php tpl_content() ?>
190                    <!-- wikipage stop -->
191
192                    <?php tpl_flush() ?>
193                    <?php tpl_includeFile('pagefooter.html') ?>
194                </main><!-- #writr__main -->
195
196		<div class="page-footer">
197			<?php tpl_pageinfo(); ?>
198		</div>
199            </div><!-- #writr__primary -->
200        </div><!-- #writr__content -->
201    </div><!-- #writr__page -->
202
203    <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
204</body>
205</html>
206