1<?php 2/** 3 * Kiwiki Template 4 * 5 * @link http://dokuwiki.org/template:kiwiki 6 * @author Anika Henke <anika@selfthinker.org> 7 * @author Nicolas Prigent 8 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 9 */ 10 11if (!defined('DOKU_INC')) die(); /* must be run from within DokuWiki */ 12@require_once(dirname(__FILE__).'/tpl_functions.php'); /* include hook for template functions */ 13 14$showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && !empty($_SERVER['REMOTE_USER']) ); 15$showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show'); 16$sidebarElement = tpl_getConf('sidebarIsNav') ? 'nav' : 'aside'; 17$menuMaxHeight = tpl_getConf('MenuMaxHeight'); 18$tocMaxHeight = tpl_getConf('TocMaxHeight'); 19$contentMaxWidth = tpl_getConf('ContentMaxWidth'); 20$themeMode = tpl_getConf('DefaultTheme'); 21$forceTheme = tpl_getConf('ForceTheme'); 22 23if (!empty($_COOKIE['theme'])){ 24 if(!$forceTheme){ 25 $themeMode = $_COOKIE['theme']; 26 }else{ 27 setcookie("theme",$themeMode); 28 } 29} 30if (!isset($_COOKIE['theme']) || empty($_COOKIE['theme'])){ 31 setcookie("theme",$themeMode); 32} 33?><!DOCTYPE html> 34<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang'] ?>" 35 lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>" class="no-js"> 36<head> 37 <meta charset="UTF-8" /> 38 <title><?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title']) ?>]</title> 39 <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script> 40 <?php tpl_metaheaders() ?> 41 <meta name="viewport" content="width=device-width,initial-scale=1" /> 42 <?php echo tpl_favicon(array('favicon', 'mobile')) ?> 43 <?php tpl_includeFile('meta.html')?> 44 <style>body{ 45 --kiwiki-menu-max-height:<?php echo $menuMaxHeight; ?>px; 46 --kiwiki-toc-max-height:<?php echo $tocMaxHeight; ?>px; 47 --kiwiki-content-max-width:<?php echo $contentMaxWidth; ?>; 48 } 49 </style> 50</head> 51 52 53<body id="kiwiki" class="<?php echo $themeMode; ?>"> 54 <?php /* the "dokuwiki__top" id is needed somewhere at the top, because that's where the "back to top" button/link links to */ ?> 55 <?php /* tpl_classes() provides useful CSS classes; if you choose not to use it, the 'dokuwiki' class at least 56 should always be in one of the surrounding elements (e.g. plugins and templates depend on it) */ ?> 57 <?php $admin_page = (($ACT == "admin") && (isset($_REQUEST['page']))) ? explode("#",$_REQUEST['page'])[0]: "" ;?> 58 <div id="dokuwiki__site"> 59 <div id="dokuwiki__top" class="site <?php echo tpl_classes() ." " . $admin_page; ?>"> 60 <!-- ********** HEADER ********** --> 61 <?php include('partial/header.php');?> 62 63 <?php include('partial/before_content.php'); ?> 64 65 <?php include('partial/content.php');?> 66 67 </div> 68 <!-- ********** FOOTER ********** --> 69 <?php include('partial/footer.php'); ?> 70 <!-- GO TOP --> 71 <div id="go"> 72 <?php 73 74 $items = (new \dokuwiki\Menu\KiwikiGo())->getItems(); 75 foreach ($items as $item){ 76 if ($item -> getType() == 'bottom' && !tpl_getConf('GoBottomBtn')){ 77 continue; 78 }else{ 79 echo '<a href="'.$item->getLink().'" title="'.$item->getTitle().'">' 80 .'<span class="icon">'.inlineSVG($item->getSvg()).'</span>' 81 . '<span class="a11y">'.$item->getLabel().'</span>' 82 . '</a>'; 83 } 84 } 85 ?> 86 </div> 87 </div><!-- /site --> 88 <div id="dokuwiki__bottom"></div> 89 <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div> 90</body> 91</html> 92