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
112                    $addnewpage = plugin_load('syntax','addnewpage');
113                    if ($addnewpage){
114                        if (!$conf['useacl'] || ($conf['useacl'] && $INFO['perm'] >= 4)) {
115                            $instructions = '{{NEWPAGE';
116                            if(tpl_getConf('defaultAddNewPage') !== ''){
117                                $instructions .= '>';
118                                $instructions .= tpl_getConf('defaultAddNewPage');
119                            }
120                            $instructions .= '}}';
121                            $instructions = p_get_instructions($instructions);
122                            if(count($instructions) > 0) {
123                                $render = p_render('xhtml',$instructions,$info);
124                                echo '<li>'
125                                    .'<a href="#" class="action AddNewPage" title="'.tpl_getLang('AddNewPage').'">'
126                                    .'<span class="icon"></span>'
127                                    .'<span class="a11y">'.tpl_getLang('AddNewPage').'</span>'
128                                    .'</a>'
129                                    .$render
130                                    .'</li>';
131                            }
132                        }
133                    }
134                ?>
135                <?php
136                    $starred = plugin_load('action','starred');
137                    if ($starred) {
138                        $render = $starred->tpl_starred(false,false);
139                        echo '<li>'.$render.'</li>';
140                    }
141                ?>
142                <?php
143                    $translation = plugin_load('helper','translation');
144                    if ($translation){
145                        $render = $translation->showTranslations(false);
146                        echo '<li>'
147                            .'<a href="#" class="action Translation" title="'.tpl_getLang('Language').'">'
148                            .'<span class="icon"></span>'
149                            .'<span class="a11y">'.tpl_getLang('Language').'</span>'
150                            .'</a>'
151                            .$render
152                            .'</li>';
153                    }
154                ?>
155                <?php
156                    $items = (new \dokuwiki\Menu\PageMenu())->getItems();
157                    foreach($items as $item) {
158                        $attributes = $item->getLinkAttributes();
159                        $html = '<li><a';
160                        foreach($attributes as $key => $value) {
161                            $html .= ' '.$key.'="'.$value.'"';
162                        }
163                        $html .= '><span class="icon"></span>'
164                            .'<span class="a11y">'.$item->getLabel().'</span>'
165                            .'</a></li>';
166                        echo $html;
167                    }
168                ?>
169            </ul>
170        </div>
171
172        <div id="writr__content" class="site-content">
173            <div id="writr__primary" class="content-area">
174
175                <div class="writr-message-area">
176                    <!-- Translation Notication -->
177                    <?php if($translation) { $translation->checkage(); } ?>
178                    <!-- Message Area -->
179                    <?php html_msgarea() ?>
180                </div>
181
182                <!-- BREADCRUMBS -->
183                <?php if($conf['breadcrumbs']){ ?>
184                    <div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div>
185                <?php } ?>
186                <?php if($conf['youarehere']){ ?>
187                    <div class="breadcrumbs"><?php tpl_youarehere() ?></div>
188                <?php } ?>
189
190                <main id="writr__main" class="site-main group" role="main">
191
192                    <?php tpl_flush() ?>
193                    <?php tpl_includeFile('pageheader.html') ?>
194
195                    <!-- wikipage start -->
196                    <?php tpl_content() ?>
197                    <!-- wikipage stop -->
198
199                    <?php tpl_flush() ?>
200                    <?php tpl_includeFile('pagefooter.html') ?>
201                </main><!-- #writr__main -->
202
203		<div class="page-footer">
204			<?php tpl_pageinfo(); ?>
205		</div>
206            </div><!-- #writr__primary -->
207        </div><!-- #writr__content -->
208    </div><!-- #writr__page -->
209
210    <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
211</body>
212</html>
213