1<?php
2/**
3 * DokuWiki Bootstrap3 Template: Cookie Law Banner
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;
11
12if ( $TPL->getConf('showCookieLawBanner') && !get_doku_pref('cookieNoticeAccepted', null) ):
13
14$cookie_policy_page_id = $TPL->getConf('cookieLawPolicyPage');
15$cookie_banner_page_id = $TPL->getConf('cookieLawBannerPage');
16
17$cookie_policy_page_exists = false;
18resolve_pageid('', $cookie_policy_page_id, $cookie_policy_page_exists);
19
20?>
21<!-- cookie-law -->
22<div id="cookieNotice" class="navbar <?php echo (($TPL->getConf('inverseNavbar')) ? 'navbar-inverse' : 'navbar-default') ?> navbar-fixed-bottom">
23    <div class="dw-container container<?php echo ($TPL->isFluidNavbar() ? '-fluid mx-5' : '') ?>">
24        <div class="navbar-text navbar-left">
25            <?php
26                $cookie_banner_page = tpl_include_page($cookie_banner_page_id, 0, 1, $TPL->getConf('useACL'));
27                $cookie_banner_page = preg_replace('/<p>\n(.*?)\n<\/p>/', iconify('mdi:information', array('class' => 'text-primary')) . ' $1', $cookie_banner_page);
28                echo $cookie_banner_page;
29            ?>
30        </div>
31        <div class="navbar-right">
32            <button class="btn btn-primary btn-xs navbar-btn" id="cookieDismiss">OK</button>
33            <?php
34                if ($cookie_policy_page_exists) {
35                    tpl_link(wl($cookie_policy_page_id), 'Policy', 'class="btn btn-default btn-xs navbar-btn" id="cookiePolicy"');
36                }
37            ?>
38        </div>
39    </div>
40</div>
41<!-- /cookie-law -->
42<?php endif; ?>
43