1<?php
2/**
3 * DokuWiki Starter Bootstrap Template
4 *
5 * @link     http://dokuwiki.org/template:starterbootstrap
6 * @author   Cameron Littel <cameron@camlittle.com>
7 */
8
9if (!defined('DOKU_INC')) die(); /* must be run from within DokuWiki */
10@require_once(dirname(__FILE__).'/tpl_functions.php'); /* include hook for template functions */
11
12$showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER['REMOTE_USER'] );
13$showSidebar = (page_findnearest($conf['sidebar']) || $conf['sidebar'] == "automatic") && ($ACT=='show');
14$sidebarCols = (int) tpl_getConf('sidebar_cols');
15$sidebarPos = tpl_getConf('sidebar_pos');
16if ($sidebarCols < 0 || $sidebarCols >= 12) {
17	$sidebarCols = 3;
18}
19
20?><!DOCTYPE html>
21<html xml:lang="<?php echo $conf['lang'] ?>" lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>" class="no-js">
22<head>
23    <meta charset="UTF-8" />
24    <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><![endif]-->
25    <title>
26        <?php tpl_pagetitle() ?>
27        [<?php echo strip_tags($conf['title'])?>]
28    </title>
29    <?php @require_once(dirname(__FILE__).'/head-css.php'); ?>
30<?php
31$brandImg = tpl_getConf('header_img');
32if ($brandImg == '') {
33    $brandImg = $DOKU_INC . 'brand.png';
34    if (!file_exists($brandImg)) $brandImg = $DOKU_INC . 'brand.jpg';
35    if (!file_exists($brandImg)) $brandImg = '';
36}
37if ($brandImg != ''):
38    $brandImgHeight = tpl_getConf('header_height');
39    if ($brandImgHeight && ctype_digit($brandImgHeight)) $brandImgHeight .= 'px';
40    if ($brandImgHeight == '') $brandImgHeight = 'auto';
41    $brandImgMargin = tpl_getConf('header_padding');
42    if ($brandImgMargin == '') {
43        $brandImgMargin = '8';
44    }
45    if (ctype_digit($brandImgMargin)) $brandImgMargin .= 'px';
46?>
47    <style>
48        .navbar-brand-img {
49            box-sizing: content-box;
50            padding-top: <?php echo $brandImgMargin; ?>;
51            padding-bottom: <?php echo $brandImgMargin; ?>;
52            <?php if ($brandImgHeight) { echo 'height: ', $brandImgHeight, ';\n'; } ?>
53        }
54    </style>
55<?php endif; ?>
56</head>
57
58<body data-spy="scroll" data-target="#dw_toc">
59    <?php /* with these Conditional Comments you can better address IE issues in CSS files,
60             precede CSS rules by #IE6 for IE6, #IE7 for IE7 and #IE8 for IE8 (div closes at the bottom) */ ?>
61    <!--[if IE 6 ]><div id="IE6"><![endif]--><!--[if IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]-->
62
63    <?php /* the "dokuwiki__top" id is needed somewhere at the top, because that's where the "back to top" button/link links to */ ?>
64    <?php /* classes mode_<action> are added to make it possible to e.g. style a page differently if it's in edit mode,
65         see http://www.dokuwiki.org/devel:action_modes for a list of action modes */ ?>
66    <?php /* .dokuwiki should always be in one of the surrounding elements (e.g. plugins and templates depend on it) */ ?>
67    <div id="dokuwiki__site" ><div id="dokuwiki__top"
68        class="dokuwiki site mode_<?php echo $ACT ?> <?php echo ($showSidebar) ? 'hasSidebar' : '' ?>">
69        <div class="navbar navbar-default navbar-fixed-top">
70            <?php tpl_includeFile('header.html') ?>
71            <div class="navbar-header">
72                <button class="navbar-toggle" data-toggle="collapse" data-target="#topnav" type="button">
73                    <span class="sr-only">Toggle Navigation</span>
74                    <span class="icon-bar"></span>
75                    <span class="icon-bar"></span>
76                    <span class="icon-bar"></span>
77                </button>
78                <?php if ($brandImg != '') { ?>
79                    <a class="navbar-brand-img navbar-brand" href="<?php echo $DOKU_URL; ?>"><img src="<?php echo $brandImg; ?>" alt="<?php $conf['title'] ?>"></a>
80                <?php } ?>
81                <?php if ($brandImg == '' || tpl_getConf('header_title')) {
82                tpl_link(wl(),$conf['title'],'accesskey="h" title="[H]" class="navbar-brand"');
83                } ?>
84            </div>
85            <div class="navbar-collapse collapse" id="topnav">
86                <ul class="nav navbar-nav navbar-right">
87                    <?php if ($showTools): ?>
88                        <?php tpl_action('edit', 1, 'li'); ?>
89                    <?php endif; ?>
90                    <li class="dropdown">
91                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $lang['tools']; ?> <b class="caret"></b></a>
92                        <ul class="dropdown-menu">
93                            <li class="dropdown-header"><?php echo $lang['page_tools'] ?></li>
94                            <?php
95                                tpl_action('edit', 1, 'li');
96                                if ($ACT == 'revisions') { tpl_action('revisions', 1, 'li class="active"'); } else { tpl_action('revisions', 1, 'li'); };
97                                if ($ACT == 'backlink') { tpl_action('backlink', 1, 'li class="active"'); } else { tpl_action('backlink', 1, 'li'); };
98                                tpl_action('subscribe', 1, 'li');
99                                tpl_action('revert', 1, 'li');
100                            ?>
101                            <li class="dropdown-header"><?php echo $lang['site_tools'] ?></li>
102                            <?php if ($showTools): ?>
103                            <?php
104                                if ($ACT == 'recent') { tpl_action('recent', 1, 'li class="active"'); } else { tpl_action('recent', 1, 'li'); };
105                                if ($ACT == 'index') { tpl_action('index', 1, 'li class="active"'); } else { tpl_action('index', 1, 'li'); };
106                                if ($ACT == 'media') { tpl_action('media', 1, 'li class="active"'); } else { tpl_action('media', 1, 'li'); };
107                                if ($ACT == 'admin') { tpl_action('admin', 1, 'li class="active"'); } else { tpl_action('admin', 1, 'li'); };
108                            ?>
109                            <?php endif ?>
110                            <?php if ($conf['useacl'] && $showTools): ?>
111                            <li class="dropdown-header"><?php echo $lang['user_tools'] ?></li>
112                            <?php
113                                if ($ACT == 'profile') { tpl_action('profile', 1, 'li class="active"'); } else { tpl_action('profile', 1, 'li'); };
114                                if ($ACT == 'login') { tpl_action('login', 1, 'li class="active"'); } else { tpl_action('login', 1, 'li'); };
115                            ?>
116                            <?php endif; ?>
117                            <li class="divider"></li>
118                            <?php /* the optional second parameter of tpl_action() switches between a link and a button,
119                             e.g. a button inside a <li> would be: tpl_action('edit', 0, 'li') */
120                                tpl_action('top', 1, 'li');
121                            ?>
122                        </ul>
123                    </li>
124                </ul>
125
126                <?php _tpl_searchform() ?>
127            </div>
128        </div>
129
130        <div class="container<?php if ((int) tpl_getConf('full_width') === 1) { echo "-fluid"; } ?> not-header">
131            <div class="notifications hidden-print">
132                <?php html_msgarea() /* occasional error and info messages on top of the page */ ?>
133            </div>
134
135            <a href="#dokuwiki__content" class="sr-only hidden-print"><?php echo $lang['skip_to_content']; ?></a>
136            <a href="#dokuwiki__aside" class="skip-to-sidebar hidden-print visible-xs btn-block btn btn-info"><?php echo "Skip to Navigation"; // echo $lang['skip_to_nav']; ?></a>
137
138            <?php if($conf['breadcrumbs']) _tpl_breadcrumbs(); ?>
139
140            <?php
141                $sidebar_contents = "";
142                if ($conf['sidebar'] == 'automatic') {
143                    $sidebar_contents = "automatic";
144                } else {
145                    $sidebar_contents = bootstrap_tpl_get_sidebar($conf['sidebar'], false);
146                }
147            ?>
148
149            <section class="wrapper row"><!-- PAGE ACTIONS -->
150                <!-- ********** CONTENT ********** -->
151                <div id="dokuwiki__content" class="<?php
152                    if ($ACT == 'show' && $sidebar_contents != ""):
153                        ?>col-sm-<?php echo 12 - $sidebarCols; ?><?php
154                        if ($sidebarPos == "Left"):
155                            ?> col-sm-push-<?php echo $sidebarCols; ?> <?php
156                        endif; ?><?php
157                    else: ?>col-xs-12<?php
158                    endif; ?>">
159                    <?php if($conf['youarehere']){ ?>
160                        <div class="youarehere">
161                            <?php bootstrap_tpl_youarehere() ?>
162                        </div>
163                    <?php } ?>
164
165                    <?php tpl_flush() /* flush the output buffer */ ?>
166                    <?php tpl_includeFile('pageheader.html') ?>
167
168                    <?php _tpl_toc(); ?>
169                    <div class="page" role="main">
170                    <!-- wikipage start -->
171                        <?php
172                        if ($ID == "starterbootstrap:index" && auth_quickaclcheck($id) > AUTH_CREATE) {
173                            include_once("generate_index.php");
174                        } else {
175                            tpl_content(false); /* the main content */
176                        }
177                        ?>
178                    <!-- wikipage stop -->
179                    </div>
180
181                    <?php tpl_includeFile('pagefooter.html') ?>
182                </div><!-- /content -->
183
184                <!-- ********** ASIDE ********** -->
185                <?php if ($ACT == 'show'): ?>
186                <aside id="dokuwiki__aside" class="col-sm-<?php echo $sidebarCols; ?><?php
187                    if ($sidebarPos == "Left"):
188                        ?> col-sm-pull-<?php echo 12 - $sidebarCols; ?><?php
189                    endif; ?>">
190                    <?php if ($showSidebar && $sidebarCols > 0): ?>
191                    <div class="sidebar-page">
192                        <?php
193                            tpl_includeFile('sidebarheader.html');
194                            if ($conf['sidebar'] == "automatic") {
195                                include_once("generate_index.php");
196                            } else {
197                                echo $sidebar_contents;
198                            }
199                            tpl_includeFile('sidebarfooter.html');
200                        ?>
201                    </div>
202                    <?php endif; ?>
203                </aside><!-- /aside -->
204                <?php endif; ?>
205            </section><!-- /wrapper -->
206
207            <!-- ********** FOOTER ********** -->
208            <footer id="dokuwiki__footer" class="hidden-print">
209                <ul class="doc breadcrumb pull-right">
210                    <li><?php tpl_action('top', 1, ''); ?></li>
211                    <li><?php tpl_pageinfo() /* 'Last modified' etc */ ?></li>
212                </ul>
213                <?php tpl_license('button') /* content license, parameters: img=*badge|button|0, imgonly=*0|1, return=*0|1 */ ?>
214            </footer><!-- /footer -->
215
216            <?php tpl_includeFile('footer.html') ?>
217        </div>
218
219    </div></div><!-- /site -->
220
221    <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
222    <!--[if ( IE 6 | IE 7 | IE 8 ) ]></div><![endif]-->
223
224    <?php @require_once(dirname(__FILE__).'/tail-js.php'); ?>
225</body>
226</html>
227