hydrogen/main.php

133 lines
5.1 KiB
PHP

<?php
if (!defined('DOKU_INC')) die(); /* must be run from within DokuWiki */
@require_once(dirname(__FILE__).'/tpl_functions.php'); /* include hook for template functions */
$showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && !empty($_SERVER['REMOTE_USER']) );
$showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
?><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang'] ?>"
lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>">
<head>
<meta charset="UTF-8" />
<title><?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title']) ?>]</title>
<script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
<?php tpl_metaheaders() ?>
<meta name="viewport" content="width=device-width" />
<?php echo tpl_favicon(array('favicon', 'mobile')) ?>
<?php tpl_includeFile('meta.html') ?>
</head>
<?php
/* render the content into buffer for later use, necessary for toc */
ob_start();
tpl_content(false);
$buffer = ob_get_clean();
?>
<body id="dokuwiki__top" class="<?php echo tpl_classes(); ?> <?php echo ($showSidebar) ? 'hasSidebar' : ''; ?>">
<header>
<?php html_msgarea() /* occasional error and info messages on top of the page */ ?>
<?php tpl_includeFile('header.html') ?>
<?php
// get logo either out of the template images folder or data/media folder
$logoSize = array();
$logo = tpl_getMediaFile(array(':wiki:logo.svg', ':logo.svg', 'images/logo.svg', ':wiki:logo.png', ':logo.png', 'images/logo.png'), false, $logoSize);
$logoSize[3] = $logoSize[3] ?? ''; // empty if no size given
// display logo and wiki title in a link to the home page
tpl_link(
wl(),
'<img class="logo" src="'.$logo.'" '.$logoSize[3].' alt="logo" />'.
'<h1>'.$conf['title'].'</h1>',
'accesskey="h" title="' . tpl_getLang('home') . ' [h]"'
);
?>
<?php if ($conf['tagline']): ?>
<p class="claim"><?php echo $conf['tagline'] ?></p>
<?php endif ?>
<div id="dokuwiki__searchform">
<?php tpl_searchform() ?>
</div>
</header>
<?php tpl_flush() ?>
<main id="dokuwiki__content">
<!-- BREADCRUMBS -->
<nav id="dokuwiki__breadcrumbs">
<?php if($conf['breadcrumbs']){ ?>
<div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div>
<?php } ?>
<?php if($conf['youarehere']){ ?>
<div class="breadcrumbs"><?php tpl_youarehere() ?></div>
<?php } ?>
</nav>
<?php tpl_flush() /* flush the output buffer */ ?>
<?php tpl_includeFile('pageheader.html') ?>
<?php echo $buffer /* main content */ ?>
<?php tpl_flush() ?>
<?php tpl_includeFile('pagefooter.html') ?>
</main>
<!-- ********** FOOTER ********** -->
<footer>
<div class="doc"><?php tpl_pageinfo() /* 'Last modified' etc */ ?></div>
<?php tpl_license('button') /* content license, parameters: img=*badge|button|0, imgonly=*0|1, return=*0|1 */ ?>
<?php tpl_includeFile('footer.html') ?>
<!-- TOC AND TOOLS IN SIDENAV -->
<a id="dokuwiki__sidebar_show_btn" class="button" href="#dokuwiki__sidebar" class="button" >☰</a>
<div id="dokuwiki__sidebar" aria-labelledby="dokuwiki__sitetools_heading">
<div id="dokuwiki__sidebar_header">
<a href="#dokuwiki__sidebar_close" id="dokuwiki__sidebar_close_btn" class="button" aria-label="Close">&times;</a>
</div>
<!-- has to be one line to use :empty css selector -->
<div id="dokuwiki__sidebar_content"><?php if ($showSidebar): ?> <?php tpl_includeFile('sidebarheader.html') ?> <?php tpl_include_page($conf['sidebar'], 1, 1) /* includes the nearest sidebar page */ ?> <?php tpl_includeFile('sidebarfooter.html') ?><?php endif; ?>
</div>
<details id="dokuwiki__pagetools" aria-labelledby="dokuwiki__pagetools_heading">
<summary id="dokuwiki__pagetools_heading"><?php echo $lang['tools'] ?></summary>
<ul>
<!-- USER TOOLS -->
<?php if ($conf['useacl'] && $showTools): ?>
<?php if (!empty($_SERVER['REMOTE_USER'])) {
echo '<li class="user">';
tpl_userinfo(); /* 'Logged in as ...' */
echo '</li>';
} ?>
<?php if (file_exists(DOKU_INC . 'inc/Menu/UserMenu.php')) {
/* the first parameter is for an additional class, the second for if SVGs should be added */
echo (new \dokuwiki\Menu\UserMenu())->getListItems('action ', false);
} ?>
<?php endif ?>
<?php if (file_exists(DOKU_INC . 'inc/Menu/PageMenu.php')) {
echo (new \dokuwiki\Menu\PageMenu())->getListItems('action ', false);
} else {
_tpl_pagetools();
} ?>
<?php if (file_exists(DOKU_INC . 'inc/Menu/SiteMenu.php')) {
echo (new \dokuwiki\Menu\SiteMenu())->getListItems('action ', false);
} else {
_tpl_sitetools();
} ?>
</ul>
</details>
<div id="dokuwiki__sidebar_toc">
<?php tpl_toc()?>
</div>
</div>
</footer>
<div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
</body>
</html>