forked from giterlizzi/dokuwiki-template-bootstrap3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtpl_cookielaw.php
executable file
·36 lines (31 loc) · 1.44 KB
/
tpl_cookielaw.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* DokuWiki Bootstrap3 Template: Cookie Law Banner
*
* @link http://dokuwiki.org/template:bootstrap3
* @author Giuseppe Di Terlizzi <[email protected]>
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*/
// must be run from within DokuWiki
if (!defined('DOKU_INC')) die();
if ( bootstrap3_conf('showCookieLawBanner') && ! (get_doku_pref('cookieNoticeAccepted', null) || get_doku_pref('cookieNoticeAccepted', '')) ):
$cookie_policy_page_id = bootstrap3_conf('cookieLawPolicyPage');
$cookie_banner_page_id = bootstrap3_conf('cookieLawBannerPage');
resolve_pageid('', $cookie_policy_page_id, $cookie_policy_page_exists);
?>
<div id="cookieNotice" class="navbar <?php echo ((bootstrap3_conf('inverseNavbar')) ? 'navbar-inverse' : 'navbar-default') ?> navbar-fixed-bottom">
<div class="container">
<div class="navbar-text navbar-left">
<?php
$cookie_banner_page = tpl_include_page($cookie_banner_page_id, 0);
$cookie_banner_page = preg_replace('/<p>\n(.*?)\n<\/p>/', '<i class="fa fa-info-circle text-primary"></i> $1', $cookie_banner_page);
echo $cookie_banner_page;
?>
</div>
<div class="navbar-right">
<button class="btn btn-primary btn-xs navbar-btn" id="cookieDismiss">OK</button>
<?php if ($cookie_policy_page_exists) tpl_link(wl($cookie_policy_page_id), 'Policy', 'class="btn btn-default btn-xs navbar-btn" id="cookiePolicy"') ?>
</div>
</div>
</div>
<?php endif; ?>