diff --git a/core/core.js.php b/core/core.js.php index a93327a0..0d9f7e64 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -237,7 +237,8 @@ core.start = function() { if( analytics.length > 0){ document.cookie = "ZWII_COOKIE_CONSENT_GA=" + $("#googleAnalytics").prop("checked") + ";" + domain + ";" + path + ";" + samesite + ";" + expires; } - document.cookie = "ZWII_COOKIE_CONSENT=true;" + domain + ";" + path + ";" + samesite + ";" + expires; + //document.cookie = "ZWII_COOKIE_CONSENT=true;" + domain + ";" + path + ";" + samesite + ";" + expires; + document.cookie = "ZWII_COOKIE_CONSENT=;" + domain + ";" + path + ";" + samesite + ";" + expires; }); $("#cookieConsent .cookieClose").on("click", function() { diff --git a/core/core.php b/core/core.php index ba52687e..50b43db5 100644 --- a/core/core.php +++ b/core/core.php @@ -1190,14 +1190,17 @@ class common { * Affiche le consentement aux cookies */ public function showCookies() { - //$cookieName = 'ZWII_COOKIE_CONSENT'.str_replace('_index.php','',str_replace( '/','_',$_SERVER['PHP_SELF'])); - if($this->getInput('ZWII_COOKIE_CONSENT') !== 'true' AND $this->getData(['config','cookieConsent']) === true){ + + if( $this->getInput('ZWII_COOKIE_CONSENT') !== str_replace('index.php','',str_replace( '/','',$_SERVER['PHP_SELF'])) AND + $this->getData(['config','cookieConsent']) === true + ){ $analytics = $this->getData(['config', 'seo', 'analyticsId']); $legalPage = $this->getData(['locale','legalPageId']) ==='none'? 'mentions-legales' : $this->getData(['locale','legalPageId']); - $item = '
'; - $item .= '
X
'; + $item .= '
'; + $item .= template::ico('cancel'); + $item .= '
'; $item .= '

'. $this->getData(['config', 'cookies', 'cookiesTitleText']) . '

'; $item .= '

' . $this->getData(['config', 'cookies', 'cookiesZwiiText']) . '

'; $item .= '

' . $this->getData(['config', 'cookies', 'cookiesLinkMlText']) . '

'; @@ -1212,8 +1215,9 @@ class common { $item .= '

'; $item .= ''; $item .= '
'; + echo $item; } - echo $item; + } /** diff --git a/core/layout/main.php b/core/layout/main.php index 6ad6327f..d17b3c5a 100644 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -174,7 +174,7 @@ showSection();?> - + showFooter();?> @@ -183,7 +183,7 @@
- + showCookies(); ?> showScript();?>