1<?php 2/** 3 * DokuWiki Starter Template 4 * 5 * @link http://dokuwiki.org/template:starter 6 * @author Anika Henke <anika@selfthinker.org> 7 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 8 */ 9 10if (!defined('DOKU_INC')) die(); /* must be run from within DokuWiki */ 11@require_once(dirname(__FILE__).'/tpl_functions.php'); /* include hook for template functions */ 12 13if ('true'!=$_SERVER['HTTP_X_PJAX']){ 14 /* really the template should expose control over the policy via the admin page....*/ 15 header("Content-Security-Policy: default-src 'self'; script-src https://apis.google.com; frame-src https://youtube.com"); 16} 17$showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER['REMOTE_USER'] ); 18$showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show'); 19if ('true'!=$_SERVER['HTTP_X_PJAX']){ 20?><!DOCTYPE html> 21<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang'] ?>" 22 lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>" class="no-js"> 23<head> 24 <meta charset="UTF-8" /> 25 <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><![endif]--> 26 <title><?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title']) ?>]</title> 27 <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script> 28 <?php tpl_metaheaders() ?> 29 <meta name="viewport" content="width=device-width,initial-scale=1" /> 30 <?php echo tpl_favicon(array('favicon', 'mobile')) ?> 31 <?php tpl_includeFile('meta.html') ?> 32</head> 33 34<body> 35 <?php /* with these Conditional Comments you can better address IE issues in CSS files, 36 precede CSS rules by #IE6 for IE6, #IE7 for IE7 and #IE8 for IE8 (div closes at the bottom) */ ?> 37 <!--[if IE 6 ]><div id="IE6"><![endif]--><!--[if IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]--> 38 39 <?php /* the "dokuwiki__top" id is needed somewhere at the top, because that's where the "back to top" button/link links to */ ?> 40 <?php /* classes mode_<action> are added to make it possible to e.g. style a page differently if it's in edit mode, 41 see http://www.dokuwiki.org/devel:action_modes for a list of action modes */ ?> 42 <?php /* .dokuwiki should always be in one of the surrounding elements (e.g. plugins and templates depend on it) */ ?> 43 <div id="dokuwiki__site"><div id="dokuwiki__top" 44 class="dokuwiki site mode_<?php echo $ACT ?> <?php echo ($showSidebar) ? 'hasSidebar' : '' ?>"> 45 <?php tpl_includeFile('header.html') ?> 46 <div id="pjax_container"> 47<?php } /* end of non-pajx header */ ?> 48 <!-- ********** HEADER ********** --> 49 <div id='pjaxTitle' 50 data-jw='{ "jokuwiki" : "pjaxTitle", "data" : { "id" : "pjaxTitle", "title" : "<?php 51 $pjaxTitle=htmlentities(tpl_pagetitle($ID, true) . ' [' . strip_tags($conf['title']). ']'); 52 echo $pjaxTitle; 53 ?>"}}' 54 class='pjaxTitle' 55 style='display:none'></div> 56 <!-- the div above implements a jokuwiki to update the window title --> 57 <div id="dokuwiki__header"><div class="pad"> 58 <?php html_msgarea() /* 59 * occasional error and info messages on top of the page 60 * NB this is moved down inside the pjax container compared 61 * with the standard template 62 */ ?> 63 <div class="headings"> 64 <h1><?php tpl_link(wl(),$conf['title'],'accesskey="h" title="[H]"') ?></h1> 65 <?php /* how to insert logo instead (if no CSS image replacement technique is used): 66 upload your logo into the data/media folder (root of the media manager) and replace 'logo.png' accordingly: 67 tpl_link(wl(),'<img src="'.ml('logo.png').'" alt="'.$conf['title'].'" />','id="dokuwiki__top" accesskey="h" title="[H]"') */ ?> 68 <?php if ($conf['tagline']): ?> 69 <p class="claim"><?php echo $conf['tagline'] ?></p> 70 <?php endif ?> 71 72 <ul class="a11y skip"> 73 <li><a href="#dokuwiki__content"><?php echo $lang['skip_to_content'] ?></a></li> 74 </ul> 75 <div class="clearer"></div> 76 </div> 77 <div class="tools"> 78 <!-- USER TOOLS --> 79 <?php if ($conf['useacl'] && $showTools){ ?> 80 <div id="dokuwiki__usertools"> 81 <h3 class="a11y"><?php echo $lang['user_tools'] ?></h3> 82 <ul> 83 <?php /* the optional second parameter of tpl_action() switches between a link and a button, 84 e.g. a button inside a <li> would be: tpl_action('edit', 0, 'li') */ 85 if ($_SERVER['REMOTE_USER']) { 86 echo '<li class="user">'; 87 tpl_userinfo(); /* 'Logged in as ...' */ 88 echo '</li>'; 89 } 90 tpl_action('admin', 1, 'li'); 91 _tpl_action('userpage', 1, 'li'); 92 tpl_action('profile', 1, 'li'); 93 tpl_action('register', 1, 'li'); /* DW versions < 2011-02-20 need to use _tpl_action('register', 1, 'li') */ 94 tpl_action('login', 1, 'li'); 95 ?> 96 </ul> 97 </div> 98 <?php } ?> 99 100 <!-- SITE TOOLS --> 101 <div id="dokuwiki__sitetools"> 102 <h3 class="a11y"><?php echo $lang['site_tools'] ?></h3> 103 <?php tpl_searchform() ?> 104 <ul> 105 <?php 106 tpl_action('recent', 1, 'li'); 107 tpl_action('media', 1, 'li'); 108 tpl_action('index', 1, 'li'); 109 ?> 110 </ul> 111 </div> 112 113 </div> 114 <div class="clearer"></div> 115 116 <!-- BREADCRUMBS --> 117 <?php if($conf['breadcrumbs']){ ?> 118 <div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div> 119 <?php } ?> 120 <?php if($conf['youarehere']){ ?> 121 <div class="breadcrumbs"><?php tpl_youarehere() ?></div> 122 <?php } ?> 123 <div class="clearer"></div> 124 <hr class="a11y" /> 125 </div></div><!-- /header --> 126 127 128 <div class="wrapper"> 129 130 <!-- ********** ASIDE ********** --> 131 <?php if ($showSidebar): ?> 132 <div id="dokuwiki__aside"><div class="pad include"> 133 <?php tpl_includeFile('sidebarheader.html') ?> 134 <?php tpl_include_page($conf['sidebar'], 1, 1) /* includes the nearest sidebar page */ ?> 135 <?php tpl_includeFile('sidebarfooter.html') ?> 136 <div class="clearer"></div> 137 </div></div><!-- /aside --> 138 <?php endif; ?> 139 140 <!-- ********** CONTENT ********** --> 141 <div id="dokuwiki__content"><div class="pad"> 142 <?php tpl_flush() /* flush the output buffer */ ?> 143 <?php tpl_includeFile('pageheader.html') ?> 144 145 <div class="page"> 146 <!-- wikipage start --> 147 <?php tpl_content() /* the main content */ ?> 148 <!-- wikipage stop --> 149 <div class="clearer"></div> 150 </div> 151 152 <?php tpl_flush() ?> 153 <?php tpl_includeFile('pagefooter.html') ?> 154 </div></div><!-- /content --> 155 156 <div class="clearer"></div> 157 <hr class="a11y" /> 158 159 <!-- PAGE ACTIONS --> 160 <?php if ($showTools): ?> 161 <div id="dokuwiki__pagetools"> 162 <h3 class="a11y"><?php echo $lang['page_tools'] ?></h3> 163 <ul> 164 <?php 165 tpl_action('edit', 1, 'li'); 166 _tpl_action('discussion', 1, 'li'); 167 tpl_action('revisions', 1, 'li'); 168 tpl_action('backlink', 1, 'li'); 169 tpl_action('subscribe', 1, 'li'); 170 tpl_action('revert', 1, 'li'); 171 tpl_action('top', 1, 'li'); 172 ?> 173 </ul> 174 </div> 175 <?php endif; ?> 176 </div><!-- /wrapper --> 177 178 <!-- ********** FOOTER ********** --> 179 <div id="dokuwiki__footer"><div class="pad"> 180 <div class="doc"><?php tpl_pageinfo() /* 'Last modified' etc */ ?></div> 181 <?php tpl_license('button') /* content license, parameters: img=*badge|button|0, imgonly=*0|1, return=*0|1 */ ?> 182 </div></div><!-- /footer --> 183 <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div> 184<?php if ('true'!==$_SERVER['HTTP_X_PJAX']) { ?> 185 </div><!-- pjax container --> 186 <?php tpl_includeFile('footer.html') ?> 187 </div></div><!-- /site --> 188 <script src="<?php print DOKU_TPL . 'jquery.pjax.js'; ?>" defer></script> 189 <script src="<?php print DOKU_TPL . 'util.js'; ?>" defer></script> 190 <!--[if ( IE 6 | IE 7 | IE 8 ) ]></div><![endif]--> 191</body> 192</html> 193<?php } /* end of non-pjax footer */ 194