1<!--
2=========================================================
3*  Argon Dokuwiki Template
4*  Based on the Argon Design System by Creative Tim
5*  Ported to Dokuwiki by Anchit (@IceWreck)
6=========================================================
7 -->
8
9<?php
10if (!defined('DOKU_INC')) {
11    die();
12}
13/* must be run from within DokuWiki */
14@require_once dirname(__FILE__) . '/tpl_functions.php'; /* include hook for template functions */
15
16$showTools = !tpl_getConf('hideTools') || (tpl_getConf('hideTools') && !empty($_SERVER['REMOTE_USER']));
17$showSidebar = page_findnearest($conf['sidebar']) && ($ACT == 'show');
18?>
19<!DOCTYPE html>
20<html lang="en">
21	<head>
22		<meta charset="utf-8" />
23		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
24		<link rel="apple-touch-icon" sizes="76x76" href="assets/img/apple-icon.png">
25		<link rel="icon" type="image/png" href="<?php echo tpl_basedir(); ?>images/favicon<?php echo tpl_getConf('favicon')?>.ico">
26		<title>
27			<?php tpl_pagetitle()?> [
28			<?php echo strip_tags($conf['title']) ?>]</title>
29		<?php tpl_metaheaders()?>
30		<?php echo tpl_favicon(array(
31			'favicon',
32			'mobile',
33		))
34		?>
35
36		<?php tpl_includeFile('meta.html')?>
37
38		<!--
39		I know the CSS and JS imports can be done within the style.ini and script.js files,
40		but I had some issues with styling (and import order) there, so I'm doing those imports here.
41		-->
42		<!--     Fonts and icons  -->
43		<!-- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet"> -->
44		<link href="<?php echo tpl_basedir(); ?>assets/css/fonts.css" rel="stylesheet">
45		<!-- CSS Files -->
46		<link href="<?php echo tpl_basedir(); ?>assets/css/doku.css" rel="stylesheet" />
47		<!-- JS -->
48		<script src="<?php echo tpl_basedir(); ?>assets/js/core/bootstrap.min.js" type="text/javascript"></script>
49		<script src="<?php echo tpl_basedir(); ?>assets/js/argon-design-system.min.js" type="text/javascript"></script>
50
51	</head>
52
53	<body class="docs ">
54		<div id="dokuwiki__site">
55			<header
56				class="navbar navbar-horizontal navbar-expand navbar-dark flex-row align-items-md-center ct-navbar bg-primary py-2">
57
58
59				<div class="header-title">
60                    <?php
61                    $showIcon = tpl_getConf('showIcon');
62                    if ($showIcon):
63                    ?>
64                    <img width="30px" src="<?php echo tpl_basedir(); ?>/images/doku-icon<?php echo tpl_getConf('icon')?>.png"/>
65                    <?php endif; ?>
66                    <?php tpl_link(wl(), $conf['title'], 'accesskey="h" title="[H]"')?>
67				</div>
68
69
70				<div class="d-none d-sm-block ml-auto">
71					<ul class="navbar-nav ct-navbar-nav flex-row align-items-center">
72                        <li class="nav-item dropdown">
73                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
74                                <?php
75                                if (!empty($_SERVER['REMOTE_USER'])) {
76//                            $loggedinas = tpl_getLang('loggedinas');
77                                    ob_start();
78                                    tpl_userinfo();
79                                    $value = ob_get_contents();
80                                    ob_end_clean();
81                                    echo str_replace('Logged in as: ', '', $value);
82                                }
83                                ?>
84                            </a>
85                            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
86                                <?php
87                                $menu_items = (new \dokuwiki\Menu\UserMenu())->getItems();
88                                foreach($menu_items as $item) {
89                                    echo '<a class="dropdown-item" href="'.$item->getLink().'" title="'.$item->getTitle().'">'
90                                        .'<i class="argon-doku-navbar-icon">'.inlineSVG($item->getSvg()).'</i>'
91                                        .$item->getLabel()
92                                        . '<span class="a11y">'.$item->getLabel().'</span>'
93                                        . '</a>';
94                                }
95                                ?>
96                            </div>
97                        </li>
98
99						<li class="nav-item">
100							<div class="search-form">
101								<?php tpl_searchform()?>
102							</div>
103						</li>
104
105
106					</ul>
107				</div>
108				<button class="navbar-toggler ct-search-docs-toggle d-block d-md-none ml-auto ml-sm-0" type="button"
109					data-toggle="collapse" data-target="#ct-docs-nav" aria-controls="ct-docs-nav" aria-expanded="false"
110					aria-label="Toggle docs navigation">
111					<span class="navbar-toggler-icon"></span>
112				</button>
113
114			</header>
115
116
117
118			<div class="container-fluid">
119				<div class="row flex-xl-nowrap">
120
121
122					<?php
123					// Render the content initially
124					ob_start();
125					tpl_content(false);
126					$buffer = ob_get_clean();
127					?>
128
129					<!-- left sidebar -->
130					<div class="col-12 col-md-3 col-xl-2 ct-sidebar">
131						<nav class="collapse ct-links" id="ct-docs-nav">
132							<?php if ($showSidebar): ?>
133							<div id="dokuwiki__aside" class="ct-toc-item active">
134								<div class="leftsidebar">
135									<?php tpl_includeFile('sidebarheader.html')?>
136									<?php tpl_include_page($conf['sidebar'], 1, 1)?>
137                                    <a class="ct-toc-link">
138                                        <?php echo $lang['site_tools'] ?>
139                                    </a>
140									<?php tpl_includeFile('sidebarfooter.html')?>
141								</div>
142							</div>
143							<?php endif;?>
144
145                            <div class="ct-toc-item active">
146                                <ul class="nav ct-sidenav">
147                                    <?php
148                                    $menu_items = (new \dokuwiki\Menu\SiteMenu())->getItems();
149                                    foreach($menu_items as $item) {
150                                        echo '<li>'
151                                            .'<a class="" href="'.$item->getLink().'" title="'.$item->getTitle().'">'
152                                            . $item->getLabel()
153                                            . '</a></li>';
154                                    }
155
156                                    ?>
157                                </ul>
158                            </div>
159						</nav>
160					</div>
161
162
163					<!-- center content -->
164
165					<main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 ct-content" role="main">
166
167						<div id="dokuwiki__top" class="site
168						<?php echo tpl_classes(); ?>
169						<?php echo ($showSidebar) ? 'hasSidebar' : ''; ?>">
170						</div>
171
172						<?php html_msgarea()?>
173						<?php tpl_includeFile('header.html')?>
174
175
176						<!-- Trace/Navigation -->
177						<nav aria-label="breadcrumb" role="navigation">
178							<ol class="breadcrumb">
179								<?php if ($conf['breadcrumbs']) {?>
180								<div class="breadcrumbs"><?php tpl_breadcrumbs()?></div>
181								<?php }?>
182								<?php if ($conf['youarehere']) {?>
183								<div class="breadcrumbs"><?php tpl_youarehere()?></div>
184								<?php }?>
185							</ol>
186						</nav>
187
188                        <!-- Page Menu -->
189                        <div class="argon-doku-page-menu">
190                            <?php
191                            $menu_items = (new \dokuwiki\Menu\PageMenu())->getItems();
192                            foreach($menu_items as $item) {
193                                echo '<li>'
194                                    .'<a class="page-menu__link" href="'.$item->getLink().'" title="'.$item->getTitle().'">'
195                                    .'<i class="">'.inlineSVG($item->getSvg()).'</i>'
196                                    . '<span class="a11y">'.$item->getLabel().'</span>'
197                                    . '</a></li>';
198                            }
199                            ?>
200                        </div>
201
202                        <!-- Floating Top Button -->
203                        <div class="floating-top-button">
204                            <?php
205                            $menu_items = (new \dokuwiki\Menu\PageMenu())->getItems();
206                            foreach($menu_items as $item) {
207                                if ($item->getType() != "top") continue;
208                                echo '<a class="btn" href="'.$item->getLink().'" title="'.$item->getTitle().'">'
209                                    .'<i class="">'.inlineSVG($item->getSvg()).'</i>'
210                                    . '<span class="a11y">'.$item->getLabel().'</span>'
211                                    . '</a>';
212                            }
213                            ?>
214                        </div>
215
216
217						<!-- Wiki Contents -->
218						<div id="dokuwiki__content">
219							<div class="pad">
220								<div class="page">
221									<?php echo $buffer ?>
222								</div>
223							</div>
224						</div>
225
226						<hr />
227
228                        <!-- Footer -->
229                        <footer>
230                            <div class="row">
231                                <p class="page-info"><?php tpl_pageinfo() /* 'Last modified' etc */ ?></p>
232                            </div>
233
234                            <?php
235                                ob_start();
236                                tpl_license('0');
237                                $buffer = ob_get_clean();
238                                if ($buffer):
239                                ?>
240                            <div class="card footer-card">
241                                <div class="card-body">
242                                    <div class="container">
243                                        <div class="row">
244                                            <div class="col">
245                                                <div id="dokuwiki__footer">
246                                                    <div class="pad">
247                                                        <div class="doc">
248                                                        </div>
249                                                        <?php tpl_license('0') /* content license, parameters: img=*badge|button|0, imgonly=*0|1, return=*0|1 */ ?>
250                                                    </div>
251                                                </div>
252                                            </div>
253                                        </div>
254                                    </div>
255                                </div>
256                            </div>
257                            <?php endif;?>
258                            <?php tpl_includeFile('footer.html') ?>
259                            <?php tpl_indexerWebBug(); ?>
260                        </footer>
261					</main>
262
263					<!-- Right Sidebar -->
264					<div class="d-none d-xl-block col-xl-2 ct-toc">
265						<div>
266							<?php tpl_toc()?>
267						</div>
268					</div>
269
270				</div>
271			</div>
272		</div>
273	</body>
274
275</html>
276