xref: /template/writr/main.php (revision e7175201c7de2bb03d9bfd1375062934e2c30b8a)
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 echo tpl_classes(); ?>">
31    <div id="writr__page" class="hfeed <?php echo ($showSidebar) ? 'hasSidebar' : ''; ?>">
32        <?php tpl_includeFile('header.html') ?>
33
34        <div class="sidebar-area group" id="writr__sidebar">
35            <a id="writr__sidebar-toggle" href="#writr__secondary" title="<?php echo $lang['sidebar'] ?>">
36                <span class="genericon genericon-close"></span>
37                <span class="a11y"><?php echo $lang['sidebar'] ?></span>
38            </a>
39
40            <!-- ********** HEADER ********** -->
41            <header id="writr__masthead" class="site-header" role="banner">
42                <?php
43                    $logoSize = array();
44                    $logoImages = array();
45                    if(tpl_getConf('doLogoChangesByNamespace')){
46                        $logoImages[] = getNS($ID).':logo.png';
47                    }
48                    $logoImages[] = ':wiki:logo.png';
49                    $logoImages[] = ':logo.png';
50                    $logoImages[] = 'images/logo.png';
51                    $logo = tpl_getMediaFile($logoImages, false, $logoSize);
52                ?>
53
54                <a class="site-logo"  href="<?php echo wl(); ?>" title="<?php echo $conf['title']; ?>" rel="home" accesskey="h" title="[H]">
55                    <img src="<?php echo $logo; ?>" <?php echo $logoSize[3]; ?> alt="" class="no-grav header-image" />
56                </a>
57
58                <div class="site-branding">
59                    <h1 class="site-title"><a href="<?php echo wl(); ?>" rel="home" accesskey="h" title="[H]"><?php echo $conf['title']; ?></a></h1>
60                    <?php if ($conf['tagline']): ?>
61                        <h2 class="site-description"><?php echo $conf['tagline'] ?></h2>
62                    <?php endif ?>
63                </div>
64
65                <div class="search-form widget">
66                    <?php tpl_searchform() ?>
67                </div>
68
69                <?php if (page_findnearest('topnav')): ?>
70                    <nav id="writr__site-navigation" class="main-navigation" role="navigation">
71                        <h3 class="menu-toggle genericon genericon-menu" title="<?php echo tpl_getLang('menu') ?>">
72                            <span class="a11y"><?php echo tpl_getLang('menu') ?></span>
73                        </h3>
74                        <div class="a11y skip-link">
75                            <a href="#writr__content"><?php echo $lang['skip_to_content'] ?></a>
76                        </div>
77                        <?php tpl_include_page('topnav', 1, 1) ?>
78                    </nav><!-- #writr__site-navigation -->
79                <?php endif; ?>
80            </header><!-- #writr__masthead -->
81
82            <div id="writr__secondary" class="widget-area" role="complementary">
83                <?php if ($conf['sidebar']): ?>
84                    <div class="widget">
85                        <?php tpl_includeFile('sidebarheader.html') ?>
86                        <?php tpl_include_page($conf['sidebar'], 1, 1) ?>
87                        <?php tpl_includeFile('sidebarfooter.html') ?>
88                    </div>
89                <?php endif ?>
90
91                <div class="tools widget_links widget">
92                    <?php if(!tpl_getConf('doSiteToolsRequireLogin') || (tpl_getConf('doSiteToolsRequireLogin') && $conf['useacl'])){ ?>
93                        <!-- SITE TOOLS -->
94                        <div class="site-tools">
95                            <h3 <?php if(!tpl_getConf('showSiteToolsTitle')){ echo 'class="a11y"'; } ?>><?php echo $lang['site_tools'] ?></h3>
96                            <ul>
97                                <?php $items = (new \dokuwiki\Menu\SiteMenu())->getItems();
98                                foreach($items as $item) {
99                                    echo '<li>'
100                                        .'<a href="'.$item->getLink().'" class="action '.strtolower($item->getType()).'" rel="nofollow" title="'.$item->getTitle().'">'
101                                        .'<span></span> '
102                                        .$item->getLabel()
103                                        .'</a></li>';
104                                } ?>
105                            </ul>
106                        </div>
107                    <?php } ?>
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 .= tpl_getConf('defaultAddNewPage');
118                                }
119                                $instructions .= '}}';
120                                $instructions = p_get_instructions($instructions);
121                                if(count($instructions) <= 3) {
122                                    $render = p_render('xhtml',$instructions,$info);
123                                    echo '<li>'
124                                        .'<a href="#" class="action AddNewPage" title="'.tpl_getLang('AddNewPage').'">'
125                                        .'<span class="icon"></span>'
126                                        .'<span class="a11y">'.tpl_getLang('AddNewPage').'</span>'
127                                        .'</a>'
128                                        .$render
129                                        .'</li>';
130                                }
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(false);
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 if(!tpl_getConf('showUserToolsTitle')){ echo 'class="a11y"'; } ?>><?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                            <?php
171                                if (!empty($_SERVER['REMOTE_USER'])) {
172                                    echo '<p class="user">'.$INFO['userinfo']['name'].'</p>';
173                                }
174                            ?>
175                        </div>
176                    <?php endif ?>
177                </div>
178
179                <footer id="writr__colophon" class="site-footer" role="contentinfo">
180                    <div class="site-info">
181                        <?php tpl_license('button') ?>
182                        <?php tpl_includeFile('footer.html') ?>
183                    </div><!-- .site-info -->
184                </footer><!-- #writr__colophon -->
185
186            </div>
187        </div>
188
189        <div id="writr__content" class="site-content">
190            <div id="writr__primary" class="content-area">
191
192                <div class="writr-message-area">
193                    <!-- Translation Notication -->
194                    <?php if($translation) { $translation->checkage(); } ?>
195                    <!-- Message Area -->
196                    <?php html_msgarea() ?>
197                </div>
198
199                <!-- BREADCRUMBS -->
200                <?php if($conf['breadcrumbs']){ ?>
201                    <div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div>
202                <?php } ?>
203                <?php if($conf['youarehere']){ ?>
204                    <div class="breadcrumbs"><?php tpl_youarehere() ?></div>
205                <?php } ?>
206
207                <main id="writr__main" class="site-main group" role="main">
208
209                    <?php tpl_flush() ?>
210                    <?php tpl_includeFile('pageheader.html') ?>
211
212                    <!-- wikipage start -->
213                    <?php tpl_content() ?>
214                    <!-- wikipage stop -->
215
216                    <?php tpl_flush() ?>
217                    <?php tpl_includeFile('pagefooter.html') ?>
218                </main><!-- #writr__main -->
219
220		<div class="page-footer">
221			<?php tpl_pageinfo(); ?>
222		</div>
223            </div><!-- #writr__primary -->
224        </div><!-- #writr__content -->
225    </div><!-- #writr__page -->
226
227    <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
228</body>
229</html>
230