From 7d3634cd50b4ea5d64c5ba8c3a35eaed4cd3d039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Mon, 22 Nov 2021 19:32:32 +0100 Subject: [PATCH] Cooike Sylvain + croix --- core/core.js.php | 3 ++- core/core.php | 14 +++++++++----- core/layout/main.php | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) 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();?>