diff --git a/core/class/router.class.php b/core/class/router.class.php index ad9ee8a0..d1a1939d 100644 --- a/core/class/router.class.php +++ b/core/class/router.class.php @@ -521,7 +521,6 @@ class core extends common file_exists(self::DATA_DIR . $key . '/page.json')) { $pagesId = json_decode(file_get_contents(self::DATA_DIR . $key . '/page.json'), true); if (array_key_exists($this->getUrl(0), $pagesId['page'])) { - //setcookie('ZWII_CONTENT', $key, time() + 3600, helper::baseUrl(false, false), '', true, helper::isHttps()); $_SESSION['ZWII_CONTENT'] = $key; self::$i18nContent = $key; \setlocale(LC_ALL, self::$i18nContent . '.UTF8'); diff --git a/core/core.js.php b/core/core.js.php index 62e8dadf..23496076 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -532,15 +532,15 @@ $(document).ready(function () { var langSelected = $(this).val(); var langSelected = langSelected.split("/"); // Lit le cookie de langue - // var langCookie = getCookie('ZWII_CONTENT'); - var langCookie = "getInput('ZWII_CONTENT');?>"; + var langSession = ""; + console.log(langSession); // Découpe l'URL pour exclure le changement de page avec le thème var url = window.location; var currentUrl = url.href.split("/"); // Change si différent, corrige le problème avec le thème et le rechargement de la langue. if ((currentUrl !== "?theme" || currentUrl !== "theme") && - langSelected[6] !== langCookie + langSelected[6] !== langSession ) { //$(location).attr("href", langUrl); var select = document.getElementById("barSelectLanguage"); diff --git a/core/core.php b/core/core.php index a41d46e7..98858373 100644 --- a/core/core.php +++ b/core/core.php @@ -102,7 +102,6 @@ class common public static $inputBefore = []; public static $inputNotices = []; public static $importNotices = []; - public static $captchaNotices = []; public static $coreNotices = []; public $output = [ 'access' => true, @@ -217,8 +216,6 @@ class common private $url = ''; // Données de site private $user = []; - // Drapeau de sauvegarde - private $saveFlag = false; // Descripteur de données Entrées / Sorties // Liste ici tous les fichiers de données @@ -314,6 +311,9 @@ class common $this->input['_COOKIE'] = $_COOKIE; } + // Extraction de la sesion + $this->input['_SESSION'] = $_SESSION; + // Déterminer la langue du contenu du site if (isset($_SESSION['ZWII_CONTENT'])) { // Déterminé par le cookie @@ -321,13 +321,6 @@ class common \setlocale(LC_ALL, self::$i18nContent . '.UTF8'); } - // Déterminer la langue du contenu du site - if (isset($this->input['_COOKIE']['ZWII_CONTENT'])) { - // Déterminé par le cookie - //self::$i18nContent = $this->input['_COOKIE']['ZWII_CONTENT']; - \setlocale(LC_ALL, self::$i18nContent . '.UTF8'); - } - // Instanciation de la classe des entrées / sorties // Récupère les descripteurs foreach ($this->dataFiles as $keys => $value) { @@ -436,7 +429,6 @@ class common ); stream_context_set_default($context); } - } diff --git a/core/module/install/install.php b/core/module/install/install.php index 62cac2d6..cbd14589 100644 --- a/core/module/install/install.php +++ b/core/module/install/install.php @@ -63,9 +63,6 @@ class install extends common ]); } - //Nettoyage anciennes installations - helper::deleteCookie('ZWII_CONTENT'); - // Liste des langues UI disponibles if (is_dir(self::I18N_DIR)) { foreach ($this->getData(['languages']) as $lang => $value) { @@ -106,7 +103,6 @@ class install extends common // par défaut le contenu est la langue d'installation self::$i18nContent = self::$i18nUI; - //setcookie('ZWII_CONTENT', self::$i18nContent, time() + 3600, helper::baseUrl(false, false), '', helper::isHttps(), true); $_SESSION['ZWII_CONTENT'] = self::$i18nContent; // Double vérification pour le mot de passe diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php index bf1c8f40..192f8b8d 100644 --- a/core/module/translate/translate.php +++ b/core/module/translate/translate.php @@ -622,10 +622,8 @@ class translate extends common array_key_exists($lang, self::$languages) === true ) { - // Nettoyer le cookie - helper::deleteCookie('ZWII_CONTENT'); - // Stocker le choix - //setcookie('ZWII_CONTENT', $lang, time() + 3600, helper::baseUrl(false, false), '', true, helper::isHttps()); + + // Stocker la sélection $_SESSION['ZWII_CONTENT'] = $lang; }