PageTemplate/Fixup
* only need to ask for consent if analytics is enabled * fixes #483
This commit is contained in:
parent
53374972ef
commit
15338dc503
1 changed files with 7 additions and 7 deletions
|
|
@ -467,13 +467,8 @@ class PageTemplate
|
|||
// refresh vars that shouldn't be cached
|
||||
private function update() : void
|
||||
{
|
||||
// analytics + consent
|
||||
// not set or declined
|
||||
if (empty($_COOKIE['consent']))
|
||||
$this->hasAnalytics = false;
|
||||
|
||||
// not set
|
||||
if (!isset($_COOKIE['consent']))
|
||||
// not set, but should be
|
||||
if (!isset($_COOKIE['consent']) && $this->hasAnalytics)
|
||||
{
|
||||
$this->addScript(SC_CSS_FILE, 'css/consent.css', SC_FLAG_NOCACHE);
|
||||
$this->addScript(SC_JS_FILE, 'js/consent.js', SC_FLAG_NOCACHE);
|
||||
|
|
@ -481,6 +476,11 @@ class PageTemplate
|
|||
$this->consentFooter = true;
|
||||
}
|
||||
|
||||
// analytics + consent
|
||||
// not set or declined
|
||||
if (empty($_COOKIE['consent']))
|
||||
$this->hasAnalytics = false;
|
||||
|
||||
// js + css
|
||||
$this->prepareScripts();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue