-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.php
42 lines (37 loc) · 1.1 KB
/
plugin.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
37
38
39
40
41
42
<?php
class BaldursPhotographyContetnWarning extends KokenPlugin {
function __construct()
{
$this->require_setup = true;
$this->register_hook('before_closing_body', 'render');
}
function render()
{
$message = $this->data->contentwarning_message;
$dismiss = $this->data->contentwarning_dismiss;
$learnMore = $this->data->contentwarning_learnmore;
$link = $this->data->contentwarning_link;
$theme = $this->data->contentwarning_theme;
$target = $this->data->contentwarning_target;
$cookiedomain = $this->data->contentwarning_domain;
$cookiepath = $this->data->contentwarning_path;
$cookieexp = $this->data->contentwarning_expirydays;
$path = $this->get_path();
echo <<<OUT
<script type="text/javascript">
window.contentwarning_options = {
message: '{$message}',
dismiss: '{$dismiss}',
learnMore: '{$learnMore}',
link: '{$link}',
target: '_{$target}',
theme: '{$path}/styles/{$theme}.css',
domain: '{$cookiedomain}',
path: '{$cookiepath}',
expiryDays: '{$cookieexp}'
}
</script>
<script type="text/javascript" src="{$path}/contentwarning.min.js"></script>
OUT;
}
}