xref: /template/mikio/main.php (revision 1785fc733f2bb8cfc2d75ea9977238fe5e341d9b)
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        if($showSidebar) $TEMPLATE->includeSidebar();
49        echo '<div class="mikio-content" id="dokuwiki__content">';
50            if($ACT == 'show' && $TEMPLATE->getConf('breadcrumbPosition') == 'page') $TEMPLATE->includeBreadcrumbs();
51
52            $TEMPLATE->showMessages();
53
54            echo '<article class="mikio-article' . ($TEMPLATE->getConf('tocFull') ? ' toc-full' : '') . '">';
55                $TEMPLATE->includeTOC();
56                if($ACT == 'show') $TEMPLATE->includePage('contentheader', TRUE, TRUE, 'mikio-page-contentheader');
57                $TEMPLATE->includeContent();
58                if($ACT == 'show') $TEMPLATE->includePage('contentfooter', TRUE, TRUE, 'mikio-page-contentfooter');
59            echo '</article>';
60        echo '</div>';
61
62
63        $showPageTools = $TEMPLATE->getConf('pageToolsFloating');
64        if ($ACT == 'show' && ($showPageTools == 'always' || $TEMPLATE->userCanEdit() && $showPageTools == 'page editors')) $TEMPLATE->includePageTools(TRUE, TRUE);
65
66        $rightsidebar = '';
67        if($showSidebar) $rightsidebar = $TEMPLATE->includeSidebar('right');
68    echo '</main>';
69    echo '<div class="mikio-page-fill">';
70        if($showSidebar) echo '<aside class="mikio-sidebar mikio-sidebar-left"></aside>';
71        echo '<div class="mikio-content" style="padding:0">';
72        if($TEMPLATE->getConf('footerInPage') == TRUE && $ACT=='show') $TEMPLATE->includeFooter();
73        echo '</div>';
74        if($rightsidebar != '') echo '<aside class="mikio-sidebar mikio-sidebar-right"></aside>';
75    echo '</div>';
76
77    if($TEMPLATE->getConf('footerInPage') == FALSE && $ACT=='show') $TEMPLATE->includeFooter();
78    $TEMPLATE->includePage('bottomfooter', TRUE, TRUE, 'mikio-page-bottomfooter');
79?>
80    <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
81</div></div>
82<?php $TEMPLATE->includeFooterMeta(); ?>
83</body>
84<?php $TEMPLATE->finalize(); ?>
85</html>
86