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="dw__toc" id="testTime" data-jw='{ "jokuwiki" : "jwTimeTest", "data" : { "id" : "testTime" }}'></div>
124            <div class="clearer"></div>
125            <hr class="a11y" />
126        </div></div><!-- /header -->
127
128
129        <div class="wrapper">
130
131            <!-- ********** ASIDE ********** -->
132            <?php if ($showSidebar): ?>
133                <div id="dokuwiki__aside"><div class="pad include">
134                    <?php tpl_includeFile('sidebarheader.html') ?>
135                    <?php tpl_include_page($conf['sidebar'], 1, 1) /* includes the nearest sidebar page */ ?>
136                    <?php tpl_includeFile('sidebarfooter.html') ?>
137                    <div class="clearer"></div>
138                </div></div><!-- /aside -->
139            <?php endif; ?>
140
141            <!-- ********** CONTENT ********** -->
142            <div id="dokuwiki__content"><div class="pad">
143                <?php tpl_flush() /* flush the output buffer */ ?>
144                <?php tpl_includeFile('pageheader.html') ?>
145
146                <div class="page">
147                    <!-- wikipage start -->
148                    <?php tpl_content() /* the main content */ ?>
149                    <!-- wikipage stop -->
150                    <div class="clearer"></div>
151                </div>
152
153                <?php tpl_flush() ?>
154                <?php tpl_includeFile('pagefooter.html') ?>
155            </div></div><!-- /content -->
156
157            <div class="clearer"></div>
158            <hr class="a11y" />
159
160            <!-- PAGE ACTIONS -->
161            <?php if ($showTools): ?>
162                <div id="dokuwiki__pagetools">
163                    <h3 class="a11y"><?php echo $lang['page_tools'] ?></h3>
164                    <ul>
165                        <?php
166                            tpl_action('edit', 1, 'li');
167                            _tpl_action('discussion', 1, 'li');
168                            tpl_action('revisions', 1, 'li');
169                            tpl_action('backlink', 1, 'li');
170                            tpl_action('subscribe', 1, 'li');
171                            tpl_action('revert', 1, 'li');
172                            tpl_action('top', 1, 'li');
173                        ?>
174                    </ul>
175                </div>
176            <?php endif; ?>
177        </div><!-- /wrapper -->
178
179        <!-- ********** FOOTER ********** -->
180        <div id="dokuwiki__footer"><div class="pad">
181            <div class="doc"><?php tpl_pageinfo() /* 'Last modified' etc */ ?></div>
182            <?php tpl_license('button') /* content license, parameters: img=*badge|button|0, imgonly=*0|1, return=*0|1 */ ?>
183        </div></div><!-- /footer -->
184        <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
185<?php if ('true'!==$_SERVER['HTTP_X_PJAX']) { ?>
186       </div><!-- pjax container -->
187        <?php tpl_includeFile('footer.html') ?>
188    </div></div><!-- /site -->
189    <script src="<?php print DOKU_TPL . 'jquery.pjax.js'; ?>" defer></script>
190    <script src="<?php print DOKU_TPL . 'util.js'; ?>" defer></script>
191    <!--[if ( IE 6 | IE 7 | IE 8 ) ]></div><![endif]-->
192</body>
193</html>
194<?php } /* end of non-pjax footer */
195