|
10 | 10 |
|
11 | 11 | use FriendsOfRedaxo\ConsentManager\Frontend; |
12 | 12 |
|
| 13 | +$addon = rex_addon::get('consent_manager'); |
13 | 14 | $consent_manager = new Frontend(0); |
14 | 15 | if (is_string(rex_request::server('HTTP_HOST'))) { |
15 | 16 | $consent_manager->setDomain(rex_request::server('HTTP_HOST')); |
16 | 17 | } |
17 | 18 | if (0 === count($consent_manager->texts)) { |
18 | | - echo '<div id="consent_manager-background">' . rex_view::error(rex_addon::get('consent_manager')->i18n('consent_manager_error_noconfig')) . '</div>'; |
| 19 | + echo '<div id="consent_manager-background">' . rex_view::error($addon->i18n('consent_manager_error_noconfig')) . '</div>'; |
19 | 20 | return; |
20 | 21 | } |
21 | 22 |
|
22 | 23 | // Check for CSS Framework Mode |
23 | | -$cssFrameworkMode = rex_addon::get('consent_manager')->getConfig('css_framework_mode'); |
| 24 | +$cssFrameworkMode = $addon->getConfig('css_framework_mode'); |
24 | 25 | if ($cssFrameworkMode) { |
25 | 26 | echo $this->parse('ConsentManager/box_' . $cssFrameworkMode . '.php'); |
26 | 27 | return; |
27 | 28 | } |
28 | 29 |
|
29 | 30 | if (0 < count($consent_manager->cookiegroups)) : ?> |
30 | 31 | <div tabindex="-1" class="consent_manager-background consent_manager-hidden <?= $consent_manager->boxClass ?>" id="consent_manager-background" data-domain-name="<?= $consent_manager->domainName ?>" data-version="<?= $consent_manager->version ?>" data-consentid="<?= uniqid('', true) ?>" data-cachelogid="<?= $consent_manager->cacheLogId ?>" data-nosnippet aria-hidden="true"> |
| 32 | + <?php |
| 33 | + // Inline-CSS nur ausgeben wenn kein Framework-Modus und kein eigenes CSS aktiv ist |
| 34 | + if ('' === $cssFrameworkMode && false === $addon->getConfig('outputowncss', false)) : |
| 35 | + ?> |
31 | 36 | <style nonce="<?= rex_response::getNonce() ?>"> |
32 | 37 | #consent_manager-background { |
33 | | - <?php if (rex_addon::get('consent_manager')->getConfig('backdrop', '1') === '0'): ?> |
| 38 | + <?php if ($addon->getConfig('backdrop', '1') === '0'): ?> |
34 | 39 | background: transparent !important; |
35 | 40 | pointer-events: none !important; |
36 | 41 | <?php endif; ?> |
|
39 | 44 | max-height: 90vh !important; |
40 | 45 | overflow-y: auto !important; |
41 | 46 | border-radius: 0 !important; |
42 | | - <?php if (rex_addon::get('consent_manager')->getConfig('backdrop', '1') === '0'): ?> |
| 47 | + <?php if ($addon->getConfig('backdrop', '1') === '0'): ?> |
43 | 48 | pointer-events: auto !important; |
44 | 49 | box-shadow: 0 0 20px rgba(0,0,0,0.2) !important; |
45 | 50 | background: #fff !important; |
|
69 | 74 | opacity: 1; |
70 | 75 | } |
71 | 76 | </style> |
| 77 | + <?php endif; ?> |
72 | 78 | <div class="consent_manager-wrapper" id="consent_manager-wrapper" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="consent_manager-headline"> |
73 | 79 | <div class="consent_manager-header"> |
74 | | - <p class="consent_manager-headline" id="consent_manager-headline" style="margin:0; font-weight:bold; color: inherit;"><?= $consent_manager->texts['headline'] ?></p> |
| 80 | + <p class="consent_manager-headline" id="consent_manager-headline"<?php if ('' === $cssFrameworkMode && false === $addon->getConfig('outputowncss', false)) : ?> style="margin:0; font-weight:bold; color: inherit;"<?php endif; ?>><?= $consent_manager->texts['headline'] ?></p> |
75 | 81 | <button class="consent_manager-close" aria-label="Close" type="button">×</button> |
76 | 82 | </div> |
77 | 83 | <div class="consent_manager-wrapper-inner"> |
|
0 commit comments