1<?php
2/**
3 * DokuWiki Bootstrap3 Template: Theme Switcher
4 *
5 * @link     http://dokuwiki.org/template:bootstrap3
6 * @author   Giuseppe Di Terlizzi <giuseppe.diterlizzi@gmail.com>
7 * @license  GPL 2 (http://www.gnu.org/licenses/gpl.html)
8 */
9
10global $TPL, $ID;
11
12$bootswatch_theme = $TPL->getBootswatchTheme();
13
14?>
15<!-- theme-switcher -->
16<ul class="nav navbar-nav" id="dw__themes">
17    <li class="dropdown">
18
19        <a href="<?php wl($ID) ?>" class="dropdown-toggle" data-toggle="dropdown" data-target="#" role="button" aria-haspopup="true" aria-expanded="false">
20            <?php echo iconify('mdi:palette'); ?> <span class="<?php echo (in_array('themes', $TPL->getConf('navbarLabels')) ? '' : 'hidden-lg hidden-md hidden-sm') ?>"><?php echo tpl_getLang('themes') ?></span> <span class="caret"></span>
21        </a>
22
23        <ul class="dropdown-menu" aria-labelledby="themes">
24            <li class="dropdown-header">
25                <?php echo iconify('mdi:palette'); ?> <?php echo tpl_getLang('themes') ?>
26            </li>
27            <li<?php echo ($bootswatch_theme == 'default') ? ' class="active"' : '' ?>>
28                <a onclick="DokuCookie.setValue('bootswatchTheme', '<?php echo hsc('default'); ?>'); document.location.reload(true)" href="#">Default</a>
29            </li>
30            <li class="dropdown-header">
31                <?php echo iconify('mdi:palette'); ?> Bootswatch Themes
32            </li>
33            <?php foreach ($TPL->getAvailableBootswatchThemes() as $theme): ?>
34            <li<?php echo ($bootswatch_theme == $theme) ? ' class="active"' : '' ?>>
35                <a onclick="DokuCookie.setValue('bootswatchTheme', '<?php echo hsc($theme); ?>'); document.location.reload(true)" href="#"><?php echo ucfirst($theme) ?></a>
36            </li>
37            <?php endforeach; ?>
38        </ul>
39
40    </li>
41</ul>
42<!-- /theme-switcher -->
43