xref: /template/minimal/main.php (revision 8a9ebc75d305f244f2bb2a543d058909b6a44eae)
1<?php
2/**
3 * DokuWiki Minimal Template
4 *
5 * @link     http://dokuwiki.org/template:minimal
6 * @author   Reactive Matter <reactivematter@protonmail.com>
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
12@require_once(dirname(__FILE__).'/template_plugin.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?>
17
18<!DOCTYPE html>
19<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang'] ?>"
20  lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>" class="no-js">
21<head>
22    <meta charset="UTF-8" />
23    <title><?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title']) ?>]</title>
24    <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
25    <?php tpl_metaheaders() ?>
26    <meta name="viewport" content="width=device-width,initial-scale=1" />
27    <?php echo tpl_favicon(array('favicon', 'mobile')) ?>
28    <?php tpl_includeFile('meta.html') ?>
29</head>
30
31<?php
32
33?>
34<body class="<?=tpl_minimal_classes()?>">
35<div id="dokuwiki__top"></div>
36<navbar id="navbar" class="container" role="navigation" aria-label="Main navigation">
37        <?php
38        if(!$showSidebar){$s1 = "style=visibility:hidden";}
39        else {$s1="";}
40        ?>
41        <div id='showhidesidemenu' class="mobile icon" <?=$s1?>>
42            <div class="button"></div>
43        </div>
44        <div class="left-column">
45        <a class="site-name" href="<?=DOKU_BASE?>">
46        <div class="site-logo">
47            <img src="<?=tpl_getMediaFile(array(':wiki:logo.png', ':wiki:logo.svg', ':wiki:logo.jpeg',':wiki:logo.jpg',  ':logo.png', ':logo.svg', ':logo.jpeg',':logo.jpg', 'images/logo.png', ':wiki:dokuwiki.svg'), false)?>">
48        </div>
49        <div class="site-title">
50            <?=$conf['title']?>
51        </div>
52        </a>
53        </div>
54        <?php if($showTools || actionOK('search')):?>
55        <div class="right-column">
56        <?php if($showTools):?>
57        <div class="options">
58            <?php if(sizeof((new \dokuwiki\Menu\PageMenu())->getItems())>0):?>
59            <div class="page-menu menu">
60                <div class="button"><span><?=tpl_getLang('page')?></span></div>
61                  <div class="list">
62                <?=(new \dokuwiki\Menu\PageMenu())->getListItems()?>
63                </div>
64            </div>
65            <?php endif?>
66            <?php if(sizeof((new \dokuwiki\Menu\SiteMenu())->getItems())>0):?>
67            <div class="site-menu menu">
68                <div class="button"><span><?=tpl_getLang('site')?></span></div>
69                  <div class="list">
70                  <?=(new \dokuwiki\Menu\SiteMenu())->getListItems()?>
71                </div>
72            </div>
73            <?php endif?>
74            <?php if(sizeof((new \dokuwiki\Menu\UserMenu())->getItems())>0):?>
75            <div class="user-menu menu">
76            <div class="button"><span><?=tpl_getLang('user')?></span></div>
77            <div class="list">
78                <?php if($USERINFO):?>
79                <div class="user-name"><?=$USERINFO['name']?></div>
80                <?php endif?>
81                <?=(new \dokuwiki\Menu\UserMenu())->getListItems()?>
82            </div>
83            </div>
84            <?php endif?>
85            <div class="mobile-menu menu">
86            <?php
87
88            if(sizeof((new \dokuwiki\Menu\PageMenu())->getItems())>0)
89                {
90                    echo '<div class="list"><p>'.tpl_getLang('page').' '.tpl_getLang('tools').'</p>'.
91                    (new \dokuwiki\Menu\PageMenu())->getListItems()
92                    .'</div>';
93                }
94
95               if(sizeof((new \dokuwiki\Menu\SiteMenu())->getItems())>0)
96               {
97                    echo '<div class="list"><p>'.tpl_getLang('site').' '.tpl_getLang('tools').'</p>'.
98                    (new \dokuwiki\Menu\SiteMenu())->getListItems()
99                    .'</div>';
100               }
101
102               if(sizeof((new \dokuwiki\Menu\UserMenu())->getItems())>0)
103               {
104                   echo '<div class="list"><p>'.tpl_getLang('user').' '.tpl_getLang('tools').'</p>'.
105                   (new \dokuwiki\Menu\UserMenu())->getListItems()
106                   .'</div>';
107               }
108
109               if($USERINFO){
110                 echo '<div class="user-name"><p>Username: '.$USERINFO['name'].'</p></div>';
111               }
112
113            ?>
114            </div>
115        </div>
116        <?php endif?>
117        <?php if(actionOK('search')):?>
118        <div class="search">
119            <?php tpl_searchform(true,false) ?>
120        </div>
121        <?php endif?>
122        </div>
123        <?php
124        if(!$showTools){$s2 = "style=visibility:hidden";}
125        else {$s2="";}
126        ?>
127        <div id='showhideappoptions' class="mobile icon" <?=$s2?>>
128            <div class="button"></div>
129        </div>
130     <?php endif?>
131    </navbar>
132
133    <div style="margin-top: 8px;">
134    <?php html_msgarea() /* occasional error and info messages on top of the page */ ?>
135    </div>
136    <!-- ********** Notice ********** -->
137
138    <?php if(($conf['youarehere'] || $conf['breadcrumbs'] || (page_exists("header") && auth_quickaclcheck("header")) ) && tpl_getConf('siteHeaderPosition')=='Top'):?>
139
140    <div class="site-header">
141
142    <?php
143        if(page_exists("header") && auth_quickaclcheck("header"))
144        {
145            echo '<div class="site-header-content">';
146            tpl_include_page('header');
147            echo '</div>';
148        }
149    ?>
150
151    <?php if($conf['youarehere'] || $conf['breadcrumbs']):?>
152
153    <div class="site-navigation">
154        <!-- BREADCRUMBS -->
155        <?php if($conf['youarehere']){ ?>
156            <div class="breadcrumbs"><?php tpl_youarehere() ?></div>
157        <?php } ?>
158        <?php if($conf['breadcrumbs']){ ?>
159            <div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div>
160        <?php } ?>
161    </div>
162    <?php endif?>
163
164    </div>
165
166    <?php endif?>
167
168
169
170<main id="main">
171
172        <?php if ($showSidebar): ?>
173            <div id="sidebar" class="left-column" aria-label="<?php echo $lang['sidebar'] ?>">
174                <div class="sidebar-content">
175                <?php tpl_include_page($conf['sidebar'], 1, 1) /* includes the nearest sidebar page */ ?>
176            </div>
177            </div>
178        <?php endif; ?>
179
180
181        <div id="view" class="right-column">
182
183                <?php if(($conf['youarehere'] || $conf['breadcrumbs'] || (page_exists("header") && auth_quickaclcheck("header"))) && tpl_getConf('siteHeaderPosition')=='Above page'):?>
184                <div class="site-header">
185                <?php html_msgarea() /* occasional error and info messages on top of the page */ ?>
186                <!-- ********** Notice ********** -->
187                <?php
188                    if(page_exists("header") && auth_quickaclcheck("header"))
189                    {
190                        echo '<div class="site-header-content">';
191                        tpl_include_page('header');
192                        echo '</div>';
193                    }
194                ?>
195
196                <?php if($conf['youarehere'] || $conf['breadcrumbs']):?>
197
198                <div class="site-navigation">
199                    <!-- BREADCRUMBS -->
200                    <?php if($conf['youarehere']){ ?>
201                        <div class="breadcrumbs"><?php tpl_youarehere() ?></div>
202                    <?php } ?>
203                    <?php if($conf['breadcrumbs']){ ?>
204                        <div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div>
205                    <?php } ?>
206                </div>
207                <?php endif?>
208                </div>
209                <?php endif?>
210
211        <article id="content">
212            <?php tpl_flush(); ?>
213            <?php tpl_content();?>
214            <?php tpl_flush(); ?>
215        </article>
216
217
218        <?php if(tpl_getConf('showPageInfo') ):?>
219         <div class="page-info">
220                <?php tpl_pageinfo() /* 'Last modified' etc */ ?>
221
222        </div>
223        <?php endif; ?>
224
225
226        <?php
227        if((page_exists("footer") && auth_quickaclcheck("footer")) && tpl_getConf('siteFooterPosition')=='Below page')
228        {
229            echo '<footer id="footer">';
230            tpl_include_page('footer');
231            echo '</footer>';
232        }
233        ?>
234        <!-- /footer -->
235        <div style="display: none;"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
236    </div>
237    </main>
238        <?php
239    if((page_exists("footer") && auth_quickaclcheck("footer")) && tpl_getConf('siteFooterPosition')=='Bottom')
240    {
241        echo '<footer id="footer">';
242        tpl_include_page('footer');
243        echo '</footer>';
244    }
245    ?>
246</body>
247</html>
248