1<?php
2/**
3 * DokuWiki Template with Bootstrap4
4 *
5 * @link     http://dokuwiki.org/template
6 * @author   Kijima Daigo <norimaking777@gmail.com>
7 * @license  GPL 2 (http://www.gnu.org/licenses/gpl.html)
8 */
9
10if (!defined('DOKU_INC')) die(); /* must be run from within DokuWiki */
11header('X-UA-Compatible: IE=edge,chrome=1');
12
13$hasSidebar = page_findnearest($conf['sidebar']);
14$showSidebar = $hasSidebar && ($ACT=='show');
15
16function ua_smt (){
17    // Get user agent
18    $ua = $_SERVER['HTTP_USER_AGENT'];
19    // Word list for checking mobile
20    $ua_list = array('iPhone','iPad','iPod','Android');
21    foreach ($ua_list as $ua_smt) {
22	// mobile -> true
23	if (strpos($ua, $ua_smt) !== false) {
24	    return true;
25	}
26    } return false;
27}
28?>
29<!DOCTYPE html>
30<html lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>" class="no-js">
31    <head>
32	<meta charset="utf-8" />
33	<title><?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title']) ?>]</title>
34	<script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
35	<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" />
36	<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
37	<?php tpl_metaheaders() ?>
38	<meta name="viewport" content="width=device-width,initial-scale=1" />
39	<?php echo tpl_favicon(array('favicon', 'mobile')) ?>
40	<?php tpl_includeFile('meta.html') ?>
41    </head>
42
43    <body>
44	<?php if($ID == 'start'): ?>
45	    <div id="dokuwiki__site"><div id="dokuwiki__top" class="site <?php echo tpl_classes(); ?> <?php
46												      echo ($showSidebar) ? 'showSidebar' : ''; ?> <?php echo ($hasSidebar) ? 'hasSidebar' : ''; ?>">
47	<?php else: ?>
48		<div id="dokuwiki__site"><div id="dokuwiki__top" class="site <?php echo tpl_classes(); ?>">
49	<?php endif; ?><!-- /start -->
50
51        <?php include('tpl_header.php') ?>
52	<div class="wrapper group">
53	    <div class="container">
54		<div class="row">
55		    <div class="col-12 px-4 mt-4">
56
57			<?php if($ID == 'start'): ?>
58			    <?php if($showSidebar): ?>
59				<!-- ********** ASIDE ********** -->
60				<div id="dokuwiki__aside"><div class="pad aside include group border-right border-dark">
61				    <h3 class="toggle"><?php echo $lang['sidebar'] ?></h3>
62				    <div class="content"><div class="group">
63					<?php tpl_flush() ?>
64					<?php tpl_includeFile('sidebarheader.html') ?>
65					<?php tpl_include_page($conf['sidebar'], true, true) ?>
66					<?php tpl_includeFile('sidebarfooter.html') ?>
67				    </div></div>
68				</div></div><!-- /aside -->
69			    <?php endif; ?>
70			<?php endif; ?><!-- /start -->
71
72
73			<!-- ********** CONTENT ********** -->
74
75			<div id="dokuwiki__content"><div class="pad group">
76			    <?php html_msgarea() ?>
77
78			    <div class="page group p-0">
79				<?php tpl_flush() ?>
80				<?php tpl_includeFile('pageheader.html') ?>
81				<!-- wikipage start -->
82				<?php if (ua_smt() == true){
83				    tpl_content(false); /* if mobile, not display TOC. */
84				} else {
85				    tpl_content();
86				}
87				?>
88				<!-- wikipage stop -->
89				<?php tpl_includeFile('pagefooter.html') ?>
90
91				<small><div class="docInfo text-right text-secondary"><?php tpl_pageinfo() ?></div></small>
92			    </div>
93
94			    <?php tpl_flush() ?>
95			</div></div>
96		    </div>
97		    <!-- /content -->
98
99		    <!-- PAGE ACTIONS -->
100		    <div id="dokuwiki__pagetools">
101			<h3 class="a11y"><?php echo $lang['page_tools']; ?></h3>
102			<div class="tools">
103			    <ul>
104				<?php echo (new \dokuwiki\Menu\PageMenu())->getListItems(); ?>
105			    </ul>
106			</div>
107		    </div>
108		</div><!-- row -->
109	    </div><!-- container -->
110	</div><!-- wrapper -->
111	<?php include('tpl_footer.php') ?>
112		</div></div><!-- /site -->
113
114		<div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
115		<div id="screen__mode" class="no"></div><?php /* helper to detect CSS media query in script.js */ ?>
116
117		<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
118		<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script> -->
119		<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
120
121    </body>
122</html>
123