xref: /template/kiwiki/main.php (revision 967bfb658edd6d42a51483e8af9fede1dda26791)
1<?php
2/**
3 * Kiwiki Template
4 *
5 * @link     http://dokuwiki.org/template:kiwiki
6 * @author   Anika Henke <anika@selfthinker.org>
7 * @author   Nicolas Prigent
8 * @license  GPL 2 (http://www.gnu.org/licenses/gpl.html)
9 */
10
11if (!defined('DOKU_INC')) die(); /* must be run from within DokuWiki */
12@require_once(dirname(__FILE__).'/tpl_functions.php'); /* include hook for template functions */
13
14$showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && !empty($_SERVER['REMOTE_USER']) );
15$showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
16$sidebarElement = tpl_getConf('sidebarIsNav') ? 'nav' : 'aside';
17$themeMode = '';
18if (!empty($_COOKIE['theme'])){
19    $themeMode = $_COOKIE['theme'];
20}
21?><!DOCTYPE html>
22<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang'] ?>"
23  lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>" class="no-js">
24<head>
25    <meta charset="UTF-8" />
26    <title><?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title']) ?>]</title>
27    <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
28    <?php tpl_metaheaders() ?>
29    <meta name="viewport" content="width=device-width,initial-scale=1" />
30    <?php echo tpl_favicon(array('favicon', 'mobile')) ?>
31    <?php tpl_includeFile('meta.html') ?>
32</head>
33
34
35<body id="kiwiki" class="<?php echo $themeMode; ?>">
36    <?php /* the "dokuwiki__top" id is needed somewhere at the top, because that's where the "back to top" button/link links to */ ?>
37    <?php /* tpl_classes() provides useful CSS classes; if you choose not to use it, the 'dokuwiki' class at least
38             should always be in one of the surrounding elements (e.g. plugins and templates depend on it) */ ?>
39    <?php $admin_page = (($ACT == "admin") && (isset($_REQUEST['page']))) ? explode("#",$_REQUEST['page'])[0]: "" ;?>
40    <div id="dokuwiki__site">
41        <div id="dokuwiki__top" class="site <?php echo tpl_classes() ." " . $admin_page; ?>">
42        <!-- ********** HEADER ********** -->
43        <?php include('partial/header.php');?>
44
45        <?php include('partial/before_content.php'); ?>
46
47        <?php include('partial/content.php');?>
48
49        </div>
50        <!-- ********** FOOTER ********** -->
51    <?php include('partial/footer.php'); ?>
52    <!-- GO TOP -->
53    <div id="gotop">
54    <?php
55
56
57    $items = (new \dokuwiki\Menu\KiwikiGoTop())->getItems();
58        echo '<a href="'.$items[0]->getLink().'" title="'.$items[0]->getTitle().'">'
59        .'<span class="icon">'.inlineSVG($items[0]->getSvg()).'</span>'
60        . '<span class="a11y">'.$items[0]->getLabel().'</span>'
61        . '</a>';
62    ?>
63    </div>
64    </div><!-- /site -->
65    <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
66</body>
67</html>
68