1<?php
2if (!defined('DOKU_INC')) die(); /* must be run from within DokuWiki */
3@require_once(dirname(__FILE__).'/tpl_functions.php'); /* include hook for template functions */
4
5$showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && !empty($_SERVER['REMOTE_USER']) );
6$showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
7?><!DOCTYPE html>
8<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang'] ?>"
9  lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>">
10<head>
11    <meta charset="UTF-8" />
12    <title><?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title']) ?>]</title>
13    <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
14    <?php tpl_metaheaders() ?>
15    <meta name="viewport" content="width=device-width" />
16    <?php echo tpl_favicon(array('favicon', 'mobile')) ?>
17    <?php tpl_includeFile('meta.html') ?>
18</head>
19
20<body id="dokuwiki__top" class="<?php echo tpl_classes(); ?> <?php echo ($showSidebar) ? 'hasSidebar' : ''; ?>">
21        <header>
22		<?php html_msgarea() /* occasional error and info messages on top of the page */ ?>
23		<?php tpl_includeFile('header.html') ?>
24
25		<!-- USER TOOLS -->
26		<?php if ($conf['useacl'] && $showTools): ?>
27		    <nav id="dokuwiki__usertools" aria-labelledby="dokuwiki__sitetools_heading">
28			<h3 class="a11y" id="dokuwiki__usertools_heading"><?php echo $lang['user_tools'] ?></h3>
29			<ul>
30			    <?php if (!empty($_SERVER['REMOTE_USER'])) {
31				echo '<li class="user">';
32				tpl_userinfo(); /* 'Logged in as ...' */
33				echo '</li>';
34			    } ?>
35			    <?php if (file_exists(DOKU_INC . 'inc/Menu/UserMenu.php')) {
36				/* the first parameter is for an additional class, the second for if SVGs should be added */
37				echo (new \dokuwiki\Menu\UserMenu())->getListItems('action ', false);
38			    } ?>
39			</ul>
40		    </nav>
41		<?php endif ?>
42
43		<?php
44		    // get logo either out of the template images folder or data/media folder
45		    $logoSize = array();
46		    $logo = tpl_getMediaFile(array(':wiki:logo.svg', ':logo.svg', 'images/logo.svg', ':wiki:logo.png', ':logo.png', 'images/logo.png'), false, $logoSize);
47
48		    $logoSize[3] = $logoSize[3] ?? ''; // empty if no size given
49		    // display logo and wiki title in a link to the home page
50		    tpl_link(
51			wl(),
52			'<img class="logo" src="'.$logo.'" '.$logoSize[3].' alt="logo" />'.
53			'<h1>'.$conf['title'].'</h1>',
54			'accesskey="h" title="' . tpl_getLang('home') . ' [h]"'
55		    );
56		?>
57
58                <?php if ($conf['tagline']): ?>
59                    <p class="claim"><?php echo $conf['tagline'] ?></p>
60                <?php endif ?>
61
62		<?php tpl_searchform() ?>
63
64                <!-- TOC AND TOOLS IN SIDENAV -->
65		<a id="dokuwiki__sidebar_show_btn" class="button" href="#dokuwiki__sidebar" class="button" >☰</a>
66                <div id="dokuwiki__sidebar" aria-labelledby="dokuwiki__sitetools_heading">
67			<div id="dokuwiki__sidebar_header">
68				<a href="#dokuwiki__sidebar_close" id="dokuwiki__sidebar_close_btn" class="button" aria-label="Close">&times;</a>
69			</div>
70			<div id="dokuwiki__sidebar_content">
71				<?php if ($showSidebar): ?>
72					<?php tpl_includeFile('sidebarheader.html') ?>
73					<?php tpl_include_page($conf['sidebar'], 1, 1) /* includes the nearest sidebar page */ ?>
74					<?php tpl_includeFile('sidebarfooter.html') ?>
75				<?php endif; ?>
76			</div>
77			<details id="dokuwiki__pagetools" aria-labelledby="dokuwiki__pagetools_heading">
78			    <summary id="dokuwiki__pagetools_heading"><?php echo $lang['page_tools'] ?></summary>
79			    <ul>
80				<?php if (file_exists(DOKU_INC . 'inc/Menu/SiteMenu.php')) {
81				    echo (new \dokuwiki\Menu\SiteMenu())->getListItems('action ', false);
82				} else {
83				    _tpl_sitetools();
84				} ?>
85				<?php if (file_exists(DOKU_INC . 'inc/Menu/PageMenu.php')) {
86				    echo (new \dokuwiki\Menu\PageMenu())->getListItems('action ', false);
87				} else {
88				    _tpl_pagetools();
89				} ?>
90			    </ul>
91			</details>
92			<?php tpl_toc()?>
93		</div>
94        </header>
95
96	<main id="dokuwiki__content">
97		<!-- BREADCRUMBS -->
98		<nav id="dokuwiki__breadcrumbs">
99		<?php if($conf['breadcrumbs']){ ?>
100		<div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div>
101		<?php } ?>
102		<?php if($conf['youarehere']){ ?>
103		<div class="breadcrumbs"><?php tpl_youarehere() ?></div>
104		<?php } ?>
105		</nav>
106
107                <?php tpl_flush() /* flush the output buffer */ ?>
108                <?php tpl_includeFile('pageheader.html') ?>
109
110		<?php tpl_content(false) /* the main content */ ?>
111
112                <?php tpl_flush() ?>
113                <?php tpl_includeFile('pagefooter.html') ?>
114	</main>
115
116
117        <!-- ********** FOOTER ********** -->
118        <footer>
119		<div class="doc"><?php tpl_pageinfo() /* 'Last modified' etc */ ?></div>
120		<?php tpl_license('button') /* content license, parameters: img=*badge|button|0, imgonly=*0|1, return=*0|1 */ ?>
121		<?php tpl_includeFile('footer.html') ?>
122
123
124	</footer>
125	<div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
126</body>
127</html>
128