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