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