-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_config.php
More file actions
48 lines (40 loc) · 1.89 KB
/
_config.php
File metadata and controls
48 lines (40 loc) · 1.89 KB
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
43
44
45
46
47
<?php
use SilverStripe\SiteConfig\SiteConfig;
use SilverStripe\View\Parsers\ShortcodeParser;
ShortcodeParser::get('default')->register('cookiedeclaration',
function ($arguments, $content = null, $parser = null, $tagName = null) {
$config = SiteConfig::current_site_config();
if (!empty($config->CookiebotId)) {
return '<script id="CookieDeclaration" src="https://consent.cookiebot.com/' . $config->CookiebotId . '/cd.js" type="text/javascript" async></script>';
}
if (!empty($config->ClickskeksApiKey)) {
return '<div class="ccm-cookie-declaration">Bitte aktivieren Sie Javascript, um die Liste aller deklarierten Cookies und ähnlicher Techniken zu sehen.</div>';
}
return '';
}
);
ShortcodeParser::get('default')->register(
'cookiebot',
function ($arguments, $content = null, $parser = null, $tagName = null) {
$content = (empty($content)) ? 'Cookie Zustimmungsänderung' : $content;
return sprintf(
"<a href=\"javascript:Cookiebot.renew();\">%s</a>",
$content
);
}
);
ShortcodeParser::get('default')->register('youtube',
function ($arguments, $content = null, $parser = null, $tagName = null) {
if (empty($arguments['id'])) {
return '[youtube] shortcode fehlt die ID des Films [youtube,id="dieYoutubeId"]';
}
$youtubeID = htmlspecialchars($arguments['id']);
return sprintf(
'<iframe data-cookieconsent="marketing" data-src="https://www.youtube-nocookie.com/embed/%1$s?rel=0"></iframe>' .
'<div class="cookieconsent-optout-marketing">
<p>Bitte lassen Sie <a href="javascript:Cookiebot.renew()">Cookies</a> zu, um das Youtube Video anzuzeigen.</p>
<p>Oder schauen Sie es <a target="_blank" href="https://www.youtube.com/watch?v=%1$s">hier direkt auf Youtube</a> an.</p>
</div>',
$youtubeID);
}
);