xref: /template/writr/main.php (revision 88d4f5625354d3b2a1e1bc1d1aa4cdba140ceaa7)
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        <?php tpl_include_page('topbar', 1, 1) ?>
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_getLogo(); ?>
50
51                <div class="site-branding">
52                    <h1 class="site-title"><a href="<?php echo wl(); ?>" rel="home" accesskey="h" title="[H]"><?php echo $conf['title']; ?></a></h1>
53                    <?php if ($conf['tagline']): ?>
54                        <h2 class="site-description"><?php echo $conf['tagline'] ?></h2>
55                    <?php endif ?>
56                </div>
57
58                <div class="search-form widget">
59                    <?php tpl_searchform() ?>
60                </div>
61
62                <?php if (page_findnearest('topnav')): ?>
63                    <nav id="writr__site-navigation" class="main-navigation" role="navigation">
64                        <h3 class="menu-toggle genericon genericon-menu" title="<?php echo tpl_getLang('menu') ?>">
65                            <span class="a11y"><?php echo tpl_getLang('menu') ?></span>
66                        </h3>
67                        <div class="a11y skip-link">
68                            <a href="#writr__content"><?php echo $lang['skip_to_content'] ?></a>
69                        </div>
70                        <?php tpl_include_page('topnav', 1, 1) ?>
71                    </nav><!-- #writr__site-navigation -->
72                <?php endif; ?>
73            </header><!-- #writr__masthead -->
74
75            <div id="writr__secondary" class="widget-area" role="complementary">
76                <?php if ($conf['sidebar']): ?>
77                    <div class="widget">
78                        <?php tpl_includeFile('sidebarheader.html') ?>
79                        <?php tpl_include_page($conf['sidebar'], 1, 1) ?>
80                        <?php tpl_includeFile('sidebarfooter.html') ?>
81                    </div>
82                <?php endif ?>
83
84                <div class="tools widget_links widget">
85                    <?php if(!tpl_getConf('doSiteToolsRequireLogin') || (tpl_getConf('doSiteToolsRequireLogin') && $conf['useacl'])){ ?>
86                        <!-- SITE TOOLS -->
87                        <div class="site-tools">
88                            <h3 <?php if(!tpl_getConf('showSiteToolsTitle')){ echo 'class="a11y"'; } ?>><?php echo $lang['site_tools'] ?></h3>
89                            <ul>
90                                <?php $items = (new \dokuwiki\Menu\SiteMenu())->getItems();
91                                foreach($items as $item) {
92                                    echo '<li>'
93                                        .'<a href="'.$item->getLink().'" class="action '.strtolower($item->getType()).'" rel="nofollow" title="'.$item->getTitle().'">'
94                                        .'<span></span> '
95                                        .$item->getLabel()
96                                        .'</a></li>';
97                                } ?>
98                            </ul>
99                        </div>
100                    <?php } ?>
101
102                    <!-- PAGE TOOLS -->
103                    <div class="page-tools">
104                        <h3 <?php if(!tpl_getConf('showPageToolsTitle')){ echo 'class="a11y"'; } ?>><?php echo $lang['page_tools'] ?></h3>
105                        <ul>
106                            <?php if (!$conf['useacl'] || ($conf['useacl'] && $INFO['perm'] >= 4)): ?>
107                                <?php
108                                $instructions = '{{NEWPAGE';
109                                if(tpl_getConf('defaultAddNewPage') !== ''){
110                                    $instructions .= '>';
111                                    $instructions .= tpl_getConf('defaultAddNewPage');
112                                }
113                                $instructions .= '}}';
114                                $instructions = p_get_instructions($instructions);
115                                if(count($instructions) <= 3) {
116                                    $render = p_render('xhtml',$instructions,$info);
117                                    echo '<li>'
118                                        .'<a href="#" class="action AddNewPage" title="'.tpl_getLang('AddNewPage').'">'
119                                        .'<span class="icon"></span>'
120                                        .'<span class="a11y">'.tpl_getLang('AddNewPage').'</span>'
121                                        .'</a>'
122                                        .$render
123                                        .'</li>';
124                                }
125                                ?>
126                            <?php endif ?>
127                            <?php $translation = plugin_load('helper','translation');
128                            if ($translation){
129                                $render = $translation->showTranslations(false);
130                                echo '<li>'
131                                    .'<a href="#" class="action Translation" title="'.tpl_getLang('Language').'">'
132                                    .'<span class="icon"></span>'
133                                    .'<span class="a11y">'.tpl_getLang('Language').'</span>'
134                                    .'</a>'
135                                    .$render
136                                    .'</li>';
137                            } ?>
138                            <?php $items = (new \dokuwiki\Menu\PageMenu())->getItems();
139                            foreach($items as $item) {
140                                $attributes = $item->getLinkAttributes();
141                                $html = '<li><a';
142                                foreach($attributes as $key => $value) {
143                                    $html .= ' '.$key.'="'.$value.'"';
144                                }
145                                $html .= '><span class="icon"></span>'
146                                    .'<span class="a11y">'.$item->getLabel().'</span>'
147                                    .'</a></li>';
148                                echo $html;
149                            } ?>
150                        </ul>
151                    </div>
152
153                    <?php if ($conf['useacl']): ?>
154                        <!-- USER TOOLS -->
155                        <div id="writr__sidebar__usertools" class="user-tools">
156                            <h3 <?php if(!tpl_getConf('showUserToolsTitle')){ echo 'class="a11y"'; } ?>><?php echo $lang['user_tools'] ?></h3>
157                            <ul>
158                                <?php $items = (new \dokuwiki\Menu\UserMenu())->getItems();
159                                foreach($items as $item) {
160                                    echo '<li>'
161                                        .'<a href="'.$item->getLink().'" class="action '.strtolower($item->getType()).'" rel="nofollow" title="'.$item->getTitle().'">'
162                                        .'<i></i> '
163                                        .$item->getLabel()
164                                        .'</a></li>';
165                                } ?>
166                            </ul>
167                            <?php
168                                if (!empty($_SERVER['REMOTE_USER'])) {
169                                    echo '<p class="user">';
170                                    tpl_userinfo();
171                                    echo '</p>';
172                                }
173                            ?>
174                        </div>
175                    <?php endif ?>
176                </div>
177
178                <footer id="writr__colophon" class="site-footer" role="contentinfo">
179                    <div class="site-info">
180                        <?php tpl_license('button') ?>
181                        <?php tpl_includeFile('footer.html') ?>
182                    </div><!-- .site-info -->
183                </footer><!-- #writr__colophon -->
184
185            </div>
186        </div>
187
188        <div id="writr__content" class="site-content">
189            <div id="writr__primary" class="content-area">
190
191                <div class="writr-message-area">
192                    <!-- Translation Notication -->
193                    <?php if($translation) { $translation->checkage(); } ?>
194                    <!-- Message Area -->
195                    <?php html_msgarea() ?>
196                </div>
197
198                <!-- BREADCRUMBS -->
199                <?php if($conf['breadcrumbs']){ ?>
200                    <div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div>
201                <?php } ?>
202                <?php if($conf['youarehere']){ ?>
203                    <div class="breadcrumbs"><?php tpl_youarehere() ?></div>
204                <?php } ?>
205
206                <main id="writr__main" class="site-main group" role="main">
207
208                    <?php tpl_flush() ?>
209                    <?php tpl_includeFile('pageheader.html') ?>
210
211                    <!-- wikipage start -->
212                    <?php tpl_content() ?>
213                    <!-- wikipage stop -->
214
215                    <?php tpl_flush() ?>
216                    <?php tpl_includeFile('pagefooter.html') ?>
217                </main><!-- #writr__main -->
218
219		<div class="page-footer">
220			<?php tpl_pageinfo(); ?>
221		</div>
222            </div><!-- #writr__primary -->
223        </div><!-- #writr__content -->
224    </div><!-- #writr__page -->
225
226    <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
227</body>
228</html>
229