xref: /template/mikio/main.php (revision 9cff245b1356327ea6b78c7abc1d7a38b1dd3dd6)
1<?php
2
3/**
4 * DokuWiki Mikio Template Main
5 *
6 * @link    http://dokuwiki.org/template:mikio
7 * @author  James Collins <james.collins@outlook.com.au>
8 * @license GPLv2 (http://www.gnu.org/licenses/gpl-2.0.html)
9 */
10
11if (defined('DOKU_INC') === false) {
12    die();
13}
14require_once('mikio.php');
15
16global $TEMPLATE, $ACT, $conf, $USERINFO;
17
18header('X-UA-Compatible: IE=edge,chrome=1');
19
20$hasSidebar = $TEMPLATE->sidebarExists();
21$showSidebar = $hasSidebar && ($ACT == 'show');
22
23?>
24<!doctype html>
25<html lang="<?php echo $conf['lang'] ?>">
26<head>
27    <meta charset="utf-8">
28    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
29    <?php
30        echo '<title>' . $TEMPLATE->getPageTitle() . '</title>';
31        tpl_metaheaders();
32        echo tpl_favicon(['favicon', 'mobile']);
33        tpl_includeFile('meta.html');
34    ?>
35</head>
36
37<body class="mikio dokuwiki">
38<div id="dokuwiki__site">
39<?php
40    echo '<div id="dokuwiki__top" class="site ' . tpl_classes() . (($showSidebar === true) ? ' showSidebar' : '') .
41        (($hasSidebar === true) ? ' hasSidebar' : '') . '">';
42    $TEMPLATE->includePage('topheader', true, true, 'mikio-page-topheader' .
43        (($TEMPLATE->getConf('stickyTopHeader') === true) ? ' mikio-sticky' : ''));
44    $TEMPLATE->includeNavbar(true, $TEMPLATE->getConf('navbarShowSub', false) && $ACT == 'show');
45    if ($ACT === 'show' || $ACT === 'admin') {
46        $TEMPLATE->includePage('header', true, true, 'mikio-page-header' .
47            (($TEMPLATE->getConf('stickyHeader') === true) ? ' mikio-sticky' : ''));
48    }
49
50    echo '<a name="dokuwiki__top" id="dokuwiki__top"></a>';
51
52    if (
53        ($ACT === 'show' && $TEMPLATE->getConf('youareherePosition') === 'top') || ($ACT === 'show' &&
54        $TEMPLATE->getConf('youareherePosition') === 'hero' && $TEMPLATE->getConf('heroTitle') === false) ||
55        ($ACT !== 'show')
56    ) {
57        $TEMPLATE->includeYouAreHere();
58    }
59    if (
60        ($ACT === 'show' && $TEMPLATE->getConf('breadcrumbPosition') === 'top') || ($ACT === 'show' &&
61        $TEMPLATE->getConf('breadcrumbPosition') === 'hero' && $TEMPLATE->getConf('heroTitle') === false)
62    ) {
63        $TEMPLATE->includeBreadcrumbs();
64    }
65    if ($ACT === 'show' && $TEMPLATE->getConf('heroTitle') === true) {
66        $TEMPLATE->includeHero();
67    }
68
69    echo '<main class="mikio-page">';
70    echo '<div class="mikio-container">';
71    if ($showSidebar === true) {
72        $TEMPLATE->includeSidebar();
73    }
74        echo '<div class="mikio-content" id="dokuwiki__content">';
75    if ($ACT === 'show' && $TEMPLATE->getConf('youareherePosition') === 'page') {
76        $TEMPLATE->includeYouAreHere();
77    }
78    if ($ACT === 'show' && $TEMPLATE->getConf('breadcrumbPosition') === 'page') {
79        $TEMPLATE->includeBreadcrumbs();
80    }
81
82            $TEMPLATE->showMessages();
83
84            echo '<article class="mikio-article' . ($TEMPLATE->getConf('tocFull') === true ? ' toc-full' : '') . '">';
85                $TEMPLATE->includeTOC();
86    if ($ACT === 'show') {
87        $TEMPLATE->includePage('contentheader', true, true, 'mikio-page-contentheader');
88    }
89                $TEMPLATE->includeContent();
90    if ($ACT === 'show') {
91        $TEMPLATE->includePage('contentfooter', true, true, 'mikio-page-contentfooter');
92    }
93            echo '</article>';
94        echo '</div>';
95
96
97        $showPageTools = $TEMPLATE->getConf('pageToolsFloating');
98    if (
99        $ACT === 'show' && ($showPageTools === 'always' || $TEMPLATE->userCanEdit() === true &&
100        $showPageTools === 'page editors')
101    ) {
102        $TEMPLATE->includePageTools(true, true);
103    }
104
105        $rightsidebar = '';
106    if ($showSidebar === true) {
107        $rightsidebar = $TEMPLATE->includeSidebar('right');
108    }
109    echo '</div>';
110    echo '</main>';
111    echo '<div class="mikio-page-fill">';
112        echo '<div class="mikio-content" style="padding:0">';
113    if ($TEMPLATE->getConf('footerInPage') === true && $ACT === 'show') {
114        $TEMPLATE->includeFooter();
115    }
116        echo '</div>';
117    if ($rightsidebar !== '') {
118        echo '<aside class="mikio-sidebar mikio-sidebar-right"></aside>';
119    }
120    echo '</div>';
121
122    if ($TEMPLATE->getConf('footerInPage') === false && $ACT === 'show') {
123        $TEMPLATE->includeFooter();
124    }
125    $TEMPLATE->includePage('bottomfooter', true, true, 'mikio-page-bottomfooter');
126    ?>
127    <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
128</div></div>
129<?php $TEMPLATE->includeFooterMeta(); ?>
130</body>
131<?php $TEMPLATE->finalize(); ?>
132</html>
133