xref: /template/ad-hominem/main.php (revision dcc0f219d5246aee0edbf32b613d814e8d7f3420)
1<?php
2/**
3 * Ad Hominem Template
4 *
5 * @link     https://ad.hominem.info/
6 * @author   Sascha Leib <sascha@leib.be>
7 * @author   Anika Henke <anika@selfthinker.org>
8 * @author   Clarence Lee <clarencedglee@gmail.com>
9 * @license  GPL 2 (http://www.gnu.org/licenses/gpl.html)
10 */
11
12if (!defined('DOKU_INC')) die(); /* must be run from within DokuWiki */
13
14require_once('my_template.php');
15
16$hasSidebar = page_findnearest($conf['sidebar']);
17$showSidebar = $hasSidebar && ($ACT=='show');
18
19$htmlLang = ' lang="' . $conf['lang'] . ( $lang['direction'] != 'ltr' ? '" dir="'. $lang['direction'] : '') . '"';
20
21?><!DOCTYPE html>
22<html<?php echo $htmlLang ?>>
23<head>
24	<meta charset="UTF-8" />
25	<title><?php tpl_pagetitle() ?> &ndash; <?php echo str_replace(' ', ' ', strip_tags($conf['title'])) ?></title>
26<?php my_metaheaders() ?>
27	<meta name="viewport" content="width=device-width,initial-scale=1" />
28<?php tpl_includeFile('meta.html') ?>
29</head>
30<body class="site <?php echo trim(tpl_classes()); ?>">
31	<div id="skip-link">
32		<a href="#main-content"><?php echo $lang['skip_to_content']; ?></a>
33	</div>
34	<div id="header-layout">
35		<header>
36			<div id="siteLogo">
37				<?php
38					// get logo either out of the template images folder or data/media folder
39					$logoSize = array();
40					$logo = tpl_getMediaFile(array(':wiki:logo.png', ':logo.png', 'images/sitelogo.svg'), false, $logoSize);
41					tpl_link( wl(),
42						'<img src="'.$logo.'" ' . $logoSize[3] . ' alt="' . htmlentities($conf['title']) . '" />', 'accesskey="h" title="[H]" class="logo"');
43				?>
44
45				<h2 class="title"><?php tpl_link( wl(), htmlentities($conf['title']), ''); ?></h2>
46				<p class="claim"><?php echo $conf['tagline']; ?></p>
47			</div>
48			<div id="globalTools">
49				<div id="gUserTools">
50					<h3 class="sronly"><?php echo $lang['user_tools']; ?></h3>
51					<ul>
52<?php my_userinfo(str_repeat(chr(9),6)); ?>
53					</ul>
54				</div>
55			</div>
56			<div id="phSearch">
57<?php include('tpl_searchform.php'); ?>
58			</div>
59			<div id="phTools"><!-- placeholder for additional tools --></div>
60			<div id="phInclude"><?php tpl_includeFile('header.html') ?></div>
61		</header>
62	</div>
63    <div id="main-layout">
64		<div id="sidebar" class="toggle <?php
65        echo ( $showSidebar ? 'auto' : 'hide' ); ?>">
66			<button class="tg_button" title="<?php echo $lang['sidebar'] ?>"><span><?php echo $lang['sidebar'] ?></span></button>
67			<div class="tg_content">
68				<nav id="sbNavigation">
69<!-- - - - - - - - - SIDEBAR CONTENT - - - - - - - -->
70<?php
71			tpl_flush();
72			tpl_includeFile('sidebarheader.html');
73			tpl_include_page($conf['sidebar'], true, true);
74			tpl_includeFile('sidebarfooter.html');
75?>				</nav>
76<!-- - - - - - - - - END OF SIDEBAR CONTENT  - - - - - - - -->
77				<div id="sbBreadcrumbs">
78<?php		if($conf['breadcrumbs']) { my_breadcrumbs(str_repeat(chr(9),4)); } ?>
79				</div>
80			</div>
81		</div>
82		<main id="dokuwiki__top">
83			<header>
84<?php			my_toc(str_repeat(chr(9),4));
85				tpl_flush();
86				tpl_includeFile('pageheader.html');
87				if($conf['youarehere']) { my_youarehere(str_repeat(chr(9),4)); }
88?>			</header>
89			<article id="main-content">
90<!-- - - - - - - - - ARTICLE CONTENT - - - - - - - -->
91<?php tpl_content(false) ?>
92<!-- - - - - - - - - END OF ARTICLE  - - - - - - - -->
93			</article>
94			<footer>
95				<p class="docInfo">
96<?php my_lastchange(str_repeat(chr(9),5));
97?>				</p>
98<?php tpl_includeFile('pagefooter.html') ?>
99			</footer>
100		</main>
101	</div>
102	<div id="footer-layout">
103		<footer>
104			<div id="ftPlaceholder" class="ftSection"></div>
105			<div id="ftInclude" class="ftSection">
106<?php tpl_includeFile('footer.html'); ?>
107			</div>
108			<div id="ftSiteTools" class="ftSection">
109				<h4><?php echo $lang['site_tools']; ?></h4>
110				<ul>
111					<?php echo (new \dokuwiki\Menu\SiteMenu())->getListItems('action ', false); ?>
112
113				</ul>
114			</div>
115			<div id="ftPageTools" class="ftSection">
116				<h4><?php echo $lang['page_tools']; ?></h4>
117				<ul>
118					<?php echo (new \dokuwiki\Menu\PageMenu())->getListItems('', false); ?>
119
120				</ul>
121			</div>
122<?php include('tpl_footer.php') ?>
123		</footer>
124	</div>
125	<div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
126	<div id="screen__mode" class="no"></div><?php /* helper to detect CSS media query in script.js */ ?>
127</body>
128</html>