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
23ob_start();
24?>
25<!doctype html>
26<html lang="<?php echo $conf['lang'] ?>">
27<head>
28    <meta charset="utf-8">
29    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
30    <title><?php echo $TEMPLATE->getPageTitle() ?></title>
31    <?php
32        try {
33            tpl_metaheaders();
34        } catch (Exception $e) {
35            /* empty */
36        }
37        echo tpl_favicon(['favicon', 'mobile']);
38        tpl_includeFile('meta.html');
39    ?>
40</head>
41<body class="mikio<?php echo $TEMPLATE->getConf('autoLightDark') === true ? ' mikio-auto-darklight' : '' ?><?php echo $TEMPLATE->getConf('defaultDark') === true ? ' mikio-default-dark' : '' ?>">
42<div id="dokuwiki__site">
43    <?php
44    echo '<div id="dokuwiki__top" class="site ' . tpl_classes() . (($showSidebar === true) ? ' showSidebar' : '') .
45        (($hasSidebar === true) ? ' hasSidebar' : '') . '">';
46    $TEMPLATE->includePage('topheader', true, true, 'mikio-page-topheader' .
47        (($TEMPLATE->getConf('stickyTopHeader') === true) ? ' mikio-sticky' : ''));
48    $TEMPLATE->includeNavbar(true, $ACT === 'show' && $TEMPLATE->getConf('navbarShowSub', false));
49    if ($ACT === 'show' || $ACT === 'admin') {
50        $TEMPLATE->includePage('header', true, true, 'mikio-page-header' .
51            (($TEMPLATE->getConf('stickyHeader') === true) ? ' mikio-sticky' : ''));
52    }
53
54    /** @noinspection HtmlDeprecatedAttribute */
55    echo '<a name="dokuwiki__top" id="dokuwiki__top"></a>';
56
57    if (
58        ($ACT === 'show' && $TEMPLATE->getConf('youareherePosition') === 'top') || ($ACT === 'show' &&
59        $TEMPLATE->getConf('youareherePosition') === 'hero' && $TEMPLATE->getConf('heroTitle') === false) ||
60        ($ACT !== 'show')
61    ) {
62        $TEMPLATE->includeYouAreHere();
63    }
64    if (
65        ($ACT === 'show' && $TEMPLATE->getConf('breadcrumbPosition') === 'top') || ($ACT === 'show' &&
66        $TEMPLATE->getConf('breadcrumbPosition') === 'hero' && $TEMPLATE->getConf('heroTitle') === false)
67    ) {
68        $TEMPLATE->includeBreadcrumbs();
69    }
70    if ($ACT === 'show' && $TEMPLATE->getConf('heroTitle') === true) {
71        $TEMPLATE->includeHero();
72    }
73
74    echo '<main class="mikio-page">';
75    echo '<div class="mikio-container">';
76    if ($showSidebar === true) {
77        $TEMPLATE->includeSidebar();
78    }
79        echo '<div class="mikio-content" id="dokuwiki__content">';
80    if ($ACT === 'show' && $TEMPLATE->getConf('youareherePosition') === 'page') {
81        $TEMPLATE->includeYouAreHere();
82    }
83    if ($ACT === 'show' && $TEMPLATE->getConf('breadcrumbPosition') === 'page') {
84        $TEMPLATE->includeBreadcrumbs();
85    }
86
87            $TEMPLATE->showMessages();
88
89            echo '<article class="mikio-article' . ($TEMPLATE->getConf('tocFull') === true ? ' toc-full' : '') . '">';
90                $TEMPLATE->includeTOC();
91    if ($ACT === 'show') {
92        $TEMPLATE->includePage('contentheader', true, true, 'mikio-page-contentheader');
93    }
94                $TEMPLATE->includeContent();
95    if ($ACT === 'show') {
96        $TEMPLATE->includePage('contentfooter', true, true, 'mikio-page-contentfooter');
97    }
98            echo '</article>';
99        echo '</div>';
100
101
102        $showPageTools = $TEMPLATE->getConf('pageToolsFloating');
103    if (
104        $ACT === 'show' && ($showPageTools === 'always' || ($TEMPLATE->userCanEdit() === true &&
105        $showPageTools === 'page editors'))
106    ) {
107        $TEMPLATE->includePageTools(true, true);
108    }
109
110        $rightsidebar = '';
111    if ($showSidebar === true) {
112        $rightsidebar = $TEMPLATE->includeSidebar('right');
113    }
114
115    echo '</div>';
116    echo '</main>';
117    echo '<div class="mikio-page-fill">';
118        echo '<div class="mikio-content" style="padding:0">';
119    if ($ACT === 'show' && $TEMPLATE->getConf('footerInPage') === true) {
120        $TEMPLATE->includeFooter();
121    }
122        echo '</div>';
123    if ($rightsidebar !== '') {
124        echo '<aside class="mikio-sidebar mikio-sidebar-right"></aside>';
125    }
126    echo '</div>';
127
128    if ($ACT === 'show' && $TEMPLATE->getConf('footerInPage') === false) {
129        $TEMPLATE->includeFooter();
130    }
131    $TEMPLATE->includePage('bottomfooter', true, true, 'mikio-page-bottomfooter');
132    ?>
133    <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
134</div>
135<?php $TEMPLATE->includeFooterMeta(); ?>
136</body>
137</html>
138<?php
139$html = ob_get_clean();
140echo $html;
141?>
142