diff --git a/core/core.js.php b/core/core.js.php
index d54b0c71..56a548dd 100644
--- a/core/core.js.php
+++ b/core/core.js.php
@@ -223,20 +223,17 @@ core.start = function() {
var expires = "expires=" + e.toUTCString();
// Crée le cookie d'acceptation Google Analytics si l'ID a été saisie
- // Traitement du retour de la checkbox
- if ($("#googleAnalytics").is(":checked")) {
- // L'URL du serveur faut TRUE
- document.cookie = "ZWII_COOKIE_GA_CONSENT=" + "" + ";" + domain + ";" + path + ";" + samesite + ";" + expires;
- } else {
- document.cookie = "ZWII_COOKIE_GA_CONSENT=false;" + domain + ";" + path + ";" + samesite + ";" + expires;
- }
- // Traitement du retour de la checkbox
- if ($("#googleTranslate").is(":checked")) {
- // L'URL du serveur faut TRUE
- document.cookie = "ZWII_COOKIE_GT_CONSENT=" + "" + ";" + domain + ";" + path + ";" + samesite + ";" + expires;
- } else {
- document.cookie = "ZWII_COOKIE_GT_CONSENT=false;" + domain + ";" + path + ";" + samesite + ";" + expires;
- document.cookie = "googtrans=fr/fr;" + domain + ";" + path + ";" + samesite + ";" + expires;
+ var analytics = "getData(['config', 'seo', 'analyticsId']);?>";
+ // l'Id GA est défini dans la configuration, afficher la checkbox d'acceptation
+ if( analytics.length > 0){
+ // Traitement du retour de la checkbox
+ if ($("#googleAnalytics").is(":checked")) {
+ // L'URL du serveur faut TRUE
+ document.cookie = "ZWII_COOKIE_GA_CONSENT=" + "" + ";" + domain + ";" + path + ";" + samesite + ";" + expires;
+ } else {
+ document.cookie = "ZWII_COOKIE_GA_CONSENT=false;" + domain + ";" + path + ";" + samesite + ";" + expires;
+ }
+
}
// Stocke le cookie d'acceptation
@@ -279,7 +276,7 @@ core.start = function() {
* Commande de gestion des cookies dans le footer
*/
- $(".footerShowCookieConsent").on("click", function() {
+ $("#footerLinkCookie").on("click", function() {
$("#cookieConsent").removeClass("displayNone");
});
diff --git a/core/core.php b/core/core.php
index bb921a62..27e6f82b 100644
--- a/core/core.php
+++ b/core/core.php
@@ -256,7 +256,6 @@ class common {
if ( $this->getData(['config', 'i18n', 'enable']) === true
AND $this->getData(['config', 'i18n','scriptGoogle']) === true
AND $this->getData(['config', 'i18n','autoDetect']) === true
- AND $this->getInput('ZWII_COOKIE_GT_CONSENT') === $_SERVER['PHP_SELF']
AND $this->getInput('ZWII_I18N_SITE') !== ''
AND !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) )
{
@@ -1188,15 +1187,15 @@ class common {
}
/**
- * Affiche le consentement des cookies
+ * Affiche le consentement aux cookies
*/
public function showCookies() {
- // Gestion des cookies interne active
+ // Gestion des cookies intégrée
if ($this->getData(['config', 'cookieConsent']) === true )
{
- // Détermine si le bloc doit être affiché selon la validité du cookie : l'URL du serveur faut TRUE
- // Pour éviter la propagation (à revoir avec Sylvain)
+ // Détermine si le bloc doit être affiché selon la validité du cookie
+ // L'URL du serveur faut TRUE
$item = '
getInput('ZWII_COOKIE_CONSENT') !== $_SERVER['PHP_SELF'] ? '>' : ' class="displayNone">';
// Bouton de fermeture
@@ -1208,26 +1207,17 @@ class common {
$item .= '
' . $this->getData(['locale', 'cookies', 'cookiesZwiiText']) . '
';
// Formulaire de réponse
$item .= '
';
- // Mentions légales si une page est définie
+ // mentions légales si la page est définie
$legalPage = $this->getData(['locale', 'legalPageId']);
if ($legalPage !== 'none') {
$item .= '
' . $this->getData(['locale', 'cookies', 'cookiesLinkMlText']) . '
';
@@ -1502,7 +1492,7 @@ class common {
$items .= '';
// Affichage du lien de connexion
if(
@@ -1763,9 +1753,8 @@ class common {
}
// Retourne les items du menu
echo '
' . $itemsRight;
- if ($this->getData(['config', 'i18n', 'enable']) === true
- ) {
- echo $this->showi18n();
+ if ($this->getData(['config', 'i18n', 'enable']) === true) {
+ echo $this->showi18n();
}
echo '
';
}
@@ -2125,7 +2114,6 @@ class common {
OR (
$this->getData(['config', 'i18n','scriptGoogle']) === true
AND $this->getData(['config', 'i18n',$key]) === 'script'
- AND $this->getInput('ZWII_COOKIE_GT_CONSENT') === $_SERVER['PHP_SELF']
)
) {
if (
@@ -2803,34 +2791,33 @@ class core extends common {
}
// Chargement de la bibliothèque googtrans
+
// Le script de traduction est sélectionné
if ($this->getData(['config', 'i18n', 'enable']) === true) {
- // Trad auto
if ( $this->getData(['config', 'i18n','scriptGoogle']) === true
// et la traduction de la langue courante est automatique
- AND ( $this->getInput('ZWII_I18N_SCRIPT') !== ''
- // Ou traduction automatique
- OR $this->getData(['config', 'i18n','autoDetect']) === true
- )
- // Le cookie est accepté par le client
- AND $this->getInput('ZWII_COOKIE_GT_CONSENT') === $_SERVER['PHP_SELF']
- // Cas des pages d'administration
- // Pas connecté
- AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
- AND $this->getUrl(1) !== 'login'
- // Ou connecté avec option active
- OR ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
- AND $this->getData(['config', 'i18n','admin']) === true
- )
+ AND ( $this->getInput('ZWII_I18N_SCRIPT') !== ''
+ // Ou traduction automatique
+ OR $this->getData(['config', 'i18n','autoDetect']) === true
+ )
+ // Cas des pages d'administration
+ // Pas connecté
+ AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
+ AND $this->getUrl(1) !== 'login'
+ // Ou connecté avec option active
+ OR ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
+ AND $this->getData(['config', 'i18n','admin']) === true
+ )
- ) {
+ ) {
// Paramètre du script
setrawcookie("googtrans", '/fr/'. $this->getInput('ZWII_I18N_SCRIPT') , time() + 3600, helper::baseUrl());
// Chargement de la librairie
$this->addOutput([
'vendor' => array_merge($this->output['vendor'], ['i18n'])
]);
- }
+
+ }
}
// Erreurs
if($access === 'login') {
diff --git a/core/include/update.inc.php b/core/include/update.inc.php
index 8a0aed33..04f161be 100644
--- a/core/include/update.inc.php
+++ b/core/include/update.inc.php
@@ -707,7 +707,6 @@ if ($this->getData(['core', 'dataVersion']) < 11200) {
$this->setData(['locale', 'cookies', 'cookieTitleText', 'Gérer les cookies']);
$this->setData(['locale', 'cookies', 'cookieLinkMlText', 'Consulter les mentions légales']);
$this->setData(['locale', 'cookies', 'cookieCheckboxGaText', 'Autorisation des cookies Google Analytics']);
- $this->setData(['locale', 'cookies', 'cookieCheckboxGtText', 'Autorisation des cookies Google Translate']);
$this->setData(['locale', 'cookies', 'cookiesButtonText', 'J\'ai compris']);
// Mise à jour
diff --git a/core/module/config/config.php b/core/module/config/config.php
index b4f949e9..9e5f58a6 100644
--- a/core/module/config/config.php
+++ b/core/module/config/config.php
@@ -445,7 +445,6 @@ class config extends common {
'cookiesTitleText' => $this->getInput('localeCookiesTitleText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])),
'cookiesLinkMlText' => $this->getInput('localeCookiesLinkMlText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])),
'cookiesCheckboxGaText' => $this->getInput('localeCookiesCheckboxGaText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])),
- 'cookiesCheckboxGtText' => $this->getInput('localeCookiesCheckboxGtText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])),
'cookiesFooterText' => $this->getInput('localeCookiesFooterText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])),
'cookiesButtonText' =>$this->getInput('localeCookiesButtonText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent']))
]
diff --git a/core/module/config/view/locale/locale.php b/core/module/config/view/locale/locale.php
index 047ee134..5056975a 100644
--- a/core/module/config/view/locale/locale.php
+++ b/core/module/config/view/locale/locale.php
@@ -200,30 +200,19 @@
'Saisissez le message pour les cookies déposés par Google Analytics, le consentement est requis.',
- 'label' => 'Cookies Google Analytics et Translate',
+ 'label' => 'Cookies Google Analytics',
'value' => $this->getData(['locale', 'cookies', 'cookiesGaText']),
'placeHolder' => '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.'
]); ?>
+
-
-
- 'Saisissez le texte de la case à cocher Google Analytics.',
- 'label' => 'Checkbox Google Analytics',
- 'value' => $this->getData(['locale', 'cookies', 'cookiesCheckboxGaText']),
- 'placeHolder' => 'Autorisation des cookies Google Analytics'
- ]); ?>
-
-
- 'Saisissez le texte de la case à cocher Google Translate.',
- 'label' => 'Checkbox Google Translate',
- 'value' => $this->getData(['locale', 'cookies', 'cookiesCheckboxGtText']),
- 'placeHolder' => 'Autorisation des cookies Google Translate'
- ]); ?>
-
-
+ 'Saisissez le texte de la case à cocher Google Analytics.',
+ 'label' => 'Checkbox Google Analytics',
+ 'value' => $this->getData(['locale', 'cookies', 'cookiesCheckboxGaText']),
+ 'placeHolder' => 'Autorisation des cookies Google Analytics'
+ ]); ?>
diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php
index 46d81f2d..04ba053e 100644
--- a/core/module/install/ressource/defaultdata.php
+++ b/core/module/install/ressource/defaultdata.php
@@ -80,7 +80,6 @@ class init extends common {
'cookiesTitleText' => 'Gérer les cookies',
'cookiesLinkMlText' => 'Consulter les mentions légales',
'cookiesCheckboxGaText' => 'Autorisation des cookies Google Analytics',
- 'cookiesCheckboxGtText' => 'Autorisation des cookies Google Translate',
'cookiesFooterText' => 'Confidentialité',
'cookiesButtonText' => 'J\'ai compris'
]