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