├── .gitignore ├── pages ├── index.php ├── help.readme.php ├── help.templates.php ├── global_configuration.php ├── configuration_test.php └── configuration.php ├── assets ├── css │ ├── cookie_consent_backend.css │ ├── cookie_consent_insites_clean.css │ └── cookie_consent_insites.css └── js │ ├── cookie_consent_backend.js │ └── cookie_consent_insites.js ├── docs └── templates.md ├── install.php ├── LICENSE ├── package.yml ├── boot.php ├── .travis.yml ├── .php_cs.dist ├── update.php ├── README.md ├── lang ├── en_gb.lang ├── sv_se.lang ├── es_es.lang └── de_de.lang └── lib └── cookie_consent.php /.gitignore: -------------------------------------------------------------------------------- 1 | .php_cs.cache -------------------------------------------------------------------------------- /pages/index.php: -------------------------------------------------------------------------------- 1 | parse($file); 5 | $fragment = new rex_fragment(); 6 | $fragment->setVar('body', $body, false); 7 | $content = $fragment->parse('core/page/section.php'); 8 | echo $content; 9 | -------------------------------------------------------------------------------- /pages/help.templates.php: -------------------------------------------------------------------------------- 1 | parse($file); 5 | $fragment = new rex_fragment(); 6 | $fragment->setVar('body', $body, false); 7 | $content = $fragment->parse('core/page/section.php'); 8 | echo $content; 9 | -------------------------------------------------------------------------------- /assets/css/cookie_consent_backend.css: -------------------------------------------------------------------------------- 1 | .rex-form-group:not(.rex-form-group-vertical).cookie_consent_display_none, 2 | .cookie_consent_display_none { 3 | display: none; 4 | } 5 | .cookie_consent_display { 6 | display: inline-block; 7 | } 8 | .mode_notice { 9 | display: none; 10 | } 11 | .mode_optin_notice { 12 | display: none; 13 | } 14 | label[for=embed_auto] { 15 | margin-top: 20px; 16 | } -------------------------------------------------------------------------------- /docs/templates.md: -------------------------------------------------------------------------------- 1 | 2 | # Vorlagen 3 | 4 | ## Javascript Callbacks 5 | 6 | Diese Beispiele können in der Konfiguration in das Feld "Benutzerdefinierte Optionen" eingegeben werden. 7 | Weitere Infos zu Javascript-Callbacks [hier](https://cookieconsent.insites.com/documentation/javascript-api/) 8 | 9 | ### Seite neuladen 10 | Wenn der Cookie-Banner bestätigt wurde, wird die Seite neu geladen. Hierdurch können serverseitig weitere Inhalte (Skripte, Marketing-Tools, etc.) eingebunden werden. 11 | 12 | ###### Konfigurationscode 13 | ``` 14 | onStatusChange: function(status, chosenBefore) { 15 | if(status === "allow") { 16 | location.reload(); 17 | } 18 | } 19 | ``` 20 | 21 | ###### PHP-Code 22 | ``` 23 | if (cookie_consent::getStatus() === cookie_consent::COOKIE_ALLOW) { 24 | // Ausgabe von zusätzlichen Skripten, Marketing-Tools 25 | } 26 | ``` -------------------------------------------------------------------------------- /install.php: -------------------------------------------------------------------------------- 1 | hasConfig()) { 4 | $this->setConfig('color_background', ''); 5 | $this->setConfig('color_main_content', ''); 6 | $this->setConfig('color_button_background', ''); 7 | $this->setConfig('color_button_content', ''); 8 | $this->setConfig('position', 'top'); 9 | $this->setConfig('main_message', 'This website uses cookies to ensure you get the best experience on our website '); 10 | $this->setConfig('button_content', 'Accept'); 11 | $this->setConfig('link_content', 'Privacy Policy'); 12 | $this->setConfig('eLink', ''); 13 | $this->setConfig('iLink', ''); 14 | $this->setConfig('script_checkbox', ''); 15 | $this->setConfig('theme', 'classic'); 16 | $this->setConfig('color_scheme', 'custom'); 17 | $this->setConfig('mode', 'info'); 18 | $this->setConfig('allow_content', 'Allow cookies'); 19 | $this->setConfig('deny_content', 'Decline'); 20 | } 21 | 22 | $somethingIsWrong = false; 23 | if ($somethingIsWrong) { 24 | throw new rex_functional_exception('Something is wrong'); 25 | } 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Friends Of REDAXO 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /package.yml: -------------------------------------------------------------------------------- 1 | package: cookie_consent 2 | version: '3.0.0-beta3' 3 | author: Friends Of REDAXO 4 | supportpage: https://github.com/FriendsOfREDAXO/cookie_consent 5 | 6 | # Seiten 7 | page: 8 | title: 'Cookie Consent' 9 | icon: rex-icon fa-empire 10 | perm: cookie_consent[] 11 | subpages: 12 | configuration: 13 | title: 'translate:configuration' 14 | icon: rex-icon fa-cogs 15 | global_configuration: 16 | title: 'translate:global_configuration' 17 | icon: rex-icon fa-cog 18 | configuration_test: 19 | title: 'translate:configuration_test' 20 | icon: rex-icon fa-eercast 21 | help: 22 | title: 'translate:help' 23 | icon: rex-icon fa-wrench 24 | subpages: 25 | readme: 26 | title: 'translate:help' 27 | templates: 28 | title: 'translate:templates' 29 | 30 | 31 | requires: 32 | redaxo: '^5.1' 33 | 34 | installer_ignore: 35 | - .gitignore 36 | - .php_cs.dist 37 | - .travis.yml 38 | -------------------------------------------------------------------------------- /boot.php: -------------------------------------------------------------------------------- 1 | getAssetsUrl('css/cookie_consent_backend.css')); 9 | rex_view::addJsFile($this->getAssetsUrl('js/cookie_consent_backend.js')); 10 | } 11 | 12 | if (!rex::isBackend()) { 13 | rex_extension::register('PACKAGES_INCLUDED', function ($params) { 14 | if (rex_config::get('cookie_consent', cookie_consent::getKeyPrefix().'embed_auto') == '1') { 15 | rex_extension::register('OUTPUT_FILTER', 'cookie_consent::ep_call', rex_extension::LATE); 16 | } 17 | 18 | rex_extension::register(['FE_OUTPUT', 'OUTPUT_FILTER'], function () { 19 | if (cookie_consent::getMode() === cookie_consent::MODE_OPT_IN && !cookie_consent::hasUserSession()) { 20 | rex_extension::register('OUTPUT_FILTER', 'cookie_consent::ep_optin', rex_extension::LATE); 21 | } 22 | }, rex_extension::EARLY); 23 | }); 24 | } 25 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | sudo: false 4 | 5 | git: 6 | depth: 3 7 | 8 | branches: 9 | only: 10 | - master 11 | 12 | cache: 13 | directories: 14 | - $HOME/.php-cs-fixer 15 | - $HOME/.composer/cache 16 | 17 | before_install: 18 | - phpenv config-rm xdebug.ini || echo "xdebug not available" 19 | 20 | jobs: 21 | include: 22 | - php: 7.3 23 | env: LINTING=1 24 | script: if find . -name "*.php" ! -path "*/vendor/*" -exec php -l {} 2>&1 \; | grep "syntax error, unexpected"; then exit 1; fi 25 | 26 | - php: 7.3 27 | env: CODING_STANDARDS=1 28 | install: 29 | - mkdir -p "$HOME/.php-cs-fixer" 30 | # CS_FIXER_VERSION defined via travisci web interface 31 | - "echo '{\"require\": {\"friendsofphp/php-cs-fixer\": \"'$CS_FIXER_VERSION'\"}}' > \"$HOME/.php-cs-fixer/composer.json\"" 32 | - travis_retry composer update --no-interaction --working-dir "$HOME/.php-cs-fixer" 33 | script: php "$HOME/.php-cs-fixer/vendor/bin/php-cs-fixer" fix --cache-file "$HOME/.php-cs-fixer/.php_cs.cache" --dry-run --diff --verbose 34 | -------------------------------------------------------------------------------- /.php_cs.dist: -------------------------------------------------------------------------------- 1 | in([__DIR__]); 4 | return PhpCsFixer\Config::create() 5 | ->setUsingCache(true) 6 | ->setRiskyAllowed(true) 7 | ->setRules([ 8 | '@Symfony' => true, 9 | '@Symfony:risky' => true, 10 | 'array_indentation' => true, 11 | 'array_syntax' => ['syntax' => 'short'], 12 | 'blank_line_before_statement' => false, 13 | 'braces' => ['allow_single_line_closure' => false], 14 | 'concat_space' => false, 15 | 'function_to_constant' => ['functions' => ['get_class', 'get_called_class', 'php_sapi_name', 'phpversion', 'pi']], 16 | 'heredoc_to_nowdoc' => true, 17 | 'logical_operators' => true, 18 | 'native_constant_invocation' => false, 19 | 'no_blank_lines_after_phpdoc' => false, 20 | 'no_php4_constructor' => true, 21 | 'no_superfluous_elseif' => true, 22 | 'no_unneeded_final_method' => false, 23 | 'no_unreachable_default_argument_value' => true, 24 | 'no_useless_else' => true, 25 | 'no_useless_return' => true, 26 | 'phpdoc_annotation_without_dot' => false, 27 | 'phpdoc_no_package' => false, 28 | 'phpdoc_to_comment' => false, 29 | 'phpdoc_trim_consecutive_blank_line_separation' => true, 30 | 'phpdoc_types_order' => false, 31 | 'phpdoc_var_without_name' => false, 32 | 'psr4' => false, 33 | 'semicolon_after_instruction' => false, 34 | 'space_after_semicolon' => true, 35 | 'string_line_ending' => true, 36 | 'yoda_style' => false, 37 | ]) 38 | ->setFinder($finder); 39 | -------------------------------------------------------------------------------- /update.php: -------------------------------------------------------------------------------- 1 | getCode().'_'; 9 | $yrewrite = rex_addon::get('yrewrite'); 10 | if (rex_addon::exists('yrewrite') && $yrewrite->isInstalled() && rex_string::versionCompare($yrewrite->getVersion(), '2.3', '>=')) { 11 | rex_yrewrite::init(); 12 | $domain = rex_yrewrite::getCurrentDomain(); 13 | if (!$domain) { 14 | $domain = rex_yrewrite::getDefaultDomain(); 15 | } 16 | $prefix .= $domain->getId(); 17 | } 18 | $prefix .= '_'; 19 | 20 | $configs = $this->getConfig(); 21 | foreach ($configs as $key => $value) { 22 | if (strpos($key, $prefix) !== 0 && strpos($key, 'global_') === false) { 23 | // multilanguage update needed 24 | 25 | $this->removeConfig($key); 26 | if (strpos($key, 'cookiedingsbums_') === 0) { 27 | $key = str_replace('cookiedingsbums_', '', $key); 28 | } 29 | $this->setConfig($prefix.$key, $value); 30 | } 31 | if ($key == $prefix.'custom_options' && $value != '') { 32 | if (substr($value, 0, 1) === '{') { 33 | $value = substr($value, 1); 34 | } 35 | if (substr($value, strlen($value) - 1, 1) === '}') { 36 | $value = substr($value, 0, strlen($value) - 1); 37 | } 38 | $this->setConfig($key, $value); 39 | } 40 | if ($key == $prefix.'script_checkbox') { 41 | $this->setConfig($prefix.'embed_auto', $value); 42 | $this->setConfig($prefix.'embed_config', $value); 43 | $this->setConfig($prefix.'embed_js', $value); 44 | $this->setConfig($prefix.'embed_css', $value); 45 | $this->removeConfig($prefix.'script_checkbox'); 46 | } 47 | } 48 | if (!$this->hasConfig($prefix.'status')) { 49 | $this->setConfig($prefix.'status', '1'); 50 | } 51 | -------------------------------------------------------------------------------- /pages/global_configuration.php: -------------------------------------------------------------------------------- 1 | getParam('save')) { 11 | $this->setConfig(rex_post('config', [ 12 | ['global_testmode', 'string', '0'], 13 | ['global_hide_on_cookie', 'string', '0'], 14 | ])); 15 | } 16 | $formElements = []; 17 | 18 | // Testmode 19 | $formElements[] = [ 20 | 'label' => '', 21 | 'field' => '', 22 | 'note' => $this->i18n('testmode_notice'), 23 | ]; 24 | 25 | // Hide JS and CSS if Cookie is set 26 | $formElements[] = [ 27 | 'label' => '', 28 | 'field' => '', 29 | 'note' => $this->i18n('hide_on_cookie_notice'), 30 | ]; 31 | 32 | $fragment = new rex_fragment(); 33 | $fragment->setVar('elements', $formElements, false); 34 | $content = $fragment->parse('core/form/checkbox.php'); 35 | 36 | // Save-Button 37 | $formElements = []; 38 | $n = []; 39 | $n['field'] = ''; 40 | $formElements[] = $n; 41 | 42 | $fragment = new rex_fragment(); 43 | $fragment->setVar('elements', $formElements, false); 44 | $buttons = $fragment->parse('core/form/submit.php'); 45 | 46 | $fragment = new rex_fragment(); 47 | $fragment->setVar('class', 'edit'); 48 | $fragment->setVar('body', $content, false); 49 | $fragment->setVar('title', $this->i18n('global_configuration')); 50 | $fragment->setVar('buttons', $buttons, false); 51 | ?> 52 |
53 | parse('core/page/section.php'); ?> 54 |
-------------------------------------------------------------------------------- /assets/css/cookie_consent_insites_clean.css: -------------------------------------------------------------------------------- 1 | .cc-window{opacity:1;transition:opacity 1s ease}.cc-window.cc-invisible{opacity:0}.cc-animate.cc-revoke{transition:transform 1s ease}.cc-animate.cc-revoke.cc-top{transform:translateY(-2em)}.cc-animate.cc-revoke.cc-bottom{transform:translateY(2em)}.cc-animate.cc-revoke.cc-active.cc-bottom,.cc-animate.cc-revoke.cc-active.cc-top,.cc-revoke:hover{transform:translateY(0)}.cc-grower{max-height:0;overflow:hidden;transition:max-height 1s} 2 | .cc-revoke,.cc-window{position:fixed;overflow:hidden;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;z-index:9999}.cc-window.cc-static{position:static}.cc-window.cc-floating{padding:2em;max-width:24em;-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner{padding:1em 1.8em;width:100%;-ms-flex-direction:row;flex-direction:row}.cc-revoke{padding:.5em}.cc-btn,.cc-close,.cc-link,.cc-revoke{cursor:pointer}.cc-link{opacity:.8;display:inline-block;padding:.2em}.cc-link:hover{opacity:1}.cc-btn{display:block;padding:.4em .8em;border-width:2px;border-style:solid;text-align:center;white-space:nowrap}.cc-banner .cc-btn:last-child{min-width:140px}.cc-close{display:block;position:absolute;top:.5em;right:.5em;font-size:1.6em;opacity:.9}.cc-close:focus,.cc-close:hover{opacity:1} 3 | .cc-revoke.cc-top{top:0;left:3em;border-bottom-left-radius:.5em;border-bottom-right-radius:.5em}.cc-revoke.cc-bottom{bottom:0;left:3em;border-top-left-radius:.5em;border-top-right-radius:.5em}.cc-revoke.cc-left{left:3em;right:unset}.cc-revoke.cc-right{right:3em;left:unset}.cc-top{top:1em}.cc-left{left:1em}.cc-right{right:1em}.cc-bottom{bottom:1em}.cc-floating>.cc-link{margin-bottom:1em}.cc-floating .cc-message{display:block;margin-bottom:1em}.cc-window.cc-floating .cc-compliance{-ms-flex:1;flex:1}.cc-window.cc-banner{-ms-flex-align:center;align-items:center}.cc-banner.cc-top{left:0;right:0;top:0}.cc-banner.cc-bottom{left:0;right:0;bottom:0}.cc-banner .cc-message{-ms-flex:1;flex:1}.cc-compliance{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:justify;align-content:space-between}.cc-compliance>.cc-btn{-ms-flex:1;flex:1}.cc-btn+.cc-btn{margin-left:.5em} 4 | @media print{.cc-revoke,.cc-window{display:none}}@media screen and (max-width:900px){.cc-btn{white-space:normal}}@media screen and (max-width:414px) and (orientation:portrait),screen and (max-width:736px) and (orientation:landscape){.cc-window.cc-top{top:0}.cc-window.cc-bottom{bottom:0}.cc-window.cc-banner,.cc-window.cc-left,.cc-window.cc-right{left:0;right:0}.cc-window.cc-banner{-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner .cc-compliance{-ms-flex:1;flex:1}.cc-window.cc-floating{max-width:none}.cc-window .cc-message{margin-bottom:1em}.cc-window.cc-banner{-ms-flex-align:unset;align-items:unset}} 5 | .cc-floating.cc-theme-classic{padding:1.2em;border-radius:5px}.cc-floating.cc-type-info.cc-theme-classic .cc-compliance{text-align:center;display:inline;-ms-flex:none;flex:none}.cc-theme-classic .cc-btn{border-radius:5px}.cc-theme-classic .cc-btn:last-child{min-width:140px}.cc-floating.cc-type-info.cc-theme-classic .cc-btn{display:inline-block} 6 | .cc-theme-edgeless.cc-window{padding:0}.cc-floating.cc-theme-edgeless .cc-message{margin:2em 2em 1.5em}.cc-banner.cc-theme-edgeless .cc-btn{margin:0;padding:.8em 1.8em;height:100%}.cc-banner.cc-theme-edgeless .cc-message{margin-left:1em}.cc-floating.cc-theme-edgeless .cc-btn+.cc-btn{margin-left:0} 7 | -------------------------------------------------------------------------------- /assets/css/cookie_consent_insites.css: -------------------------------------------------------------------------------- 1 | .cc-window{opacity:1;transition:opacity 1s ease}.cc-window.cc-invisible{opacity:0}.cc-animate.cc-revoke{transition:transform 1s ease}.cc-animate.cc-revoke.cc-top{transform:translateY(-2em)}.cc-animate.cc-revoke.cc-bottom{transform:translateY(2em)}.cc-animate.cc-revoke.cc-active.cc-bottom,.cc-animate.cc-revoke.cc-active.cc-top,.cc-revoke:hover{transform:translateY(0)}.cc-grower{max-height:0;overflow:hidden;transition:max-height 1s} 2 | .cc-link,.cc-revoke:hover{text-decoration:underline}.cc-revoke,.cc-window{position:fixed;overflow:hidden;box-sizing:border-box;font-family:Helvetica,Calibri,Arial,sans-serif;font-size:16px;line-height:1.5em;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;z-index:9999}.cc-window.cc-static{position:static}.cc-window.cc-floating{padding:2em;max-width:24em;-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner{padding:1em 1.8em;width:100%;-ms-flex-direction:row;flex-direction:row}.cc-revoke{padding:.5em}.cc-header{font-size:18px;font-weight:700}.cc-btn,.cc-close,.cc-link,.cc-revoke{cursor:pointer}.cc-link{opacity:.8;display:inline-block;padding:.2em}.cc-link:hover{opacity:1}.cc-link:active,.cc-link:visited{color:initial}.cc-btn{display:block;padding:.4em .8em;font-size:.9em;font-weight:700;border-width:2px;border-style:solid;text-align:center;white-space:nowrap}.cc-banner .cc-btn:last-child{min-width:140px}.cc-highlight .cc-btn:first-child{background-color:transparent;border-color:transparent}.cc-highlight .cc-btn:first-child:focus,.cc-highlight .cc-btn:first-child:hover{background-color:transparent;text-decoration:underline}.cc-close{display:block;position:absolute;top:.5em;right:.5em;font-size:1.6em;opacity:.9;line-height:.75}.cc-close:focus,.cc-close:hover{opacity:1} 3 | .cc-revoke.cc-top{top:0;left:3em;border-bottom-left-radius:.5em;border-bottom-right-radius:.5em}.cc-revoke.cc-bottom{bottom:0;left:3em;border-top-left-radius:.5em;border-top-right-radius:.5em}.cc-revoke.cc-left{left:3em;right:unset}.cc-revoke.cc-right{right:3em;left:unset}.cc-top{top:1em}.cc-left{left:1em}.cc-right{right:1em}.cc-bottom{bottom:1em}.cc-floating>.cc-link{margin-bottom:1em}.cc-floating .cc-message{display:block;margin-bottom:1em}.cc-window.cc-floating .cc-compliance{-ms-flex:1;flex:1}.cc-window.cc-banner{-ms-flex-align:center;align-items:center}.cc-banner.cc-top{left:0;right:0;top:0}.cc-banner.cc-bottom{left:0;right:0;bottom:0}.cc-banner .cc-message{-ms-flex:1;flex:1}.cc-compliance{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:justify;align-content:space-between}.cc-compliance>.cc-btn{-ms-flex:1;flex:1}.cc-btn+.cc-btn{margin-left:.5em} 4 | @media print{.cc-revoke,.cc-window{display:none}}@media screen and (max-width:900px){.cc-btn{white-space:normal}}@media screen and (max-width:414px) and (orientation:portrait),screen and (max-width:736px) and (orientation:landscape){.cc-window.cc-top{top:0}.cc-window.cc-bottom{bottom:0}.cc-window.cc-banner,.cc-window.cc-left,.cc-window.cc-right{left:0;right:0}.cc-window.cc-banner{-ms-flex-direction:column;flex-direction:column}.cc-window.cc-banner .cc-compliance{-ms-flex:1;flex:1}.cc-window.cc-floating{max-width:none}.cc-window .cc-message{margin-bottom:1em}.cc-window.cc-banner{-ms-flex-align:unset;align-items:unset}} 5 | .cc-floating.cc-theme-classic{padding:1.2em;border-radius:5px}.cc-floating.cc-type-info.cc-theme-classic .cc-compliance{text-align:center;display:inline;-ms-flex:none;flex:none}.cc-theme-classic .cc-btn{border-radius:5px}.cc-theme-classic .cc-btn:last-child{min-width:140px}.cc-floating.cc-type-info.cc-theme-classic .cc-btn{display:inline-block} 6 | .cc-theme-edgeless.cc-window{padding:0}.cc-floating.cc-theme-edgeless .cc-message{margin:2em 2em 1.5em}.cc-banner.cc-theme-edgeless .cc-btn{margin:0;padding:.8em 1.8em;height:100%}.cc-banner.cc-theme-edgeless .cc-message{margin-left:1em}.cc-floating.cc-theme-edgeless .cc-btn+.cc-btn{margin-left:0} 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ⚠️ Entwicklung eingestellt: Eine Alternative mit mehr Funktionen bietet das FOR-AddOn [Cookie-Gedöns (iwcc)](https://github.com/FriendsOfREDAXO/iwcc). 2 | 3 | # Cookie Consent 4 | 5 | Das AddOn stellt das "Cookie Consent"-Script von [Insites](https://cookieconsent.insites.com) zur Verfügung und generiert einen Code um die EU Cookie-Richtlinie zu erfüllen. 6 | 7 | ![Screenshot](https://github.com/FriendsOfREDAXO/cookie_consent/blob/assets/cookie%20consent.png?raw=true) 8 | 9 | ## Features 10 | 11 | - Individuelle Darstellung des Cookie-Hinweis Banner 12 | - Auswahl der Textfarbe und des Textinhaltes 13 | - Auswahl der Hintergrundfarbe 14 | - Setzen der Datenschutzerklärung (interner oder externer Link) 15 | - Position des Cookie-Hinweis Banner 16 | - Vorgefertigte Designs als Auswahl 17 | - Konfigurationstest der gesetzten Farben 18 | - Ausgabe-Code zum kopieren oder Funktion zum automatischen einfügen 19 | 20 | ## Rechtliches 21 | Verwendung auf eigene Gefahr. 22 | Vor Verwendung des AddOns sollte die aktuelle Rechtslage (gerade in Deutschland) recherchiert werden. Das AddOn liefert nur das Skript. Eine Gewähr auf Rechtssicherheit ist nicht geggeben und wird auch nicht geleistet. 23 | 24 | ## Installation 25 | 26 | 1. Über Installer laden oder ZIP-Datei im AddOn-Ordner entpacken, der Ordner muss „cookie_consent“ heißen. 27 | 2. AddOn installieren und aktivieren 28 | 29 | ## Verwendung 30 | ### Automatisches Einbinden 31 | Für ein automatisches Einbinden muss das Häkchen `CSS und JS automatisch einbinden` gesetzt werden. 32 | 33 | Dann wird automatisch vor dem ``-Tag im Frontend die nötigen CSS- und JS-Dateien sowie die Konfiguration für Cookie-Consent eingefügt. 34 | ### Manuelles Einbinden 35 | Alternativ kann das Einbinden manuell erfolgen. 36 | 37 | Hierfür ist es notwendig `echo cookie_consent::cookie_consent_output();` im Quelltext aufgerufen werden. An der gewählten Stelle werden alle notwendigen CSS und JS-Dateien sowie die Konfiguration für Cookie-Consent eingefügt. 38 | 39 | 40 | 41 | > Alternativ: Im Reiter 'Konfigurations Test' den ausgegeben Code kopieren und in einem ``-Block vor dem schließenden ``- oder ``-Tag einfügen oder in einer externen Datei verwenden. 42 | 43 | ## Modus 44 | 45 | - Information: 46 | dem Nutzer wird mitgeteilt, dass die Webseite Cookies verwendet und der Nutzer diese aktzeptiert, wenn er weiterhin die Webseite nutzt 47 | - Opt-Out: 48 | dem Nutzer wird mitgeteilt, dass die Webseite Cookies verwendet. Es wird ihm aber eine Schaltfläche zum Deaktivieren der Cookies bereitgestellt 49 | - Opt-In: 50 | dem Nutzer wird mitgeteilt, dass die Webseite Cookies verwenden möchte. Dem Nutzer wird eine Schaltfläche bereitgestellt, wo er die Cookies aktzeptieren oder ablehnen kann 51 | 52 | **Achtung:** Die Opt-In und Opt-Out Methode stellt **nur** die Callbacks zu dem Ablehnen oder Aktzeptieren der Cookies bereit. [Callbacks](https://cookieconsent.insites.com/documentation/disabling-cookies/) 53 | 54 | ## Requirements 55 | 56 | ##### Optional 57 | Das FOR-AddOn fügt einen Farbauswahldialog hinzu, um eine bessere Bneutzererfahrung zu bieten. 58 | * [UI Tools](https://github.com/FriendsOfREDAXO/ui_tools) von [Tim Filler](https://github.com/elricco) 59 | 60 | ## Bugtracker 61 | 62 | Du hast einen Fehler gefunden oder ein nettes Feature was du gerne hättest? [Lege ein Issue an](https://github.com/FriendsOfREDAXO/cookie_consent/issues) 63 | 64 | ## Lizenz 65 | 66 | siehe [LICENSE.md](https://github.com/FriendsOfREDAXO/cookie_consent/blob/master/LICENSE) 67 | 68 | "Cookie Consent" von Insites steht unter MIT Lizenz. 69 | 70 | ## Autor 71 | 72 | **Friends Of REDAXO** 73 | 74 | * http://www.redaxo.org 75 | * https://github.com/FriendsOfREDAXO 76 | 77 | **Projekt-Lead** 78 | 79 | [Marcel Kuhmann](https://github.com/bloep) 80 | 81 | 82 | ## Credits: 83 | 84 | First Release: [Christian Gehrke](https://github.com/chrison94) 85 | 86 | Version 1.1.0 [Marcel Kuhmann](https://github.com/bloep) 87 | -------------------------------------------------------------------------------- /lang/en_gb.lang: -------------------------------------------------------------------------------- 1 | cookie_consent_configuration = Configuration 2 | cookie_consent_configuration_test = Configuration test 3 | cookie_consent_help = Help 4 | cookie_consent_config_legend = Settings 5 | cookie_consent_config_save = Save 6 | cookie_consent_config_lang_domain = Configuration for {0} @ {1} 7 | cookie_consent_config_lang = Configuration for {0} 8 | cookie_consent_activate_for_lang_domain = Activate for language {0} on domain {1} 9 | cookie_consent_activate_for_lang = Activate for language {0} 10 | cookie_consent_config_saved_cookie = The settings have been saved 11 | cookie_consent_settings_for = Settings for 12 | cookie_consent_select_language = Language 13 | cookie_consent_select_domain = Domain 14 | 15 | cookie_consent_mode = Mode 16 | cookie_consent_info = Inform users that cookies are stored 17 | cookie_consent_opt-in = Opt-in Method 18 | cookie_consent_opt-out = Opt-out Method 19 | cookie_consent_mode_optin_notice = Removes all existing and new cookies on the server side. It also blocks the creation of new cookies by the server until the user allowed cookies via cookie-consent. Please note that the script cannot block the creation of cookies by javascript e.g. Google Analytics. 20 | cookie_consent_mode_notice = Please note that the opt-in and opt-out methods only provide callbacks for not storing cookies. You must write your own function and customize your website so that no cookies are stored. See: 21 | cookie_consent_disable_cookies = Disable Cookies 22 | 23 | cookie_consent_color_scheme = Pre-built designs 24 | cookie_consent_custom = custom 25 | 26 | cookie_consent_theme = Theme 27 | cookie_consent_color_background = Background-color 28 | cookie_consent_color_main_content = Font color of the note 29 | cookie_consent_color_button_background = Background-color button 30 | cookie_consent_color_button_content = Font color of the button 31 | cookie_consent_deny_content = Deny-Button-Text (Opt-Out) 32 | cookie_consent_allow_content = Allow-Button-Text (Opt-In) 33 | 34 | cookie_consent_position = Position 35 | cookie_consent_top = top 36 | cookie_consent_top_pushdown = Slide down from top (pushdown) 37 | cookie_consent_bottom = bottom 38 | cookie_consent_bottom-left = bottom left 39 | cookie_consent_bottom-right = bottom right 40 | 41 | cookie_consent_main_message = Text for the cookie note 42 | cookie_consent_button_content = Text for the accept button 43 | cookie_consent_privacy_policy_link_settings = Settings for privacy policy 44 | cookie_consent_link_content = Text for the privacy policy link 45 | cookie_consent_link_intern = Internal link for privacy policy 46 | cookie_consent_link_extern = External link for privacy policy 47 | cookie_consent_select_link = Type of link 48 | cookie_consent_eLink = External Link 49 | cookie_consent_iLink = Internal Link 50 | cookie_consent_output_options = Output options 51 | cookie_consent_embed_auto = Embed automatically 52 | cookie_consent_embed_config = Embed Cookie Consent config automatically 53 | cookie_consent_embed_js = Embed Javascript 54 | cookie_consent_embed_css = Embed CSS 55 | cookie_consent_embed_notice = Embeds the selected options before the tag in the frontend 56 | cookie_consent_output_settings = Output settings 57 | cookie_consent_custom_options = Custom Options 58 | cookie_consent_custom_options_notice = You can specify additional Options. For possible Options see 59 | cookie_consent_custom_options_template_notice = Examples for possible application usages can be found here: 60 | cookie_consent_json_not_valid = The given options aren't valid JSON 61 | cookie_consent_url_not_valid = The given URL is not a valid URL format 62 | 63 | cookie_consent_targetSelf = same tab or window (_self) 64 | cookie_consent_targetBlank = new tab or window (_blank) 65 | cookie_consent_targetParent = parent window (_parent) 66 | cookie_consent_targetTop = complete window (_top) 67 | 68 | cookie_consent_link_target_type = target 69 | 70 | cookie_consent_preview_for = Preview for 71 | cookie_consent_preview_section = Preview 72 | cookie_consent_preview = Show preview 73 | cookie_consent_config_code = Configuration 74 | cookie_consent_test_preview_notice = Use this button to thest the configuration. Note that the backend appearance can differ slightly from the appearance in the frontend. It is advisable to test frontend appearance when done. 75 | cookie_consent_test_embed_notice = The following code can be used to manually embed the configuration. CSS and JS files should be embedded also. Alternatively the CSS and JS files can be embedded in custom workflows. 76 | 77 | cookie_consent_global_configuration = Global settings 78 | cookie_consent_testmode = Activate test mode 79 | cookie_consent_testmode_notice = When test mode is activated, no cookies will be set. This simplifies testing in the frontend. 80 | cookie_consent_hide_on_cookie = Prevent loading CSS and JS resources after accepting. 81 | cookie_consent_hide_on_cookie_notice = Once cookies have been accepted, the CSS and JS files will not be loaded in the frontend. 82 | 83 | cookie_consent_inherit = Inherit configuration from 84 | cookie_consent_config_design = Visual settings 85 | cookie_consent_config_text = Text settings 86 | cookie_consent_templates = Templates 87 | -------------------------------------------------------------------------------- /lang/sv_se.lang: -------------------------------------------------------------------------------- 1 | cookie_consent_configuration = Konfiguration 2 | cookie_consent_configuration_test = Konfiguration test 3 | cookie_consent_help = Hjälp 4 | cookie_consent_config_legend = Inställningar 5 | cookie_consent_config_save = Spara 6 | cookie_consent_config_lang_domain = Konfiguration för {0} @ {1} 7 | cookie_consent_config_lang = Konfiguration för {0} 8 | cookie_consent_activate_for_lang_domain = Aktivera för språk {0} på domänen {1} 9 | cookie_consent_activate_for_lang = Aktivera för språk {0} 10 | cookie_consent_config_saved_cookie = Inställningarna sparades 11 | cookie_consent_settings_for = Inställningar för 12 | cookie_consent_select_language = Språk 13 | cookie_consent_select_domain = Domän 14 | 15 | cookie_consent_mode = Modus 16 | cookie_consent_info = Informera användare om att cookies lagras 17 | cookie_consent_opt-in = Opt-in metod 18 | cookie_consent_opt-out = Opt-out metod 19 | cookie_consent_mode_optin_notice = Det här alternativet tar bort alla inställda och nya cookies på serverns sida. Detta säkerställer att inga cookies kan ställas in av servern tills tillståndet har erhållits från användaren med hjälp av kaket. Detta förhindrar dock inte att cookies ställs in av javascripts, t.ex. Google Analytics. . 20 | cookie_consent_mode_notice = Observera att inloggnings- och bortkopplingsmetoderna endast ger återuppringningar för att inte lagra cookies. Du måste själv skriva funktionen och anpassa din webbplats så att inga cookies lagras. Se: 21 | cookie_consent_disable_cookies = Deaktivera cookien 22 | 23 | cookie_consent_color_scheme = färdiga designs 24 | cookie_consent_custom = anpassad 25 | 26 | cookie_consent_theme = Tema 27 | cookie_consent_color_background = Bakgrundsfärg 28 | cookie_consent_color_main_content = Teckensnittsfärg på noten 29 | cookie_consent_color_button_background = Knappens bakgrundsfärg 30 | cookie_consent_color_button_content = Teckensnittsfärg på knappen 31 | cookie_consent_deny_content = Avvisa-knappens text (Opt-Out) 32 | cookie_consent_allow_content = Godkänn-knappens (Opt-In) 33 | 34 | cookie_consent_position = Position 35 | cookie_consent_top = Top 36 | cookie_consent_top_pushdown = Kör in från toppen (pushdown) 37 | cookie_consent_bottom = Nere 38 | cookie_consent_bottom-left = Nere vänster 39 | cookie_consent_bottom-right = Nere höger 40 | 41 | cookie_consent_main_message = Text till cookie-info 42 | cookie_consent_button_content = Text för Avvisa / Förkasta-knappen 43 | cookie_consent_privacy_policy_link_settings = Sekretesspolicy inställningar 44 | cookie_consent_link_content = Text till 45 | cookie_consent_link_intern = Text för länken till integritetspolicyn 46 | cookie_consent_link_extern = Extern länk för integritetspolicyn 47 | cookie_consent_select_link = Länkens art 48 | cookie_consent_eLink = Extern länk 49 | cookie_consent_iLink = Intern länk 50 | cookie_consent_output_options = output alternativ 51 | cookie_consent_embed_auto = Integrera automatiskt 52 | cookie_consent_embed_config = Inkludera konfiguration av Cookies consent 53 | cookie_consent_embed_js = Bädda in javascript 54 | cookie_consent_embed_css = Bädda in CSS 55 | cookie_consent_embed_notice = Fügt die gewählten Optionen vor dem Tag im Frontend ein. 56 | cookie_consent_output_settings = Utgångsinställningar 57 | cookie_consent_custom_options = Anpassade alternativ 58 | cookie_consent_custom_options_notice = Här kan du lägga till ytterligare alternativ. För möjliga alternativ se 59 | cookie_consent_custom_options_template_notice = Exempel på möjliga användningsfall finns här: 60 | cookie_consent_json_not_valid = De angivna alternativen är inte tillgängliga i det giltiga JSON-formatet 61 | cookie_consent_url_not_valid = Den angivna webbadressen är inte i giltigt webbadressformat 62 | 63 | cookie_consent_targetSelf = samma flik eller sida (_self) 64 | cookie_consent_targetBlank = Ny flik eller fönster (_blank) 65 | cookie_consent_targetParent = Överordnad fönster (_parent) 66 | cookie_consent_targetTop = hela fönstret (_top) 67 | 68 | cookie_consent_link_target_type = Målfönstrets bas 69 | 70 | cookie_consent_preview_for = Förhandsvisning till 71 | cookie_consent_preview_section = Förhandsvisning 72 | cookie_consent_preview = Visa förhandsvisning 73 | cookie_consent_config_code = Konfiguration 74 | cookie_consent_test_preview_notice = Med den här knappen kan konfigurationen testas. Det bör noteras att utsikten i backenden kan skilja sig från den i frontendan. Av denna anledning rekommenderas att testa konfigurationen i fronten. 75 | cookie_consent_test_embed_notice = Följande kod kan användas för att manuellt integrera konfigurationen. Dessutom ska CSS- och JS-filen ingå. Alternativt kan dessa filer också ingå i anpassade JS / CSS-arbetsflöden. 76 | 77 | cookie_consent_global_configuration = Globala inställningar 78 | cookie_consent_testmode = Aktivera testläget 79 | cookie_consent_testmode_notice = Om testläget är aktivt anger cookiebannern inte en cookie. Detta möjliggör enklare provning av banderollen i fronten. 80 | cookie_consent_hide_on_cookie = Ladda inte banner CSS och JS efter bekräftelse 81 | cookie_consent_hide_on_cookie_notice = Om bannerkakan har ställts in visas inte bannerns CSS och JS-kod längre i frontend. 82 | 83 | cookie_consent_inherit = Ärva konfiguration från 84 | cookie_consent_config_design = Grafiska inställningar 85 | cookie_consent_config_text = Text inställningar 86 | cookie_consent_templates = Förlagor -------------------------------------------------------------------------------- /lang/es_es.lang: -------------------------------------------------------------------------------- 1 | cookie_consent_configuration = Configuración 2 | cookie_consent_configuration_test = Prueba de configuración 3 | cookie_consent_help = Ayuda 4 | cookie_consent_config_legend = Ajustes 5 | cookie_consent_config_save = para guardar 6 | cookie_consent_config_lang_domain = Configuración para {0} @ {1} 7 | cookie_consent_config_lang = Configuración para {0} 8 | cookie_consent_activate_for_lang_domain = Para el idioma {0}, active el dominio {1} 9 | cookie_consent_activate_for_lang = Activar para el lenguaje {0} 10 | cookie_consent_config_saved_cookie = La configuración se ha guardado 11 | cookie_consent_settings_for = Configuración para 12 | cookie_consent_select_language = Idioma 13 | cookie_consent_select_domain = Dominio 14 | 15 | cookie_consent_mode = Modo 16 | cookie_consent_info = Informar a los usuarios que las cookies se almacenan 17 | cookie_consent_opt-in = Método de inclusión 18 | cookie_consent_opt-out = Método de exclusión 19 | cookie_consent_mode_optin_notice = Esta opción elimina todas las cookies del lado del servidor. Esto asegura que las cookies se obtuvieron del usuario. Sin embargo, esto no impide que Javascripts establezca cookies, p. Ej. Google Analytics. 20 | cookie_consent_mode_notice = Tenga en cuenta que los métodos de inclusión y exclusión voluntaria solo proporcionan las devoluciones de llamada para no almacenar las cookies. Debe escribir la función usted mismo y personalizar su sitio web para que no se almacenen cookies. Por favor refiérase a 21 | cookie_consent_disable_cookies = Desactivar cookies 22 | 23 | cookie_consent_color_scheme = Diseños listos 24 | cookie_consent_custom = Personalizado 25 | 26 | cookie_consent_theme = Tema 27 | cookie_consent_color_background = Color de fondo 28 | cookie_consent_color_main_content = Color de fuente de la nota 29 | cookie_consent_color_button_background = Botón de color de fondo 30 | cookie_consent_color_button_content = Color de fuente en el botón 31 | cookie_consent_deny_content = Denegar texto de botón (exclusión) 32 | cookie_consent_allow_content = Aceptar el texto del botón (Opt-In) 33 | 34 | cookie_consent_position = posición 35 | cookie_consent_top = Por encima 36 | cookie_consent_top_pushdown = Presione hacia abajo 37 | cookie_consent_bottom = Por debajo 38 | cookie_consent_bottom-left = Abajo a la izquierda 39 | cookie_consent_bottom-right = Abajo a la derecha 40 | 41 | cookie_consent_main_message = Texto para la nota de cookie 42 | cookie_consent_button_content = Texto para el botón Rechazar/Descartar 43 | cookie_consent_privacy_policy_link_settings = Configuración de la política de privacidad 44 | cookie_consent_link_content = Texto para el enlace de política de privacidad 45 | cookie_consent_link_intern = Enlace interno para la política de privacidad 46 | cookie_consent_link_extern = Enlace externo para la política de privacidad 47 | cookie_consent_select_link = Tipo de enlace 48 | cookie_consent_eLink = Enlace externo 49 | cookie_consent_iLink = Enlace interno 50 | cookie_consent_output_options = Opciones de salida 51 | cookie_consent_embed_auto = Integrar automáticamente 52 | cookie_consent_embed_config = Incluir la configuración de consentimiento de cookies 53 | cookie_consent_embed_js = Integrar javascript 54 | cookie_consent_embed_css = Integrar CSS 55 | cookie_consent_embed_notice = Inserta las opciones seleccionadas antes de la etiqueta en la interfaz. 56 | cookie_consent_output_settings = Configuración de salida 57 | cookie_consent_custom_options = Opciones personalizadas 58 | cookie_consent_custom_options_notice = Aquí se pueden ingresar opciones adicionales. Para ver posibles opciones, vea 59 | cookie_consent_custom_options_template_notice = Ejemplos de posibles casos de uso se pueden encontrar aquí: 60 | cookie_consent_json_not_valid = Las opciones dadas no están disponibles en el formato JSON válido 61 | cookie_consent_url_not_valid = La URL especificada no está en formato URL válido 62 | 63 | cookie_consent_targetSelf = misma pestaña o página (_self) 64 | cookie_consent_targetBlank = Nueva pestaña o ventana (_blank) 65 | cookie_consent_targetParent = Ventana principal (_parent) 66 | cookie_consent_targetTop = ventana completa (_top) 67 | 68 | cookie_consent_link_target_type = Base de ventana de destino 69 | 70 | cookie_consent_preview_for = Vista previa para 71 | cookie_consent_preview_section = Vista previa 72 | cookie_consent_preview = Mostrar vista previa 73 | cookie_consent_config_code = Ajustes 74 | cookie_consent_test_preview_notice = Con este botón la configuración puede ser probada. Cabe señalar que la vista en el backend puede diferir de la de la interfaz. Por esta razón, se recomienda probar la configuración en la interfaz. 75 | cookie_consent_test_embed_notice = El siguiente código se puede usar para integrar manualmente la configuración. Además, el archivo CSS y JS debe ser incluido. Alternativamente, estos archivos también se pueden incluir en flujos de trabajo personalizados de JS/CSS. 76 | 77 | cookie_consent_global_configuration = Configuración global 78 | cookie_consent_testmode = Activar el modo de prueba 79 | cookie_consent_testmode_notice = Si el modo de prueba está activo, el banner de la cookie no establece una cookie. Esto permite una prueba más fácil del banner en la interfaz. 80 | cookie_consent_hide_on_cookie = Banner CSS und JS nach Bestätigung nicht laden 81 | cookie_consent_hide_on_cookie_notice = Si se ha establecido la cookie de banner, el banner CSS y el código JS ya no se mostrarán en la interfaz 82 | 83 | cookie_consent_inherit = Heredar configuración de 84 | cookie_consent_config_design = Configuraciones gráficas 85 | cookie_consent_config_text = Ajustes de texto 86 | cookie_consent_templates = Plantillas -------------------------------------------------------------------------------- /lang/de_de.lang: -------------------------------------------------------------------------------- 1 | cookie_consent_configuration = Konfiguration 2 | cookie_consent_configuration_test = Konfigurations Test 3 | cookie_consent_help = Hilfe 4 | cookie_consent_config_legend = Einstellungen 5 | cookie_consent_config_save = Speichern 6 | cookie_consent_config_lang_domain = Konfiguration für {0} @ {1} 7 | cookie_consent_config_lang = Konfiguration für {0} 8 | cookie_consent_activate_for_lang_domain = Aktiviere für Sprache {0} auf Domain {1} 9 | cookie_consent_activate_for_lang = Aktiviere für Sprache {0} 10 | cookie_consent_config_saved_cookie = Die Einstellungen wurden gespeichert 11 | cookie_consent_settings_for = Einstellungen für 12 | cookie_consent_select_language = Sprache 13 | cookie_consent_select_domain = Domain 14 | 15 | cookie_consent_mode = Modus 16 | cookie_consent_info = Nutzer informieren, dass Cookies gespeichert werden 17 | cookie_consent_opt-in = Opt-in Methode 18 | cookie_consent_opt-out = Opt-out Methode 19 | cookie_consent_mode_optin_notice = Bei dieser Option werden serverseitig alle gesetzten und neuen Cookies entfernt. Das sorgt dafür, dass keine Cookies vom Server gesetzt werden können, bis durch den Cookie-Consent die Erlaubnis vom Benutzer eingeholt wurde. Dieses verhindert aber nicht das Setzen von Cookies durch Javascripte, wie z.B. Google Analytics.. 20 | cookie_consent_mode_notice = Bitte beachte das die Opt-in und Opt-out Methoden nur die Callbacks zum nicht speichern der Cookies liefern. Du musst selbst die Funktion verfassen und deine Webseite anpassen, sodass keine Cookies gespeichert werden. Siehe: 21 | cookie_consent_disable_cookies = Cookies deaktivieren 22 | 23 | cookie_consent_color_scheme = vorgefertigte Designs 24 | cookie_consent_custom = Benutzerdefiniert 25 | 26 | cookie_consent_theme = Theme 27 | cookie_consent_color_background = Hintergrundfarbe 28 | cookie_consent_color_main_content = Schriftfarbe des Hinweis 29 | cookie_consent_color_button_background = Hintergrundfarbe Button 30 | cookie_consent_color_button_content = Schriftfarbe im Button 31 | cookie_consent_deny_content = Verweigern-Button-Text (Opt-Out) 32 | cookie_consent_allow_content = Zustimmen-Button-Text (Opt-In) 33 | 34 | cookie_consent_position = Position 35 | cookie_consent_top = Oben 36 | cookie_consent_top_pushdown = Von oben reinfahren (pushdown) 37 | cookie_consent_bottom = Unten 38 | cookie_consent_bottom-left = Unten links 39 | cookie_consent_bottom-right = Unten rechts 40 | 41 | cookie_consent_main_message = Text für den Cookie Hinweis 42 | cookie_consent_button_content = Text für den Annehmen/Akzeptieren Button 43 | cookie_consent_privacy_policy_link_settings = Einstellungen für Datenschutzbestimmungen 44 | cookie_consent_link_content = Text für den Datenschutzbestimmungs-Link 45 | cookie_consent_link_intern = Interner Link für Datenschutzbestimmungen 46 | cookie_consent_link_extern = Externer Link für Datenschutzbestimmungen 47 | cookie_consent_select_link = Art des Link 48 | cookie_consent_eLink = Externer Link 49 | cookie_consent_iLink = Interner Link 50 | cookie_consent_output_options = Ausgabeoptionen 51 | cookie_consent_embed_auto = Automatisch Einbinden 52 | cookie_consent_embed_config = Cookie Consent Konfiguration einbinden 53 | cookie_consent_embed_js = Javascript einbinden 54 | cookie_consent_embed_css = CSS einbinden 55 | cookie_consent_embed_notice = Fügt die gewählten Optionen vor dem Tag im Frontend ein. 56 | cookie_consent_output_settings = Ausgabeeinstellungen 57 | cookie_consent_custom_options = Benutzerdefinierte Optionen 58 | cookie_consent_custom_options_notice = Hier können zusätzliche Optionen eingetragen werden. Für mögliche Optionen siehe 59 | cookie_consent_custom_options_template_notice = Beispiele für mögliche Anwendungsfälle sind hier zu finden: 60 | cookie_consent_json_not_valid = Die gegebenen Optionen liegen nicht im gültigen JSON-Format vor 61 | cookie_consent_url_not_valid = Die angegebene URL liegt nicht im gültigen URL-Format vor 62 | 63 | cookie_consent_targetSelf = gleicher Tab oder Seite (_self) 64 | cookie_consent_targetBlank = Neuer Tab oder Fenster (_blank) 65 | cookie_consent_targetParent = Elternfenster (_parent) 66 | cookie_consent_targetTop = ganzes Fenster (_top) 67 | 68 | cookie_consent_link_target_type = Zielfensterbasis 69 | 70 | cookie_consent_preview_for = Vorschau für 71 | cookie_consent_preview_section = Vorschau 72 | cookie_consent_preview = Vorschau anzeigen 73 | cookie_consent_config_code = Konfiguration 74 | cookie_consent_test_preview_notice = Mit diesem Button kann die Konfiguration getestet werden. Es gilt hierbei zu beachten, dass die Ansicht im Backend von der im Frontend abweichen kann. Aus diesem Grund empfiehlt es sich abschließend die Konfiguration im Frontend zu testen. 75 | cookie_consent_test_embed_notice = Der folgende Code kann verwendet werden um die Konfiguration manuell einzubinden. Zusätzlich sollten die CSS- und JS-Datei eingebunden werden. Alternativ können diese Dateien auch in eigene JS/CSS-Workflows aufgenommen werden. 76 | 77 | cookie_consent_global_configuration = Globale Einstellungen 78 | cookie_consent_testmode = Testmodus aktivieren 79 | cookie_consent_testmode_notice = Wenn der Testmodus aktiv ist, setzt der Cookie-Banner kein Cookie. Dies erlaubt einfacheres Testen des Banners im Frontend. 80 | cookie_consent_hide_on_cookie = Banner CSS und JS nach Bestätigung nicht laden 81 | cookie_consent_hide_on_cookie_notice = Wenn der Banner-Cookie gesetzt wurde, wird der Banner CSS- und JS-Code im Frontend nicht mehr ausgegeben. 82 | 83 | cookie_consent_inherit = Konfiguration erben von 84 | cookie_consent_config_design = Grafische Einstellungen 85 | cookie_consent_config_text = Text-Einstellungen 86 | cookie_consent_templates = Vorlagen 87 | -------------------------------------------------------------------------------- /pages/configuration_test.php: -------------------------------------------------------------------------------- 1 | setParam('page', rex_request('page', 'string', null)); 8 | $context->setParam('clang', rex_request('clang', 'string', null)); 9 | $context->setParam('domain', rex_request('domain', 'string', null)); 10 | if (!$context->getParam('clang')) { 11 | $context->setParam('clang', rex_clang::getCurrentId()); 12 | } 13 | if ($context->getParam('domain') === null) { 14 | $domainId = ''; 15 | if (cookie_consent::checkYrewrite()) { 16 | $allDomains = rex_yrewrite::getDomains(); 17 | unset($allDomains['default']); 18 | if (count($allDomains) > 0) { 19 | $curDomain = reset($allDomains); 20 | $domainId = $curDomain->getId(); 21 | } 22 | } 23 | $context->setParam('domain', $domainId); 24 | } 25 | 26 | $clangId = $context->getParam('clang'); 27 | $domainId = $context->getParam('domain'); 28 | 29 | $formElements = []; 30 | 31 | if (cookie_consent::checkYrewrite()) { 32 | $button_label = ''; 33 | $items = []; 34 | foreach (rex_yrewrite::getDomains() as $id => $domain) { 35 | $item = []; 36 | $item['title'] = $domain->getName(); 37 | $item['href'] = $context->getUrl(['domain' => $domain->getId()]); 38 | if ($domain->getId() == $context->getParam('domain')) { 39 | $item['active'] = true; 40 | $button_label = $domain->getName(); 41 | } 42 | $items[] = $item; 43 | } 44 | $fragment = new rex_fragment(); 45 | $fragment->setVar('class', 'rex-language'); 46 | $fragment->setVar('button_label', $button_label); 47 | $fragment->setVar('header', $this->i18n('select_domain')); 48 | $fragment->setVar('items', $items, false); 49 | 50 | $formElements[] = [ 51 | 'label' => '', 52 | 'field' => $fragment->parse('core/dropdowns/dropdown.php'), 53 | ]; 54 | } 55 | 56 | if (rex_clang::count() > 1) { 57 | $formElements[] = [ 58 | 'label' => '', 59 | 'field' => rex_view::clangSwitchAsDropdown($context), 60 | ]; 61 | } 62 | 63 | if (count($formElements) > 0) { 64 | $fragment = new rex_fragment(); 65 | $fragment->setVar('elements', $formElements, false); 66 | $filterContent = $fragment->parse('core/form/container.php'); 67 | 68 | $fragment = new rex_fragment(); 69 | $fragment->setVar('title', $this->i18n('preview_for')); 70 | $fragment->setVar('body', $filterContent, false); 71 | echo $fragment->parse('core/page/section.php'); 72 | } 73 | 74 | $context = rex_context::restore(); 75 | if (!$context->getParam('clang')) { 76 | $clangId = rex_clang::getCurrentId(); 77 | } else { 78 | $clangId = $context->getParam('clang'); 79 | } 80 | 81 | $clang_prefix = rex_clang::get($clangId)->getCode().'_'; 82 | 83 | if (cookie_consent::checkYrewrite()) { 84 | $domain = rex_yrewrite::getDomainById($domainId); 85 | if (!$domain) { 86 | $domain = rex_yrewrite::getDefaultDomain(); 87 | } 88 | $clang_prefix .= $domain->getId(); 89 | $domainName = $domain->getName(); 90 | } else { 91 | $domain = null; 92 | $domainName = ''; 93 | } 94 | $clang_prefix .= '_'; 95 | 96 | if (rex_config::get('cookie_consent', cookie_consent::getKeyPrefix().'theme', '') == 'clean') { 97 | $cssFile = 'css/cookie_consent_insites_clean.css'; 98 | } else { 99 | $cssFile = 'css/cookie_consent_insites.css'; 100 | } 101 | $jsFile = 'js/cookie_consent_insites.js'; 102 | $cssFileUrl = $this->getAssetsUrl($cssFile); 103 | $jsFileUrl = $this->getAssetsUrl($jsFile); 104 | ?> 105 | 106 | 107 | 113 | $this->i18n('preview'), 120 | 'icon' => 'view', 121 | 'attributes' => [ 122 | 'class' => ['btn-lg', 'btn-primary'], 123 | 'onclick' => 'showPreviewConsent()', 124 | ], 125 | ], 126 | ]; 127 | $fragment = new rex_fragment(); 128 | $fragment->setVar('buttons', $button, false); 129 | $previewSection = $fragment->parse('core/buttons/button.php'); 130 | 131 | // ----------------- PREVIEW SECTION 132 | 133 | $notice = rex_view::info($this->i18n('test_preview_notice')); 134 | $fragment = new rex_fragment(); 135 | $fragment->setVar('title', $this->i18n('preview_section'), true); 136 | $fragment->setVar('body', $notice.$previewSection, false); 137 | echo $fragment->parse('core/page/section.php'); 138 | 139 | // ----------------- EMBED SECTION 140 | 141 | $frontendPathProvider = new rex_path_default_provider(null, null, false); 142 | $cssFileUrl = $frontendPathProvider->addonAssets($this->getName(), $cssFile); 143 | $jsFileUrl = $frontendPathProvider->addonAssets($this->getName(), $jsFile); 144 | 145 | $notice = rex_view::info($this->i18n('test_embed_notice')); 146 | $notice .= '
'.$cssFileUrl.PHP_EOL.$jsFileUrl.'
'; 147 | $copyPasteCode = '
'.htmlspecialchars(cookie_consent::cookie_consent_backend()).'
'; 148 | 149 | $fragment = new rex_fragment(); 150 | $fragment->setVar('title', $this->i18n('config_code'), true); 151 | $fragment->setVar('body', $notice.$copyPasteCode, false); 152 | echo $fragment->parse('core/page/section.php'); 153 | -------------------------------------------------------------------------------- /assets/js/cookie_consent_backend.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('#color_scheme').change(function() { 3 | var e = document.getElementById("color_scheme"); 4 | var strUser = e.options[e.selectedIndex].value; 5 | if(strUser == 'girly') { 6 | $('#cookie_consent_color_background').val('#64386b'); 7 | $('#cookie_consent_color_main_content').val('#ffcdfd'); 8 | $('#cookie_consent_color_button_background').val('#f8a8ff'); 9 | $('#cookie_consent_color_button_content').val('#3f0045'); 10 | } 11 | if(strUser == 'fancyred') { 12 | $('#cookie_consent_color_background').val('#aa0000'); 13 | $('#cookie_consent_color_main_content').val('#ffdddd'); 14 | $('#cookie_consent_color_button_background').val('#ff0000'); 15 | $('#cookie_consent_color_button_content').val('#ffdddd'); 16 | } 17 | if(strUser == 'icyblue') { 18 | $('#cookie_consent_color_background').val('#eaf7f7'); 19 | $('#cookie_consent_color_main_content').val('#5c7291'); 20 | $('#cookie_consent_color_button_background').val('#56cbdb'); 21 | $('#cookie_consent_color_button_content').val('#ffffff'); 22 | } 23 | if(strUser == 'polarlights') { 24 | $('#cookie_consent_color_background').val('#3c404d'); 25 | $('#cookie_consent_color_main_content').val('#d6d6d6'); 26 | $('#cookie_consent_color_button_background').val('#8bed4f'); 27 | $('#cookie_consent_color_button_content').val('#000'); 28 | } 29 | if(strUser == 'bubblegum') { 30 | $('#cookie_consent_color_background').val('#343c66'); 31 | $('#cookie_consent_color_main_content').val('#cfcfe8'); 32 | $('#cookie_consent_color_button_background').val('#f71559'); 33 | $('#cookie_consent_color_button_content').val('#cfcfe8'); 34 | } 35 | if(strUser == 'honeybee') { 36 | $('#cookie_consent_color_background').val('#000'); 37 | $('#cookie_consent_color_main_content').val('#EEE'); 38 | $('#cookie_consent_color_button_background').val('#f1d600'); 39 | $('#cookie_consent_color_button_content').val('#000'); 40 | } 41 | }); 42 | 43 | $('#select_link').change(function() { 44 | var e = document.getElementById("select_link"); 45 | var strUser = e.options[e.selectedIndex].value; 46 | if(strUser == 'eLink') { 47 | $('.cookie_consent_eLink').parent().parent().removeClass('cookie_consent_display_none'); 48 | $('.cookie_consent_iLink').parent().parent().addClass('cookie_consent_display_none'); 49 | } 50 | if(strUser == 'iLink') { 51 | $('.cookie_consent_iLink').parent().parent().removeClass('cookie_consent_display_none'); 52 | $('.cookie_consent_eLink').parent().parent().addClass('cookie_consent_display_none'); 53 | } 54 | }); 55 | $('#select_link').trigger('change'); 56 | 57 | $('#cookie_consent_mode').change(function() { 58 | var e = document.getElementById("cookie_consent_mode"); 59 | var strUser = e.options[e.selectedIndex].value; 60 | if(strUser == 'opt-in') { 61 | $('#cookie_consent_allow_content').parent().parent().removeClass('cookie_consent_display_none'); 62 | $('#cookie_consent_deny_content').parent().parent().addClass('cookie_consent_display_none'); 63 | $('.mode_optin_notice').css('display', 'block'); 64 | $('.mode_notice').css('display', 'block'); 65 | } 66 | if(strUser == 'opt-out') { 67 | $('#cookie_consent_deny_content').parent().parent().removeClass('cookie_consent_display_none'); 68 | $('#cookie_consent_allow_content').parent().parent().addClass('cookie_consent_display_none'); 69 | $('.mode_notice').css('display', 'block'); 70 | } 71 | if(strUser == 'info') { 72 | $('#cookie_consent_allow_content').parent().parent().addClass('cookie_consent_display_none'); 73 | $('#cookie_consent_deny_content').parent().parent().addClass('cookie_consent_display_none'); 74 | $('.mode_notice').css('display', 'none'); 75 | } 76 | }); 77 | $('#cookie_consent_mode').trigger('change'); 78 | $('#cookie_consent_theme').change(function() { 79 | var theme = document.getElementById('cookie_consent_theme'); 80 | var selTheme = theme.options[theme.selectedIndex].value; 81 | 82 | var $colorBackground = $('#cookie_consent_color_background'); 83 | var $colorMainContent = $('#cookie_consent_color_main_content'); 84 | var $colorButtonContent = $('#cookie_consent_color_button_content'); 85 | var $colorButtonBackground = $('#cookie_consent_color_button_background'); 86 | var $design = $('#color_scheme'); 87 | if(selTheme == 'clean') { 88 | $colorBackground.attr('disabled', 'disabled'); 89 | $colorMainContent.attr('disabled', 'disabled'); 90 | $colorButtonContent.attr('disabled', 'disabled'); 91 | $colorButtonBackground.attr('disabled', 'disabled'); 92 | 93 | $colorBackground.parent().parent().addClass('cookie_consent_display_none'); 94 | $colorMainContent.parent().parent().addClass('cookie_consent_display_none'); 95 | $colorButtonContent.parent().parent().addClass('cookie_consent_display_none'); 96 | $colorButtonBackground.parent().parent().addClass('cookie_consent_display_none'); 97 | 98 | $('label[for=cookie_consent_color_scheme]').parent().parent().addClass('cookie_consent_display_none'); 99 | $design.find('option').removeAttr('selected'); 100 | $design.find('option[value=custom]').attr('selected', true); 101 | $design.selectpicker('refresh'); 102 | } else { 103 | $colorBackground.removeAttr('disabled'); 104 | $colorMainContent.removeAttr('disabled'); 105 | $colorButtonContent.removeAttr('disabled'); 106 | $colorButtonBackground.removeAttr('disabled'); 107 | 108 | $colorBackground.parent().parent().removeClass('cookie_consent_display_none'); 109 | $colorMainContent.parent().parent().removeClass('cookie_consent_display_none'); 110 | $colorButtonContent.parent().parent().removeClass('cookie_consent_display_none'); 111 | $colorButtonBackground.parent().parent().removeClass('cookie_consent_display_none'); 112 | $('label[for=cookie_consent_color_scheme]').parent().parent().removeClass('cookie_consent_display_none'); 113 | } 114 | }); 115 | $('#cookie_consent_theme').trigger('change'); 116 | $('#cookie_consent_color_background,#cookie_consent_color_main_content,#cookie_consent_color_button_background,#cookie_consent_color_button_content').change(function() { 117 | var $design = $('#color_scheme'); 118 | $design.find('option').removeAttr('selected'); 119 | $design.find('option[value=custom]').attr('selected', true); 120 | $design.selectpicker('refresh'); 121 | }); 122 | 123 | var $fieldsetConfig = $('#cookie_consent_fieldset_config'); 124 | 125 | var $inheritSel = $('#cookie_consent_inherit'); 126 | var inheritSel = $inheritSel.get(0); 127 | $inheritSel.change(function() { 128 | if(inheritSel.options[inheritSel.selectedIndex].value === '') { 129 | $fieldsetConfig.show(); 130 | } else { 131 | $fieldsetConfig.hide(); 132 | } 133 | }); 134 | $inheritSel.trigger('change'); 135 | }); -------------------------------------------------------------------------------- /lib/cookie_consent.php: -------------------------------------------------------------------------------- 1 | '; 50 | return $makeCssLink; 51 | } 52 | 53 | public static function getJs() 54 | { 55 | $getFile = rex_url::base('assets/addons/cookie_consent/js/cookie_consent_insites.js'); 56 | $makeJsLink = ''; 57 | return $makeJsLink; 58 | } 59 | 60 | public static function cookie_consent_backend() 61 | { 62 | return self::cookie_consent_output(true); 63 | } 64 | 65 | /** 66 | * OUTPUT_FILTER ExtensionPoint Callback. 67 | * 68 | * @param rex_extension_point $rex_ep 69 | * 70 | * @throws rex_exception 71 | */ 72 | public static function ep_call($rex_ep) 73 | { 74 | $subject = $rex_ep->getSubject(); 75 | $output = self::cookie_consent_output(); 76 | if ($output === '') { 77 | return; 78 | } 79 | $subject = str_replace('', $output.PHP_EOL.'', $subject); 80 | $rex_ep->setSubject($subject); 81 | } 82 | 83 | public static function cookie_consent_output($codepreview = false) 84 | { 85 | $inherit = self::getConfig('inherit'); 86 | if ($inherit != '') { 87 | self::$overridePrefix = $inherit; 88 | } 89 | 90 | $status = self::getConfig('status'); 91 | if ($status != '1' || (self::getGlobalConfig('hide_on_cookie') === '1' && self::getGlobalConfig('testmode') !== '1' && isset($_COOKIE[self::COOKIE_NAME]) && !$codepreview)) { 92 | return ''; 93 | } 94 | 95 | $theme = self::getConfig('theme'); 96 | $color_background = self::getConfig('color_background'); 97 | $color_main_content = self::getConfig('color_main_content'); 98 | $color_button_background = self::getConfig('color_button_background'); 99 | $color_button_content = self::getConfig('color_button_content'); 100 | $position = self::getConfig('position'); 101 | $main_message = self::getConfig('main_message'); 102 | $button_content = self::getConfig('button_content'); 103 | $link_content = self::getConfig('link_content'); 104 | $link = self::getConfig('iLink'); 105 | $link_target_type = self::getConfig('link_target_type'); 106 | 107 | $select_link = self::getConfig('select_link'); 108 | 109 | if ($link_target_type == '') { 110 | $link_target_type = '_blank'; 111 | } 112 | 113 | $interner_link = ''; 114 | if ($link != '') { 115 | $interner_link = rex_getUrl($link); 116 | } 117 | $externer_link = self::getConfig('eLink'); 118 | $mode = self::getConfig('mode'); 119 | $deny_content = self::getConfig('deny_content'); 120 | $allow_content = self::getConfig('allow_content'); 121 | 122 | $object = [ 123 | 'theme' => $theme, 124 | 'position' => $position, 125 | 'content' => [ 126 | 'message' => rex_escape($main_message), 127 | 'dismiss' => rex_escape($button_content), 128 | 'deny' => rex_escape($deny_content), 129 | 'allow' => rex_escape($allow_content), 130 | 'link' => rex_escape($link_content), 131 | 'href' => ($select_link === self::LINK_EXT ? rex_escape($externer_link) : rex_escape($interner_link)), 132 | ], 133 | 'type' => $mode, 134 | 'elements' => [ 135 | 'messagelink' => '{{message}} {{link}}', 136 | ], 137 | ]; 138 | 139 | if (($pos = strpos($position, '-pushdown')) !== false) { 140 | $object['position'] = substr($position, 0, $pos); 141 | $object['static'] = true; 142 | } 143 | 144 | if ($theme != 'clean') { 145 | $object['palette'] = [ 146 | 'popup' => [ 147 | 'background' => rex_escape($color_background), 148 | 'text' => rex_escape($color_main_content), 149 | ], 150 | 'button' => [ 151 | 'background' => rex_escape($color_button_background), 152 | 'text' => rex_escape($color_button_content), 153 | ], 154 | ]; 155 | } 156 | $jsonConfig = json_encode($object, JSON_PRETTY_PRINT); 157 | 158 | $custom_options = self::getConfig('custom_options'); 159 | if ($custom_options && $custom_options != '') { 160 | $jsonConfig = substr($jsonConfig, 0, strlen($jsonConfig) - 2) . ','.PHP_EOL.$custom_options.PHP_EOL . '}'; 161 | } 162 | 163 | if (self::getGlobalConfig('testmode') === '1') { 164 | $jsConfigCode = 'window.cookieconsent.initialise('.$jsonConfig.', function(idx) {idx.clearStatus();idx.open();});'; 165 | } else { 166 | $jsConfigCode = 'window.cookieconsent.initialise('.$jsonConfig.');'; 167 | } 168 | 169 | if ($codepreview === true) { 170 | return $jsConfigCode; 171 | } 172 | 173 | $output = ''; 174 | if (self::getConfig('embed_css') == '1') { 175 | $output .= self::getCss().PHP_EOL; 176 | } 177 | if (self::getConfig('embed_js') == '1') { 178 | $output .= self::getJs().PHP_EOL; 179 | } 180 | if (self::getConfig('embed_config') == '1') { 181 | $output .= ''; 182 | } 183 | 184 | return rex_extension::registerPoint(new rex_extension_point('COOKIE_CONTENT_OUTPUT', $output)); 185 | } 186 | 187 | public static function getMode() 188 | { 189 | return rex_config::get('cookie_consent', self::getKeyPrefix().'mode', self::MODE_INFO); 190 | } 191 | 192 | public static function getStatus() 193 | { 194 | if (isset($_COOKIE[self::COOKIE_NAME])) { 195 | return $_COOKIE[self::COOKIE_NAME]; 196 | } 197 | return null; 198 | } 199 | 200 | /** 201 | * Extension Point Callback 202 | * Removes all Cookies if the cookie-consent cookie isn't set by the user. 203 | * 204 | * @param rex_extension_point $ep 205 | */ 206 | public static function ep_optin($ep) 207 | { 208 | if (!isset($_COOKIE[self::COOKIE_NAME]) || (isset($_COOKIE[self::COOKIE_NAME]) && $_COOKIE[self::COOKIE_NAME] != self::COOKIE_ALLOW)) { 209 | self::removeCookies(); 210 | } 211 | } 212 | 213 | public static function removeCookies() 214 | { 215 | if (false === rex_extension::registerPoint(new rex_extension_point('COOKIE_CONSENT_COOKIE_REMOVE', true))) { 216 | return false; 217 | } 218 | 219 | // unset new/updated cookies 220 | header_remove('Set-Cookie'); 221 | 222 | $headers = []; 223 | 224 | // mark all existing cookies as expired 225 | if (function_exists('getallheaders')) { 226 | $headers = getallheaders(); 227 | } else { 228 | foreach ($_SERVER as $name => $value) { 229 | if (substr($name, 0, 5) == 'HTTP_') { 230 | $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; 231 | } 232 | } 233 | } 234 | 235 | if (array_key_exists('Cookie', $headers)) { 236 | // unset cookies 237 | $cookies = explode(';', $headers['Cookie']); 238 | foreach ($cookies as $cookie) { 239 | $parts = explode('=', $cookie); 240 | $name = trim($parts[0]); 241 | setcookie($name, '', time() - 1000); 242 | setcookie($name, '', time() - 1000, '/'); 243 | } 244 | } 245 | } 246 | 247 | public static function getKeyPrefix() 248 | { 249 | if (self::$overridePrefix) { 250 | return self::$overridePrefix; 251 | } 252 | 253 | $prefix = rex_clang::getCurrent()->getCode().'_'; 254 | if (self::checkYrewrite()) { 255 | if (rex_article::getCurrent()) { 256 | $domain = rex_yrewrite::getCurrentDomain(); 257 | } else { 258 | $domain = null; 259 | } 260 | if (!$domain) { 261 | $domain = rex_yrewrite::getDefaultDomain(); 262 | } 263 | $prefix .= $domain->getId(); 264 | } 265 | $prefix .= '_'; 266 | return $prefix; 267 | } 268 | 269 | public static function getConfig($key, $default = null) 270 | { 271 | $prefix = self::getKeyPrefix(); 272 | return rex_config::get('cookie_consent', $prefix.$key, $default); 273 | } 274 | 275 | public static function getGlobalConfig($key, $default = null) 276 | { 277 | return rex_config::get('cookie_consent', 'global_'.$key, $default); 278 | } 279 | 280 | public static function checkYrewrite() 281 | { 282 | $yrewrite = rex_addon::get('yrewrite'); 283 | return 284 | rex_string::versionCompare($yrewrite->getVersion(), self::YREWRITE_VERSION_MIN, '>=') && 285 | $yrewrite->isAvailable(); 286 | } 287 | 288 | public static function hasUserSession() 289 | { 290 | if (rex::getUser() instanceof rex_user) { 291 | return true; 292 | } 293 | 294 | // If user is logged in, skip 295 | if (session_name() != '' && rex_backend_login::hasSession()) { 296 | return true; 297 | } 298 | 299 | $ycom = rex_addon::get('ycom'); 300 | if (!$ycom instanceof rex_null_package && $ycom->isAvailable()) { 301 | return null !== rex_ycom_auth::getUser() || in_array(rex_article::getCurrentId(), [ 302 | $ycom->getConfig('article_id_jump_denied'), 303 | $ycom->getConfig('article_id_jump_logout'), 304 | $ycom->getConfig('article_id_jump_not_ok'), 305 | $ycom->getConfig('article_id_jump_ok'), 306 | ], true); 307 | } 308 | 309 | return false; 310 | } 311 | } 312 | -------------------------------------------------------------------------------- /assets/js/cookie_consent_insites.js: -------------------------------------------------------------------------------- 1 | !function(e){if(!e.hasInitialised){var t={escapeRegExp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},hasClass:function(e,t){var i=" ";return 1===e.nodeType&&(i+e.className+i).replace(/[\n\t]/g,i).indexOf(i+t+i)>=0},addClass:function(e,t){e.className+=" "+t},removeClass:function(e,t){var i=new RegExp("\\b"+this.escapeRegExp(t)+"\\b");e.className=e.className.replace(i,"")},interpolateString:function(e,t){var i=/{{([a-z][a-z0-9\-_]*)}}/gi;return e.replace(i,function(e){return t(arguments[1])||""})},getCookie:function(e){var t="; "+document.cookie,i=t.split("; "+e+"=");return 2!=i.length?void 0:i.pop().split(";").shift()},setCookie:function(e,t,i,n,o){var s=new Date;s.setDate(s.getDate()+(i||365));var r=[e+"="+t,"expires="+s.toUTCString(),"path="+(o||"/")];n&&r.push("domain="+n),document.cookie=r.join(";")},deepExtend:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(i in e&&this.isPlainObject(e[i])&&this.isPlainObject(t[i])?this.deepExtend(e[i],t[i]):e[i]=t[i]);return e},throttle:function(e,t){var i=!1;return function(){i||(e.apply(this,arguments),i=!0,setTimeout(function(){i=!1},t))}},hash:function(e){var t,i,n,o=0;if(0===e.length)return o;for(t=0,n=e.length;t=128?"#000":"#fff"},getLuminance:function(e){var t=parseInt(this.normaliseHex(e),16),i=38,n=(t>>16)+i,o=(t>>8&255)+i,s=(255&t)+i,r=(16777216+65536*(n<255?n<1?0:n:255)+256*(o<255?o<1?0:o:255)+(s<255?s<1?0:s:255)).toString(16).slice(1);return"#"+r},isMobile:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},isPlainObject:function(e){return"object"==typeof e&&null!==e&&e.constructor==Object}};e.status={deny:"deny",allow:"allow",dismiss:"dismiss"},e.transitionEnd=function(){var e=document.createElement("div"),t={t:"transitionend",OT:"oTransitionEnd",msT:"MSTransitionEnd",MozT:"transitionend",WebkitT:"webkitTransitionEnd"};for(var i in t)if(t.hasOwnProperty(i)&&"undefined"!=typeof e.style[i+"ransition"])return t[i];return""}(),e.hasTransition=!!e.transitionEnd;var i=Object.keys(e.status).map(t.escapeRegExp);e.customStyles={},e.Popup=function(){function n(){this.initialise.apply(this,arguments)}function o(e){this.openingTimeout=null,t.removeClass(e,"cc-invisible")}function s(t){t.style.display="none",t.removeEventListener(e.transitionEnd,this.afterTransition),this.afterTransition=null}function r(){var t=this.options.onInitialise.bind(this);if(!window.navigator.cookieEnabled)return t(e.status.deny),!0;if(window.CookiesOK||window.navigator.CookiesOK)return t(e.status.allow),!0;var i=Object.keys(e.status),n=this.getStatus(),o=i.indexOf(n)>=0;return o&&t(n),o}function a(){var e=this.options.position.split("-"),t=[];return e.forEach(function(e){t.push("cc-"+e)}),t}function c(){var e=this.options,i="top"==e.position||"bottom"==e.position?"banner":"floating";t.isMobile()&&(i="floating");var n=["cc-"+i,"cc-type-"+e.type,"cc-theme-"+e.theme];e["static"]&&n.push("cc-static"),n.push.apply(n,a.call(this));p.call(this,this.options.palette);return this.customStyleSelector&&n.push(this.customStyleSelector),n}function l(){var e={},i=this.options;i.showLink||(i.elements.link="",i.elements.messagelink=i.elements.message),Object.keys(i.elements).forEach(function(n){e[n]=t.interpolateString(i.elements[n],function(e){var t=i.content[e];return e&&"string"==typeof t&&t.length?t:""})});var n=i.compliance[i.type];n||(n=i.compliance.info),e.compliance=t.interpolateString(n,function(t){return e[t]});var o=i.layouts[i.layout];return o||(o=i.layouts.basic),t.interpolateString(o,function(t){return e[t]})}function u(i){var n=this.options,o=document.createElement("div"),s=n.container&&1===n.container.nodeType?n.container:document.body;o.innerHTML=i;var r=o.children[0];return r.style.display="none",t.hasClass(r,"cc-window")&&e.hasTransition&&t.addClass(r,"cc-invisible"),this.onButtonClick=h.bind(this),r.addEventListener("click",this.onButtonClick),n.autoAttach&&(s.firstChild?s.insertBefore(r,s.firstChild):s.appendChild(r)),r}function h(n){var o=n.target;if(t.hasClass(o,"cc-btn")){var s=o.className.match(new RegExp("\\bcc-("+i.join("|")+")\\b")),r=s&&s[1]||!1;r&&(this.setStatus(r),this.close(!0))}t.hasClass(o,"cc-close")&&(this.setStatus(e.status.dismiss),this.close(!0)),t.hasClass(o,"cc-revoke")&&this.revokeChoice()}function p(e){var i=t.hash(JSON.stringify(e)),n="cc-color-override-"+i,o=t.isPlainObject(e);return this.customStyleSelector=o?n:null,o&&d(i,e,"."+n),o}function d(i,n,o){if(e.customStyles[i])return void++e.customStyles[i].references;var s={},r=n.popup,a=n.button,c=n.highlight;r&&(r.text=r.text?r.text:t.getContrast(r.background),r.link=r.link?r.link:r.text,s[o+".cc-window"]=["color: "+r.text,"background-color: "+r.background],s[o+".cc-revoke"]=["color: "+r.text,"background-color: "+r.background],s[o+" .cc-link,"+o+" .cc-link:active,"+o+" .cc-link:visited"]=["color: "+r.link],a&&(a.text=a.text?a.text:t.getContrast(a.background),a.border=a.border?a.border:"transparent",s[o+" .cc-btn"]=["color: "+a.text,"border-color: "+a.border,"background-color: "+a.background],"transparent"!=a.background&&(s[o+" .cc-btn:hover, "+o+" .cc-btn:focus"]=["background-color: "+v(a.background)]),c?(c.text=c.text?c.text:t.getContrast(c.background),c.border=c.border?c.border:"transparent",s[o+" .cc-highlight .cc-btn:first-child"]=["color: "+c.text,"border-color: "+c.border,"background-color: "+c.background]):s[o+" .cc-highlight .cc-btn:first-child"]=["color: "+r.text]));var l=document.createElement("style");document.head.appendChild(l),e.customStyles[i]={references:1,element:l.sheet};var u=-1;for(var h in s)s.hasOwnProperty(h)&&l.sheet.insertRule(h+"{"+s[h].join(";")+"}",++u)}function v(e){return e=t.normaliseHex(e),"000000"==e?"#222":t.getLuminance(e)}function f(i){if(t.isPlainObject(i)){var n=t.hash(JSON.stringify(i)),o=e.customStyles[n];if(o&&!--o.references){var s=o.element.ownerNode;s&&s.parentNode&&s.parentNode.removeChild(s),e.customStyles[n]=null}}}function m(e,t){for(var i=0,n=e.length;i=0&&(this.dismissTimeout=window.setTimeout(function(){t(e.status.dismiss)},Math.floor(i)));var n=this.options.dismissOnScroll;if("number"==typeof n&&n>=0){var o=function(i){window.pageYOffset>Math.floor(n)&&(t(e.status.dismiss),window.removeEventListener("scroll",o),this.onWindowScroll=null)};this.onWindowScroll=o,window.addEventListener("scroll",o)}}function y(){if("info"!=this.options.type&&(this.options.revokable=!0),t.isMobile()&&(this.options.animateRevokable=!1),this.options.revokable){var e=a.call(this);this.options.animateRevokable&&e.push("cc-animate"),this.customStyleSelector&&e.push(this.customStyleSelector);var i=this.options.revokeBtn.replace("{{classes}}",e.join(" "));this.revokeBtn=u.call(this,i);var n=this.revokeBtn;if(this.options.animateRevokable){var o=t.throttle(function(e){var i=!1,o=20,s=window.innerHeight-20;t.hasClass(n,"cc-top")&&e.clientYs&&(i=!0),i?t.hasClass(n,"cc-active")||t.addClass(n,"cc-active"):t.hasClass(n,"cc-active")&&t.removeClass(n,"cc-active")},200);this.onMouseMove=o,window.addEventListener("mousemove",o)}}}var g={enabled:!0,container:null,cookie:{name:"cookieconsent_status",path:"/",domain:"",expiryDays:365},onPopupOpen:function(){},onPopupClose:function(){},onInitialise:function(e){},onStatusChange:function(e,t){},onRevokeChoice:function(){},content:{header:"Cookies used on the website!",message:"This website uses cookies to ensure you get the best experience on our website.",dismiss:"Got it!",allow:"Allow cookies",deny:"Decline",link:"Learn more",href:"http://cookiesandyou.com",close:"❌"},elements:{header:'{{header}} ',message:'{{message}}',messagelink:'{{message}} {{link}}',dismiss:'{{dismiss}}',allow:'{{allow}}',deny:'{{deny}}',link:'{{link}}',close:'{{close}}'},window:'',revokeBtn:'
Cookie Policy
',compliance:{info:'
{{dismiss}}
',"opt-in":'
{{dismiss}}{{allow}}
',"opt-out":'
{{deny}}{{dismiss}}
'},type:"info",layouts:{basic:"{{messagelink}}{{compliance}}","basic-close":"{{messagelink}}{{compliance}}{{close}}","basic-header":"{{header}}{{message}}{{link}}{{compliance}}"},layout:"basic",position:"bottom",theme:"block","static":!1,palette:null,revokable:!1,animateRevokable:!0,showLink:!0,dismissOnScroll:!1,dismissOnTimeout:!1,autoOpen:!0,autoAttach:!0,whitelistPage:[],blacklistPage:[],overrideHTML:null};return n.prototype.initialise=function(e){this.options&&this.destroy(),t.deepExtend(this.options={},g),t.isPlainObject(e)&&t.deepExtend(this.options,e),r.call(this)&&(this.options.enabled=!1),m(this.options.blacklistPage,location.pathname)&&(this.options.enabled=!1),m(this.options.whitelistPage,location.pathname)&&(this.options.enabled=!0);var i=this.options.window.replace("{{classes}}",c.call(this).join(" ")).replace("{{children}}",l.call(this)),n=this.options.overrideHTML;if("string"==typeof n&&n.length&&(i=n),this.options["static"]){var o=u.call(this,'
'+i+"
");o.style.display="",this.element=o.firstChild,this.element.style.display="none",t.addClass(this.element,"cc-invisible")}else this.element=u.call(this,i);b.call(this),y.call(this),this.options.autoOpen&&this.autoOpen()},n.prototype.destroy=function(){this.onButtonClick&&this.element&&(this.element.removeEventListener("click",this.onButtonClick),this.onButtonClick=null),this.dismissTimeout&&(clearTimeout(this.dismissTimeout),this.dismissTimeout=null),this.onWindowScroll&&(window.removeEventListener("scroll",this.onWindowScroll),this.onWindowScroll=null),this.onMouseMove&&(window.removeEventListener("mousemove",this.onMouseMove),this.onMouseMove=null),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.revokeBtn&&this.revokeBtn.parentNode&&this.revokeBtn.parentNode.removeChild(this.revokeBtn),this.revokeBtn=null,f(this.options.palette),this.options=null},n.prototype.open=function(t){if(this.element)return this.isOpen()||(e.hasTransition?this.fadeIn():this.element.style.display="",this.options.revokable&&this.toggleRevokeButton(),this.options.onPopupOpen.call(this)),this},n.prototype.close=function(t){if(this.element)return this.isOpen()&&(e.hasTransition?this.fadeOut():this.element.style.display="none",t&&this.options.revokable&&this.toggleRevokeButton(!0),this.options.onPopupClose.call(this)),this},n.prototype.fadeIn=function(){var i=this.element;if(e.hasTransition&&i&&(this.afterTransition&&s.call(this,i),t.hasClass(i,"cc-invisible"))){if(i.style.display="",this.options["static"]){var n=this.element.clientHeight;this.element.parentNode.style.maxHeight=n+"px"}var r=20;this.openingTimeout=setTimeout(o.bind(this,i),r)}},n.prototype.fadeOut=function(){var i=this.element;e.hasTransition&&i&&(this.openingTimeout&&(clearTimeout(this.openingTimeout),o.bind(this,i)),t.hasClass(i,"cc-invisible")||(this.options["static"]&&(this.element.parentNode.style.maxHeight=""),this.afterTransition=s.bind(this,i),i.addEventListener(e.transitionEnd,this.afterTransition),t.addClass(i,"cc-invisible")))},n.prototype.isOpen=function(){return this.element&&""==this.element.style.display&&(!e.hasTransition||!t.hasClass(this.element,"cc-invisible"))},n.prototype.toggleRevokeButton=function(e){this.revokeBtn&&(this.revokeBtn.style.display=e?"":"none")},n.prototype.revokeChoice=function(e){this.options.enabled=!0,this.clearStatus(),this.options.onRevokeChoice.call(this),e||this.autoOpen()},n.prototype.hasAnswered=function(t){return Object.keys(e.status).indexOf(this.getStatus())>=0},n.prototype.hasConsented=function(t){var i=this.getStatus();return i==e.status.allow||i==e.status.dismiss},n.prototype.autoOpen=function(e){!this.hasAnswered()&&this.options.enabled&&this.open()},n.prototype.setStatus=function(i){var n=this.options.cookie,o=t.getCookie(n.name),s=Object.keys(e.status).indexOf(o)>=0;Object.keys(e.status).indexOf(i)>=0?(t.setCookie(n.name,i,n.expiryDays,n.domain,n.path),this.options.onStatusChange.call(this,i,s)):this.clearStatus()},n.prototype.getStatus=function(){return t.getCookie(this.options.cookie.name)},n.prototype.clearStatus=function(){var e=this.options.cookie;t.setCookie(e.name,"",-1,e.domain,e.path)},n}(),e.Location=function(){function e(e){t.deepExtend(this.options={},s),t.isPlainObject(e)&&t.deepExtend(this.options,e),this.currentServiceIndex=-1}function i(e,t,i){var n,o=document.createElement("script");o.type="text/"+(e.type||"javascript"),o.src=e.src||e,o.async=!1,o.onreadystatechange=o.onload=function(){var e=o.readyState;clearTimeout(n),t.done||e&&!/loaded|complete/.test(e)||(t.done=!0,t(),o.onreadystatechange=o.onload=null)},document.body.appendChild(o),n=setTimeout(function(){t.done=!0,t(),o.onreadystatechange=o.onload=null},i)}function n(e,t,i,n,o){var s=new(window.XMLHttpRequest||window.ActiveXObject)("MSXML2.XMLHTTP.3.0");if(s.open(n?"POST":"GET",e,1),s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),Array.isArray(o))for(var r=0,a=o.length;r3&&t(s)}),s.send(n)}function o(e){return new Error("Error ["+(e.code||"UNKNOWN")+"]: "+e.error)}var s={timeout:5e3,services:["freegeoip","ipinfo","maxmind"],serviceDefinitions:{freegeoip:function(){return{url:"//freegeoip.net/json/?callback={callback}",isScript:!0,callback:function(e,t){try{var i=JSON.parse(t);return i.error?o(i):{code:i.country_code}}catch(n){return o({error:"Invalid response ("+n+")"})}}}},ipinfo:function(){return{url:"//ipinfo.io",headers:["Accept: application/json"],callback:function(e,t){try{var i=JSON.parse(t);return i.error?o(i):{code:i.country}}catch(n){return o({error:"Invalid response ("+n+")"})}}}},ipinfodb:function(e){return{url:"//api.ipinfodb.com/v3/ip-country/?key={api_key}&format=json&callback={callback}",isScript:!0,callback:function(e,t){try{var i=JSON.parse(t);return"ERROR"==i.statusCode?o({error:i.statusMessage}):{code:i.countryCode}}catch(n){return o({error:"Invalid response ("+n+")"})}}}},maxmind:function(){return{url:"//js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js",isScript:!0,callback:function(e){return window.geoip2?void geoip2.country(function(t){try{e({code:t.country.iso_code})}catch(i){e(o(i))}},function(t){e(o(t))}):void e(new Error("Unexpected response format. The downloaded script should have exported `geoip2` to the global scope"))}}}}};return e.prototype.getNextService=function(){var e;do e=this.getServiceByIdx(++this.currentServiceIndex);while(this.currentServiceIndex=0,revokable:t.revokable.indexOf(e)>=0,explicitAction:t.explicitAction.indexOf(e)>=0}},e.prototype.applyLaw=function(e,t){var i=this.get(t);return i.hasLaw||(e.enabled=!1),this.options.regionalLaw&&(i.revokable&&(e.revokable=!0),i.explicitAction&&(e.dismissOnScroll=!1,e.dismissOnTimeout=!1)),e},e}(),e.initialise=function(t,i,n){var o=new e.Law(t.law);i||(i=function(){}),n||(n=function(){}),e.getCountryCode(t,function(n){delete t.law,delete t.location,n.code&&(t=o.applyLaw(t,n.code)),i(new e.Popup(t))},function(i){delete t.law,delete t.location,n(i,new e.Popup(t))})},e.getCountryCode=function(t,i,n){if(t.law&&t.law.countryCode)return void i({code:t.law.countryCode});if(t.location){var o=new e.Location(t.location);return void o.locate(function(e){i(e||{})},n)}i({})},e.utils=t,e.hasInitialised=!0,window.cookieconsent=e}}(window.cookieconsent||{}); -------------------------------------------------------------------------------- /pages/configuration.php: -------------------------------------------------------------------------------- 1 | setParam('page', rex_request('page', 'string', null)); 8 | $context->setParam('clang', rex_request('clang', 'string', null)); 9 | $context->setParam('domain', rex_request('domain', 'string', null)); 10 | if (!$context->getParam('clang')) { 11 | $context->setParam('clang', rex_clang::getCurrentId()); 12 | } 13 | if ($context->getParam('domain') === null) { 14 | $domainId = ''; 15 | if (cookie_consent::checkYrewrite()) { 16 | $allDomains = rex_yrewrite::getDomains(); 17 | unset($allDomains['default']); 18 | if (count($allDomains) > 0) { 19 | $curDomain = reset($allDomains); 20 | $domainId = $curDomain->getId(); 21 | } 22 | } 23 | $context->setParam('domain', $domainId); 24 | } 25 | 26 | $clangId = $context->getParam('clang'); 27 | $domainId = $context->getParam('domain'); 28 | 29 | $formElements = []; 30 | 31 | if (cookie_consent::checkYrewrite()) { 32 | $button_label = ''; 33 | $items = []; 34 | foreach (rex_yrewrite::getDomains() as $id => $domain) { 35 | $item = []; 36 | $item['title'] = $domain->getName(); 37 | $item['href'] = $context->getUrl(['domain' => $domain->getId()]); 38 | if ($domain->getId() == $context->getParam('domain')) { 39 | $item['active'] = true; 40 | $button_label = $domain->getName(); 41 | } 42 | $items[] = $item; 43 | } 44 | $fragment = new rex_fragment(); 45 | $fragment->setVar('class', 'rex-language'); 46 | $fragment->setVar('button_label', $button_label); 47 | $fragment->setVar('header', $this->i18n('select_domain')); 48 | $fragment->setVar('items', $items, false); 49 | 50 | $formElements[] = [ 51 | 'label' => '', 52 | 'field' => $fragment->parse('core/dropdowns/dropdown.php'), 53 | ]; 54 | } 55 | 56 | if (rex_clang::count() > 1) { 57 | $formElements[] = [ 58 | 'label' => '', 59 | 'field' => rex_view::clangSwitchAsDropdown($context), 60 | ]; 61 | } 62 | 63 | if (count($formElements) > 0) { 64 | $fragment = new rex_fragment(); 65 | $fragment->setVar('elements', $formElements, false); 66 | $filterContent = $fragment->parse('core/form/container.php'); 67 | 68 | $fragment = new rex_fragment(); 69 | $fragment->setVar('title', $this->i18n('settings_for')); 70 | $fragment->setVar('body', $filterContent, false); 71 | echo $fragment->parse('core/page/section.php'); 72 | } 73 | 74 | $context = rex_context::restore(); 75 | if (!$context->getParam('clang')) { 76 | $clangId = rex_clang::getCurrentId(); 77 | } else { 78 | $clangId = $context->getParam('clang'); 79 | } 80 | 81 | $clang_prefix = rex_clang::get($clangId)->getCode().'_'; 82 | 83 | if (cookie_consent::checkYrewrite()) { 84 | $domain = rex_yrewrite::getDomainById($domainId); 85 | if (!$domain) { 86 | $domain = rex_yrewrite::getDefaultDomain(); 87 | } 88 | $clang_prefix .= $domain->getId(); 89 | $domainName = $domain->getName(); 90 | } else { 91 | $domain = null; 92 | $domainName = ''; 93 | } 94 | $clang_prefix .= '_'; 95 | $domainEnabled = $domain != null; 96 | 97 | $content = ''; 98 | $buttons = ''; 99 | $cookie_consent = rex_addon::get('cookie_consent'); 100 | $cookie_consent_functions = new cookie_consent(); 101 | // Einstellungen speichern 102 | if (rex_post('formsubmit', 'string') == '1') { 103 | $this->setConfig(rex_post('config', [ 104 | [$clang_prefix.'color_background', 'string'], 105 | [$clang_prefix.'color_main_content', 'string'], 106 | [$clang_prefix.'color_button_background', 'string'], 107 | [$clang_prefix.'color_button_content', 'string'], 108 | [$clang_prefix.'position', 'string'], 109 | [$clang_prefix.'main_message', 'string'], 110 | [$clang_prefix.'button_content', 'string'], 111 | [$clang_prefix.'link_content', 'string'], 112 | [$clang_prefix.'iLink', 'string'], 113 | [$clang_prefix.'eLink', 'string'], 114 | [$clang_prefix.'link_target_type', 'string'], 115 | [$clang_prefix.'theme', 'string'], 116 | [$clang_prefix.'select_link', 'string'], 117 | [$clang_prefix.'color_scheme', 'string'], 118 | [$clang_prefix.'mode', 'string'], 119 | [$clang_prefix.'deny_content', 'string'], 120 | [$clang_prefix.'allow_content', 'string'], 121 | [$clang_prefix.'embed_auto', 'string'], 122 | [$clang_prefix.'embed_config', 'string'], 123 | [$clang_prefix.'embed_js', 'string'], 124 | [$clang_prefix.'embed_css', 'string'], 125 | [$clang_prefix.'custom_options', 'string'], 126 | [$clang_prefix.'status', 'string'], 127 | [$clang_prefix.'inherit', 'string'], 128 | ])); 129 | 130 | echo rex_view::success($this->i18n('config_saved_cookie')); 131 | } 132 | 133 | if ($cookie_consent_functions->checkUrl($this->getConfig($clang_prefix.'eLink')) === false) { 134 | $content .= rex_view::warning($this->i18n('url_not_valid')); 135 | $cookie_consent->setConfig($clang_prefix.'eLink', ''); 136 | } 137 | if ($this->getConfig($clang_prefix.'select_link') == 'eLink') { 138 | $cookie_consent->setConfig($clang_prefix.'iLink', ''); 139 | } 140 | if ($this->getConfig($clang_prefix.'select_link') == 'iLink') { 141 | $cookie_consent->setConfig($clang_prefix.'eLink', ''); 142 | } 143 | 144 | /** 145 | * Configuration page. 146 | */ 147 | 148 | $content .= '
'.$this->i18n('status').''; 149 | 150 | $formElements = []; 151 | $n = []; 152 | $n['label'] = ''; 153 | $n['field'] = 'getConfig($clang_prefix.'status')) && $this->getConfig($clang_prefix.'status') == '1' ? ' checked="checked"' : '') . ' value="1" />'; 154 | $formElements[] = $n; 155 | 156 | $fragment = new rex_fragment(); 157 | $fragment->setVar('elements', $formElements, false); 158 | $content .= $fragment->parse('core/form/checkbox.php'); 159 | 160 | // Inherit Config 161 | $inheritSelect = new rex_select(); 162 | $inheritSelect->setId('cookie_consent_inherit'); 163 | $inheritSelect->setAttribute('class', 'form-control selectpicker'); 164 | $inheritSelect->setName('config['.$clang_prefix.'inherit]'); 165 | $inheritSelect->setSelected($this->getConfig($clang_prefix.'inherit')); 166 | $inheritSelect->addOption('-', ''); 167 | if (isset($allDomains) && count($allDomains) > 1) { 168 | foreach ($allDomains as $d) { 169 | foreach (rex_clang::getAll() as $lang) { 170 | $value = $lang->getCode().'_'.$d->getId().'_'; 171 | if ($clang_prefix != $value) { 172 | $inheritSelect->addOption($d->getName() . ' - ' . $lang->getName(), $value); 173 | } 174 | } 175 | } 176 | } else { 177 | foreach (rex_clang::getAll() as $lang) { 178 | $value = $lang->getCode().'__'; 179 | if ($clang_prefix != $value) { 180 | $inheritSelect->addOption($lang->getName(), $lang->getCode().'__'); 181 | } 182 | } 183 | } 184 | $n = [ 185 | 'label' => '', 186 | 'field' => $inheritSelect->get(), 187 | ]; 188 | $formElements = [$n]; 189 | 190 | $fragment = new rex_fragment(); 191 | $fragment->setVar('elements', $formElements, false); 192 | $content .= $fragment->parse('core/form/container.php'); 193 | 194 | $content .= '