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