modification du nom des cookies de consentement
This commit is contained in:
parent
9485c2ba5a
commit
12bec0e14f
@ -230,15 +230,18 @@ core.start = function() {
|
|||||||
expires = "expires=" + expires.toUTCString();
|
expires = "expires=" + expires.toUTCString();
|
||||||
// Crée le cookie d'acceptation Google Analytics si nécessaire
|
// Crée le cookie d'acceptation Google Analytics si nécessaire
|
||||||
<?php $analytics = $this->getData(['config', 'seo', 'analyticsId']);?>
|
<?php $analytics = $this->getData(['config', 'seo', 'analyticsId']);?>
|
||||||
<?php if( $analytics !== null AND $analytics !=='' ){ ?>
|
<?php if( $analytics !== null AND $analytics !=='' ){
|
||||||
|
$cookieName = 'ZWII_COOKIE_GA_CONSENT'.str_replace('_index.php','',str_replace( '/','_',$_SERVER['PHP_SELF']));?>
|
||||||
if(ga.checked){
|
if(ga.checked){
|
||||||
document.cookie = "ZWII_COOKIE_GA_CONSENT=true;" + expires +";"+ samesite;
|
document.cookie = "<?php echo $cookieName; ?>=true;" + expires +";"+ samesite;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
document.cookie = "ZWII_COOKIE_GA_CONSENT=false;" + expires +";"+ samesite;
|
document.cookie = "<?php echo $cookieName; ?>=false;" + expires +";"+ samesite;
|
||||||
}
|
}
|
||||||
<?php } ?>
|
<?php }
|
||||||
document.cookie = "ZWII_COOKIE_CONSENT=true;" + expires +";"+ samesite;
|
$cookieName = 'ZWII_COOKIE_CONSENT'.str_replace('_index.php','',str_replace( '/','_',$_SERVER['PHP_SELF']));
|
||||||
|
?>
|
||||||
|
document.cookie = "<?php echo $cookieName; ?>=true;" + expires +";"+ samesite;
|
||||||
});
|
});
|
||||||
$(".cookieBox .cookieClose").on("click", function() {
|
$(".cookieBox .cookieClose").on("click", function() {
|
||||||
$(this).parents("#cookieConsent").fadeOut();
|
$(this).parents("#cookieConsent").fadeOut();
|
||||||
|
@ -1172,8 +1172,9 @@ class common {
|
|||||||
* Affiche le script Google Analytics
|
* Affiche le script Google Analytics
|
||||||
*/
|
*/
|
||||||
public function showAnalytics() {
|
public function showAnalytics() {
|
||||||
|
$cookieName = 'ZWII_COOKIE_GA_CONSENT'.str_replace('_index.php','',str_replace( '/','_',$_SERVER['PHP_SELF']));
|
||||||
if( !empty($code = $this->getData(['config', 'seo', 'analyticsId'])) &&
|
if( !empty($code = $this->getData(['config', 'seo', 'analyticsId'])) &&
|
||||||
$this->getInput('ZWII_COOKIE_GA_CONSENT') === 'true') {
|
$this->getInput($cookieName) === 'true') {
|
||||||
echo '<!-- Global site tag (gtag.js) - Google Analytics -->
|
echo '<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id='. $code .'"></script>
|
<script async src="https://www.googletagmanager.com/gtag/js?id='. $code .'"></script>
|
||||||
<script>
|
<script>
|
||||||
@ -1189,7 +1190,8 @@ class common {
|
|||||||
* Affiche le consentement aux cookies
|
* Affiche le consentement aux cookies
|
||||||
*/
|
*/
|
||||||
public function showCookies() {
|
public function showCookies() {
|
||||||
if($this->getInput('ZWII_COOKIE_CONSENT') !== 'true' AND $this->getData(['config','cookieConsent']) === true){ ?>
|
$cookieName = 'ZWII_COOKIE_CONSENT'.str_replace('_index.php','',str_replace( '/','_',$_SERVER['PHP_SELF']));
|
||||||
|
if($this->getInput($cookieName) !== 'true' AND $this->getData(['config','cookieConsent']) === true){ ?>
|
||||||
<div id="cookieConsent">
|
<div id="cookieConsent">
|
||||||
<div class="cookieBox"><div class="cookieClose">X</div></div>
|
<div class="cookieBox"><div class="cookieClose">X</div></div>
|
||||||
<?php $analytics = $this->getData(['config', 'seo', 'analyticsId']);?>
|
<?php $analytics = $this->getData(['config', 'seo', 'analyticsId']);?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user