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