xref: /template/writr/main.php (revision dd080224b14f7ec5e8611c67d0c2d10020e3576f)
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    <link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css' />
23    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" />
24    <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
25    <?php tpl_metaheaders() ?>
26    <meta name="viewport" content="width=device-width,initial-scale=1" />
27    <?php echo tpl_favicon(array('favicon', 'mobile')) ?>
28    <?php tpl_includeFile('meta.html') ?>
29</head>
30
31<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"; } ?>">
32    <div id="writr__toolbar">
33        <div class="hook"><?php tpl_include_page('topbar', 1, 1) ?></div>
34        <?php if ($conf['useacl']): ?>
35            <!-- USER TOOLS -->
36            <?php echo tpl_getMenu('usermenu'); ?>
37        <?php endif ?>
38    </div>
39    <div id="writr__page" class="hfeed <?php echo ($showSidebar) ? 'hasSidebar' : ''; ?>">
40        <?php tpl_includeFile('header.html') ?>
41
42        <div class="sidebar-area group" id="writr__sidebar">
43            <a id="writr__sidebar-toggle" href="#writr__secondary" title="<?php echo $lang['sidebar'] ?>">
44                <span class="genericon genericon-close"></span>
45                <span class="a11y"><?php echo $lang['sidebar'] ?></span>
46            </a>
47
48            <!-- ********** HEADER ********** -->
49            <header id="writr__masthead" class="site-header" role="banner">
50                <?php echo tpl_getSiteBranding(); ?>
51
52                <div class="search-form widget">
53                    <?php tpl_searchform() ?>
54                </div>
55
56                <?php if (page_findnearest('topnav')): ?>
57                    <nav id="writr__site-navigation" class="main-navigation" role="navigation">
58                        <h3 class="menu-toggle genericon genericon-menu" title="<?php echo tpl_getLang('menu') ?>">
59                            <span class="a11y"><?php echo tpl_getLang('menu') ?></span>
60                        </h3>
61                        <div class="a11y skip-link">
62                            <a href="#writr__content"><?php echo $lang['skip_to_content'] ?></a>
63                        </div>
64                        <?php tpl_include_page('topnav', 1, 1) ?>
65                    </nav><!-- #writr__site-navigation -->
66                <?php endif; ?>
67            </header><!-- #writr__masthead -->
68
69            <div id="writr__secondary" class="widget-area" role="complementary">
70                <?php if ($conf['sidebar']): ?>
71                    <div class="widget">
72                        <?php tpl_includeFile('sidebarheader.html') ?>
73                        <?php tpl_include_page($conf['sidebar'], 1, 1) ?>
74                        <?php tpl_includeFile('sidebarfooter.html') ?>
75                    </div>
76                <?php endif ?>
77
78                <div class="tools widget_links widget">
79                    <?php if(!tpl_getConf('doSiteToolsRequireLogin') || !$conf['useacl'] || (tpl_getConf('doSiteToolsRequireLogin') && isset($INFO['userinfo']))){ ?>
80                        <!-- SITE TOOLS -->
81                        <div class="site-tools">
82                            <h3 <?php if(!tpl_getConf('showSiteToolsTitle')){ echo 'class="a11y"'; } ?>><?php echo $lang['site_tools'] ?></h3>
83                            <ul>
84                                <?php $items = (new \dokuwiki\Menu\SiteMenu())->getItems();
85                                foreach($items as $item) {
86                                    echo '<li>'
87                                        .'<a href="'.$item->getLink().'" class="action '.strtolower($item->getType()).'" rel="nofollow" title="'.$item->getTitle().'">'
88                                        .'<span></span> '
89                                        .$item->getLabel()
90                                        .'</a></li>';
91                                } ?>
92                            </ul>
93                        </div>
94                    <?php } ?>
95                </div>
96
97                <footer id="writr__colophon" class="site-footer" role="contentinfo">
98                    <div class="site-info">
99                        <?php tpl_license('button') ?>
100                        <?php tpl_includeFile('footer.html') ?>
101                    </div><!-- .site-info -->
102                </footer><!-- #writr__colophon -->
103
104            </div>
105
106            <?php echo tpl_getMenu('sidebarmenu'); ?>
107        </div>
108
109        <!-- PAGE TOOLS -->
110        <div class="page-tools">
111            <h3 <?php if(!tpl_getConf('showPageToolsTitle')){ echo 'class="a11y"'; } ?>><?php echo $lang['page_tools'] ?></h3>
112            <ul>
113                <?php if (!$conf['useacl'] || ($conf['useacl'] && $INFO['perm'] >= 4)): ?>
114                    <?php
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) <= 3) {
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                <?php endif ?>
134                <?php $translation = plugin_load('helper','translation');
135                if ($translation){
136                    $render = $translation->showTranslations(false);
137                    echo '<li>'
138                        .'<a href="#" class="action Translation" title="'.tpl_getLang('Language').'">'
139                        .'<span class="icon"></span>'
140                        .'<span class="a11y">'.tpl_getLang('Language').'</span>'
141                        .'</a>'
142                        .$render
143                        .'</li>';
144                } ?>
145                <?php $items = (new \dokuwiki\Menu\PageMenu())->getItems();
146                foreach($items as $item) {
147                    $attributes = $item->getLinkAttributes();
148                    $html = '<li><a';
149                    foreach($attributes as $key => $value) {
150                        $html .= ' '.$key.'="'.$value.'"';
151                    }
152                    $html .= '><span class="icon"></span>'
153                        .'<span class="a11y">'.$item->getLabel().'</span>'
154                        .'</a></li>';
155                    echo $html;
156                } ?>
157            </ul>
158        </div>
159
160        <div id="writr__content" class="site-content">
161            <div id="writr__primary" class="content-area">
162
163                <div class="writr-message-area">
164                    <!-- Translation Notication -->
165                    <?php if($translation) { $translation->checkage(); } ?>
166                    <!-- Message Area -->
167                    <?php html_msgarea() ?>
168                </div>
169
170                <!-- BREADCRUMBS -->
171                <?php if($conf['breadcrumbs']){ ?>
172                    <div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div>
173                <?php } ?>
174                <?php if($conf['youarehere']){ ?>
175                    <div class="breadcrumbs"><?php tpl_youarehere() ?></div>
176                <?php } ?>
177
178                <main id="writr__main" class="site-main group" role="main">
179
180                    <?php tpl_flush() ?>
181                    <?php tpl_includeFile('pageheader.html') ?>
182
183                    <!-- wikipage start -->
184                    <?php tpl_content() ?>
185                    <!-- wikipage stop -->
186
187                    <?php tpl_flush() ?>
188                    <?php tpl_includeFile('pagefooter.html') ?>
189                </main><!-- #writr__main -->
190
191		<div class="page-footer">
192			<?php tpl_pageinfo(); ?>
193		</div>
194            </div><!-- #writr__primary -->
195        </div><!-- #writr__content -->
196    </div><!-- #writr__page -->
197
198    <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
199</body>
200</html>
201