forked from ZwiiCMS-Team/ZwiiCMS
Enable language selector into admin bar
This commit is contained in:
parent
b7266092fa
commit
2739909b6c
@ -253,14 +253,19 @@ core.start = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sélection d'une langue du site
|
* Sélection d'une langue du site
|
||||||
|
*/
|
||||||
$("#barSelectLanguage").on("change", function() {
|
$("select#barSelectLanguage").on("change", function() {
|
||||||
var langUrl = $(this).val();
|
var langUrl = $(this).val();
|
||||||
|
// Récupère la langue sélectionnée dans l'élément 6 d'un tableau
|
||||||
|
var lang = langUrl.split("/");
|
||||||
|
// Lit le cookie de langue
|
||||||
var langCookie = getCookie('ZWII_CONTENT');
|
var langCookie = getCookie('ZWII_CONTENT');
|
||||||
if (langUrl !== langCookie) {
|
// Change si différent, corrige le problème avec le thème et le rechargement de la langue.
|
||||||
|
if (lang[6] !== langCookie) {
|
||||||
$(location).attr("href", langUrl);
|
$(location).attr("href", langUrl);
|
||||||
}
|
}
|
||||||
});*/
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Choix de page dans la barre de membre
|
* Choix de page dans la barre de membre
|
||||||
*/
|
*/
|
||||||
|
@ -2142,13 +2142,13 @@ class common
|
|||||||
if (is_dir(self::DATA_DIR . $key)) {
|
if (is_dir(self::DATA_DIR . $key)) {
|
||||||
$c++;
|
$c++;
|
||||||
$location = helper::baseUrl() . 'translate/content/' . $key ;
|
$location = helper::baseUrl() . 'translate/content/' . $key ;
|
||||||
$leftItem .= '<option value="' . $location . '" ' . ($key === self::$i18nContent ? 'selected' : '') . '>' . $value . '</option>';
|
$leftItem .= '<option name="' . $key . '" value="' . $location . '" ' . ($key === self::$i18nContent ? 'selected' : '') . '>' . $value . '</option>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($c > 1 ) {
|
if ($c > 1 ) {
|
||||||
//$leftItems .= '<li><select id="barSelectLanguage">';
|
$leftItems .= '<li><select id="barSelectLanguage">';
|
||||||
//$leftItems .= $leftItem;
|
$leftItems .= $leftItem;
|
||||||
//$leftItems .= '</select></li>';
|
$leftItems .= '</select></li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user