xref: /template/writr/main.php (revision 9d9afca22bd3cff45a5413d930d6056e456c4891)
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('makeFullWidth')){ echo "makeFullWidth"; } ?> <?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                <div class="tools widget_links widget">
78                    <?php if(!tpl_getConf('doSiteToolsRequireLogin') || !$conf['useacl'] || (tpl_getConf('doSiteToolsRequireLogin') && isset($INFO['userinfo']))){ ?>
79                        <!-- SITE TOOLS -->
80                        <div class="site-tools">
81                            <h3 <?php if(!tpl_getConf('showSiteToolsTitle')){ echo 'class="a11y"'; } ?>><?php echo $lang['site_tools'] ?></h3>
82                            <ul>
83                                <?php $items = (new \dokuwiki\Menu\SiteMenu())->getItems();
84                                foreach($items as $item) {
85                                    echo '<li>'
86                                        .'<a href="'.$item->getLink().'" class="action '.strtolower($item->getType()).'" rel="nofollow" title="'.$item->getTitle().'">'
87                                        .'<span></span> '
88                                        .$item->getLabel()
89                                        .'</a></li>';
90                                } ?>
91                            </ul>
92                        </div>
93                    <?php } ?>
94                </div>
95
96                <footer id="writr__colophon" class="site-footer" role="contentinfo">
97                    <div class="site-info">
98                        <?php tpl_license('button') ?>
99                        <?php tpl_includeFile('footer.html') ?>
100                    </div><!-- .site-info -->
101                </footer><!-- #writr__colophon -->
102
103            </div>
104
105            <?php echo tpl_getMenu('sidebarmenu'); ?>
106        </div>
107
108        <div id="writr__content" class="site-content">
109            <div id="writr__primary" class="content-area">
110
111                <div class="writr-message-area">
112                    <!-- Translation Notication -->
113                    <?php if($translation) { $translation->checkage(); } ?>
114                    <!-- Message Area -->
115                    <?php html_msgarea() ?>
116                </div>
117
118                <!-- BREADCRUMBS -->
119                <?php if($conf['breadcrumbs']){ ?>
120                    <div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div>
121                <?php } ?>
122                <?php if($conf['youarehere']){ ?>
123                    <div class="breadcrumbs"><?php tpl_youarehere() ?></div>
124                <?php } ?>
125
126                <main id="writr__main" class="site-main group" role="main">
127
128                    <?php tpl_flush() ?>
129                    <?php tpl_includeFile('pageheader.html') ?>
130
131                    <!-- wikipage start -->
132                    <?php tpl_content() ?>
133                    <!-- wikipage stop -->
134
135                    <?php tpl_flush() ?>
136                    <?php tpl_includeFile('pagefooter.html') ?>
137                </main><!-- #writr__main -->
138
139		<div class="page-footer">
140			<?php tpl_pageinfo(); ?>
141		</div>
142            </div><!-- #writr__primary -->
143        </div><!-- #writr__content -->
144    </div><!-- #writr__page -->
145
146    <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
147</body>
148</html>
149