Paramètrage consentement cookies
This commit is contained in:
parent
12bec0e14f
commit
bf9e887c00
@ -243,7 +243,7 @@ core.start = function() {
|
|||||||
?>
|
?>
|
||||||
document.cookie = "<?php echo $cookieName; ?>=true;" + expires +";"+ samesite;
|
document.cookie = "<?php echo $cookieName; ?>=true;" + expires +";"+ samesite;
|
||||||
});
|
});
|
||||||
$(".cookieBox .cookieClose").on("click", function() {
|
$("#cookieConsent .cookieClose").on("click", function() {
|
||||||
$(this).parents("#cookieConsent").fadeOut();
|
$(this).parents("#cookieConsent").fadeOut();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1193,20 +1193,19 @@ class common {
|
|||||||
$cookieName = 'ZWII_COOKIE_CONSENT'.str_replace('_index.php','',str_replace( '/','_',$_SERVER['PHP_SELF']));
|
$cookieName = 'ZWII_COOKIE_CONSENT'.str_replace('_index.php','',str_replace( '/','_',$_SERVER['PHP_SELF']));
|
||||||
if($this->getInput($cookieName) !== 'true' AND $this->getData(['config','cookieConsent']) === true){ ?>
|
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="cookieClose">X</div>
|
||||||
|
<h3><?php echo $this->getData(['config', 'cookies', 'cookiesTitleText']); ?></h3>
|
||||||
<?php $analytics = $this->getData(['config', 'seo', 'analyticsId']);?>
|
<?php $analytics = $this->getData(['config', 'seo', 'analyticsId']);?>
|
||||||
<p>Ce site <?php echo helper::baseUrl(false); ?> utilise des cookies nécessaires à son fonctionnement,
|
<p><?php echo $this->getData(['config', 'cookies', 'cookiesZwiiText']); ?></p>
|
||||||
ils permettent de fluidifier son fonctionnement par exemple en mémorisant les données de connexion, la langue que vous avez choisie
|
|
||||||
ou la validation de ce message.
|
|
||||||
<?php $legalPage = $this->getData(['locale','legalPageId']) ==='none'? 'mentions-legales' : $this->getData(['locale','legalPageId']); ?>
|
<?php $legalPage = $this->getData(['locale','legalPageId']) ==='none'? 'mentions-legales' : $this->getData(['locale','legalPageId']); ?>
|
||||||
<a href=" <?php echo helper::baseUrl() . $legalPage ?> ">Plus d'informations</a></p>
|
<p><a href=" <?php echo helper::baseUrl() . $legalPage ?> "><?php echo $this->getData(['config', 'cookies', 'cookiesLinkMlText']); ?></a></p>
|
||||||
<?php if( $analytics !== null AND $analytics !=='' ){ ?>
|
<?php if( $analytics !== null AND $analytics !=='' ){ ?>
|
||||||
<p>Il utilise également des cookies permettant de réaliser des statistiques de visites pour améliorer votre expérience utilisateur, ces cookies déposés par Google Analytics ont besoin de votre consentement.</p>
|
<p><?php echo $this->getData(['config', 'cookies', 'cookiesGaText']); ?></p>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<form method="POST" action="" id="cookieForm">
|
<form method="POST" action="" id="cookieForm">
|
||||||
<?php if( $analytics !== null AND $analytics !=='' ){ ?>
|
<?php if( $analytics !== null AND $analytics !=='' ){ ?>
|
||||||
<input type="checkbox" id="googleAnalytics" name="googleAnalytics" value="GA">
|
<input type="checkbox" id="googleAnalytics" name="googleAnalytics" value="GA">
|
||||||
<label for="googleAnalytics"> J'accepte les cookies Google Analytics</label> <?php } ?><br><br>
|
<label for="googleAnalytics"><?php echo $this->getData(['config', 'cookies', 'cookiesCheckboxGaText']); ?></label> <?php } ?><br><br>
|
||||||
<input type="submit" id="cookieConsentConfirm" value="Valider">
|
<input type="submit" id="cookieConsentConfirm" value="Valider">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -999,7 +999,7 @@ footer #footerSocials .zwiico-github:hover {
|
|||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cookieConsentConfirm, #cookieConsentRefuse {
|
#cookieConsentConfirm {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
background: #666;
|
background: #666;
|
||||||
@ -1008,21 +1008,16 @@ footer #footerSocials .zwiico-github:hover {
|
|||||||
transition: background .3s ease-out;
|
transition: background .3s ease-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cookieConsentConfirm:hover, #cookieConsentRefuse:hover {
|
#cookieConsentConfirm:hover {
|
||||||
background: #777;
|
background: #777;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cookieBox {
|
#cookieConsent .cookieClose {
|
||||||
position: relative;
|
position: absolute;
|
||||||
width: 15px;
|
right: 5px;
|
||||||
height: 15px;
|
top: 0px;
|
||||||
border: 1px solid blue;
|
font-size: 1.5em;
|
||||||
}
|
cursor: pointer;
|
||||||
.cookieBox .cookieClose {
|
|
||||||
position: absolute;
|
|
||||||
right: 2px;
|
|
||||||
top: -2px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Bloc */
|
/* Bloc */
|
||||||
|
@ -503,6 +503,13 @@ class config extends common {
|
|||||||
'it' => $this->getData(['config', 'i18n', 'it']),
|
'it' => $this->getData(['config', 'i18n', 'it']),
|
||||||
'nl' => $this->getData(['config', 'i18n', 'nl']),
|
'nl' => $this->getData(['config', 'i18n', 'nl']),
|
||||||
'pt' => $this->getData(['config', 'i18n', 'pt'])
|
'pt' => $this->getData(['config', 'i18n', 'pt'])
|
||||||
|
],
|
||||||
|
'cookies' => [
|
||||||
|
'cookiesZwiiText' => $this->getInput('connectCookiesZwiiText', helper::FILTER_STRING_LONG),
|
||||||
|
'cookiesGaText' => $this->getInput('connectCookiesGaText', helper::FILTER_STRING_LONG),
|
||||||
|
'cookiesTitleText' => $this->getInput('connectCookiesTitleText', helper::FILTER_STRING_SHORT),
|
||||||
|
'cookiesLinkMlText' => $this->getInput('connectCookiesLinkMlText', helper::FILTER_STRING_SHORT),
|
||||||
|
'cookiesCheckboxGaText' => $this->getInput('connectCookiesCheckboxGaText', helper::FILTER_STRING_SHORT)
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
@ -114,4 +114,60 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col12">
|
||||||
|
<div class="block">
|
||||||
|
<h4>Cookies
|
||||||
|
<span id="specialeHelpButton" class="helpDisplayButton">
|
||||||
|
<a href="https://doc.zwiicms.fr/cookies" target="_blank">
|
||||||
|
<?php echo template::ico('help', 'left');?>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</h4>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col12">
|
||||||
|
<?php echo template::textarea('connectCookiesZwiiText', [
|
||||||
|
'help' => 'Saisissez le message pour les cookies déposés par ZwiiCMS, nécessaires au fonctionnement et qui ne nécessitent pas de consentement.',
|
||||||
|
'label' => 'Cookies Zwii',
|
||||||
|
'value' => $this->getData(['config', 'cookies', 'cookiesZwiiText'])
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col12">
|
||||||
|
<?php echo template::textarea('connectCookiesGaText', [
|
||||||
|
'help' => 'Saisissez le message pour les cookies déposés par Google Analytics, le consentement est requis.',
|
||||||
|
'label' => 'Cookies Google Analytics',
|
||||||
|
'value' => $this->getData(['config', 'cookies', 'cookiesGaText'])
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col6">
|
||||||
|
<?php echo template::text('connectCookiesTitleText', [
|
||||||
|
'help' => 'Saisissez le titre de la fenêtre de gestion des cookies.',
|
||||||
|
'label' => 'Titre de la fenêtre',
|
||||||
|
'value' => $this->getData(['config', 'cookies', 'cookiesTitleText'])
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col6">
|
||||||
|
<?php echo template::text('connectCookiesLinkMlText', [
|
||||||
|
'help' => 'Saisissez le texte du lien vers les mentions légales.',
|
||||||
|
'label' => 'Lien vers mentions légales',
|
||||||
|
'value' => $this->getData(['config', 'cookies', 'cookiesLinkMlText'])
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col6">
|
||||||
|
<?php echo template::text('connectCookiesCheckboxGaText', [
|
||||||
|
'help' => 'Saisissez le texte de la case à cocher Google Analytics.',
|
||||||
|
'label' => 'Checkbox Google Analytics',
|
||||||
|
'value' => $this->getData(['config', 'cookies', 'cookiesCheckboxGaText'])
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user