$_SESSION WIP
This commit is contained in:
parent
17d4e7f3be
commit
0e5f77daa5
@ -1166,8 +1166,8 @@ class layout extends common
|
||||
is_dir(self::DATA_DIR . $lang)
|
||||
) {
|
||||
if (
|
||||
(isset($_COOKIE['ZWII_CONTENT'])
|
||||
and $_COOKIE['ZWII_CONTENT'] === $lang
|
||||
(isset($_SESSION['ZWII_CONTENT'])
|
||||
and $_SESSION['ZWII_CONTENT'] === $lang
|
||||
)
|
||||
) {
|
||||
$select = ' class="i18nFlagSelected" ';
|
||||
|
@ -494,8 +494,8 @@ class template
|
||||
$lang = $langId;
|
||||
break;
|
||||
case 'selected':
|
||||
if (isset($_COOKIE['ZWII_CONTENT'])) {
|
||||
$lang = $_COOKIE['ZWII_CONTENT'];
|
||||
if (isset($_SESSION['ZWII_CONTENT'])) {
|
||||
$lang = $_SESSION['ZWII_CONTENT'];
|
||||
} else {
|
||||
$lang = 'fr_FR';
|
||||
}
|
||||
|
@ -532,7 +532,8 @@ $(document).ready(function () {
|
||||
var langSelected = $(this).val();
|
||||
var langSelected = langSelected.split("/");
|
||||
// Lit le cookie de langue
|
||||
var langCookie = getCookie('ZWII_CONTENT');
|
||||
// var langCookie = getCookie('ZWII_CONTENT');
|
||||
var langCookie = "<?php echo $this->getInput('ZWII_CONTENT');?>";
|
||||
// Découpe l'URL pour exclure le changement de page avec le thème
|
||||
var url = window.location;
|
||||
var currentUrl = url.href.split("/");
|
||||
|
@ -202,7 +202,7 @@ class translate extends common
|
||||
if (is_dir(self::DATA_DIR . $key)) {
|
||||
if (self::$i18nUI === $key) {
|
||||
$messageLocale = helper::translate('Langue par défaut');
|
||||
} elseif (isset($_COOKIE['ZWII_CONTENT']) && $_COOKIE['ZWII_CONTENT'] === $key) {
|
||||
} elseif (isset($_SESSION['ZWII_CONTENT']) && $_SESSION['ZWII_CONTENT'] === $key) {
|
||||
$messageLocale = helper::translate('Langue du site sélectionnée');
|
||||
} else {
|
||||
$messageLocale = '';
|
||||
|
Loading…
Reference in New Issue
Block a user