xref: /template/writr/main.php (revision 986c383b492ec2f6ae8b24bdf20db3b32b1bcd9f)
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 rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.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    <link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css' />
29    <style>
30        body {
31            font-family: <?= tpl_getConf('font') ?>;
32        }
33    </style>
34</head>
35
36<body id="dokuwiki__top" class="sidebar-closed <?php echo tpl_classes(); ?>">
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
49                    $logoSize = array();
50                    $logo = tpl_getMediaFile(array(':wiki:logo.png', ':logo.png', 'images/logo.png'), false, $logoSize);
51                ?>
52
53                <a class="site-logo"  href="<?php echo wl(); ?>" title="<?php echo $conf['title']; ?>" rel="home" accesskey="h" title="[H]">
54                    <img src="<?php echo $logo; ?>" <?php echo $logoSize[3]; ?> alt="" class="no-grav header-image" />
55                </a>
56
57                <div class="site-branding">
58                    <h1 class="site-title"><a href="<?php echo wl(); ?>" rel="home" accesskey="h" title="[H]"><?php echo $conf['title']; ?></a></h1>
59                    <?php if ($conf['tagline']): ?>
60                        <h2 class="site-description"><?php echo $conf['tagline'] ?></h2>
61                    <?php endif ?>
62                </div>
63
64                <div class="search-form widget">
65                    <?php tpl_searchform() ?>
66                </div>
67
68                <?php if (page_findnearest('topnav')): ?>
69                    <nav id="writr__site-navigation" class="main-navigation" role="navigation">
70                        <h3 class="menu-toggle genericon genericon-menu" title="<?php echo tpl_getLang('menu') ?>">
71                            <span class="a11y"><?php echo tpl_getLang('menu') ?></span>
72                        </h3>
73                        <div class="a11y skip-link">
74                            <a href="#writr__content"><?php echo $lang['skip_to_content'] ?></a>
75                        </div>
76                        <?php tpl_include_page('topnav', 1, 1) ?>
77                    </nav><!-- #writr__site-navigation -->
78                <?php endif; ?>
79            </header><!-- #writr__masthead -->
80
81            <div id="writr__secondary" class="widget-area" role="complementary">
82                <?php if ($conf['sidebar']): ?>
83                    <div class="widget">
84                        <?php tpl_includeFile('sidebarheader.html') ?>
85                        <?php tpl_include_page($conf['sidebar'], 1, 1) ?>
86                        <?php tpl_includeFile('sidebarfooter.html') ?>
87                    </div>
88                <?php endif ?>
89
90                <div class="tools widget_links widget">
91                    <?php if(!tpl_getConf('doSiteToolsRequireLogin') || (tpl_getConf('doSiteToolsRequireLogin') && $conf['useacl'])){ ?>
92                        <!-- SITE TOOLS -->
93                        <div class="site-tools">
94                            <?php if(tpl_getConf('showSiteToolsTitle')){ ?>
95                                <h3><?php echo $lang['site_tools'] ?></h3>
96                            <?php } ?>
97                            <ul>
98                                <?php $items = (new \dokuwiki\Menu\SiteMenu())->getItems();
99                                foreach($items as $item) {
100                                    echo '<li>'
101                                        .'<a href="'.$item->getLink().'" class="action '.strtolower($item->getType()).'" rel="nofollow" title="'.$item->getTitle().'">'
102                                        .'<span></span> '
103                                        .$item->getLabel()
104                                        .'</a></li>';
105                                } ?>
106                            </ul>
107                        </div>
108                    <?php } ?>
109
110                    <!-- PAGE TOOLS -->
111                    <div class="page-tools">
112                        <h3 class="a11y"><?php echo $lang['page_tools'] ?></h3>
113                        <ul>
114                            <?php if (!$conf['useacl'] || ($conf['useacl'] && $INFO['perm'] >= 4)): ?>
115                                <?php $instructions = p_get_instructions('{{'.tpl_getConf('defaultAddNewPage').'}}');
116                                if(count($instructions) <= 3) {
117                                    $render = p_render('xhtml',$instructions,$info);
118                                    echo '<li>'
119                                        .'<a href="#" class="action AddNewPage" title="'.tpl_getLang('AddNewPage').'">'
120                                        .'<span class="icon"></span>'
121                                        .'<span class="a11y">'.tpl_getLang('AddNewPage').'</span>'
122                                        .'</a>'
123                                        .$render
124                                        .'</li>';
125                                } ?>
126                                <!-- <li class="plugin_move_page" style="display: list-item;"><a href=""><span>Rename Page</span></a></li> -->
127                            <?php endif ?>
128                            <?php $items = (new \dokuwiki\Menu\PageMenu())->getItems();
129                            foreach($items as $item) {
130                                echo '<li>'
131                                    .'<a href="'.$item->getLink().'" class="action '.strtolower($item->getType()).'" title="'.$item->getTitle().'">'
132                                    .'<span class="icon"></span>'
133                                    .'<span class="a11y">'.$item->getLabel().'</span>'
134                                    .'</a></li>';
135                            } ?>
136                            <?php $translation = plugin_load('helper','translation');
137                            if ($translation){
138                                $render = $translation->showTranslations();
139                                echo '<li>'
140                                    .'<a href="#" class="action Translation" title="'.tpl_getLang('Language').'">'
141                                    .'<span class="icon"></span>'
142                                    .'<span class="a11y">'.tpl_getLang('Language').'</span>'
143                                    .'</a>'
144                                    .$render
145                                    .'</li>';
146                            } ?>
147                        </ul>
148                    </div>
149
150                    <?php if ($conf['useacl']): ?>
151                        <!-- USER TOOLS -->
152                        <div class="user-tools">
153                            <h3><?php echo $lang['user_tools'] ?></h3>
154                            <ul>
155                                <?php $items = (new \dokuwiki\Menu\UserMenu())->getItems();
156                                foreach($items as $item) {
157                                    echo '<li>'
158                                        .'<a href="'.$item->getLink().'" class="action '.strtolower($item->getType()).'" rel="nofollow" title="'.$item->getTitle().'">'
159                                        .'<span></span> '
160                                        .$item->getLabel()
161                                        .'</a></li>';
162                                } ?>
163                            </ul>
164                        </div>
165
166                        <?php
167                            if (!empty($_SERVER['REMOTE_USER'])) {
168                                echo '<p class="user">';
169                                tpl_userinfo();
170                                echo '</p>';
171                            }
172                        ?>
173                    <?php endif ?>
174                </div>
175
176                <footer id="writr__colophon" class="site-footer" role="contentinfo">
177                    <div class="site-info">
178                        <?php tpl_license('button') ?>
179                        <?php tpl_includeFile('footer.html') ?>
180                    </div><!-- .site-info -->
181                </footer><!-- #writr__colophon -->
182
183            </div>
184        </div>
185
186        <div id="writr__content" class="site-content">
187            <div id="writr__primary" class="content-area">
188
189                <!-- BREADCRUMBS -->
190                <?php if($conf['breadcrumbs']){ ?>
191                    <div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div>
192                <?php } ?>
193                <?php if($conf['youarehere']){ ?>
194                    <div class="breadcrumbs"><?php tpl_youarehere() ?></div>
195                <?php } ?>
196
197                <main id="writr__main" class="site-main group" role="main">
198
199                    <?php tpl_flush() ?>
200                    <?php tpl_includeFile('pageheader.html') ?>
201
202                    <?php html_msgarea() ?>
203                    <!-- wikipage start -->
204                    <?php tpl_content() ?>
205                    <!-- wikipage stop -->
206
207                    <?php tpl_flush() ?>
208                    <?php tpl_includeFile('pagefooter.html') ?>
209                </main><!-- #writr__main -->
210
211                <p class="page-footer"><?php tpl_pageinfo() ?></p>
212            </div><!-- #writr__primary -->
213        </div><!-- #writr__content -->
214    </div><!-- #writr__page -->
215
216    <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
217
218    <!-- JavaScript Libraries and Scripts -->
219    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.0/dist/jquery.slim.min.js"></script>
220    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
221    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha256-BRqBN7dYgABqtY9Hd4ynE+1slnEw+roEPFzQ7TRRfcg=" crossorigin="anonymous"></script>
222</body>
223</html>
224