PageTemplate/Consent
* fix showing consent overlay when cookie is already set
This commit is contained in:
parent
a17d4a5528
commit
face95c1dd
1 changed files with 6 additions and 4 deletions
|
|
@ -470,16 +470,18 @@ class PageTemplate
|
|||
private function update() : void
|
||||
{
|
||||
// analytics + consent
|
||||
if ($this->hasAnalytics && !isset($_COOKIE['consent']))
|
||||
// not set or declined
|
||||
if (empty($_COOKIE['consent']))
|
||||
$this->hasAnalytics = false;
|
||||
|
||||
// not set
|
||||
if (!isset($_COOKIE['consent']))
|
||||
{
|
||||
$this->addScript(SC_CSS_FILE, 'css/consent.css', SC_FLAG_NOCACHE);
|
||||
$this->addScript(SC_JS_FILE, 'js/consent.js', SC_FLAG_NOCACHE);
|
||||
|
||||
$this->consentFooter = true;
|
||||
$this->hasAnalytics = false;
|
||||
}
|
||||
else if ($this->hasAnalytics && !$_COOKIE['consent'])
|
||||
$this->hasAnalytics = false;
|
||||
|
||||
// js + css
|
||||
$this->prepareScripts();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue