File manager dans la langue de l'UI + variable default devient interface

This commit is contained in:
Fred Tempez 2022-09-20 11:35:55 +02:00
parent 25f74054ff
commit 75fc5a8233
9 changed files with 19 additions and 16 deletions

View File

@ -306,7 +306,7 @@ class common {
}
// Langue de l'administration
self::$i18n = $this->getData(['config', 'i18n', 'default']);
self::$i18n = $this->getData(['config', 'i18n', 'interface']);
// La langue par défaut du contenu est celle du site si le cookie est absent.
self::$i18n = (empty(self::$i18n) || is_null(self::$i18n)) ? self::$i18n = 'fr' : self::$i18n ;
@ -1466,7 +1466,7 @@ class common {
$this->getData(['user', $this->getUser('id') , 'files']) === true
) {
$items .= '<wbr>' . template::ico('folder', [
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR.'core.json'),
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR.'core.json') . '&lang=' . $this->getData(['config', 'i18n', 'interface']),
'margin' => 'all',
'attr' => 'data-lity',
'help' => 'Fichiers du site'
@ -1595,7 +1595,7 @@ class common {
$this->getData(['user', $this->getUser('id') , 'files']) === true
) {
$itemsRight .= '<li>' . template::ico('folder', [
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR.'core.json'),
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR.'core.json') . '&lang=' . $this->getData(['config', 'i18n', 'interface']),
'attr' => 'data-lity',
'help' => 'Fichiers du site'
]). '</li>';
@ -2021,7 +2021,7 @@ class common {
// Items de droite
$rightItems = '';
if($this->getUser('group') >= self::GROUP_MODERATOR) {
$rightItems .= '<li><a href="' . helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR.'core.json') .'" data-tippy-content="Gérer les fichiers" data-lity>' . template::ico('folder') . '</a></li>';
$rightItems .= '<li><a href="' . helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR.'core.json') . '&lang=' . $this->getData(['config', 'i18n', 'interface']) . '" data-tippy-content="Gérer les fichiers" data-lity>' . template::ico('folder') . '</a></li>';
}
if($this->getUser('group') >= self::GROUP_ADMIN) {
$rightItems .= '<li>' . template::ico('brush', [

View File

@ -894,7 +894,7 @@ if ($this->getData(['core', 'dataVersion']) < 11600) {
unlink('core/vendor/i18n/translation.js');
}
// Langue de l'interface
$this->setData(['config', 'i18n', 'default', 'fr']);
$this->setData(['config', 'i18n', 'interface', 'fr']);
// Mise à jour
$this->setData(['core', 'dataVersion', 11600]);

View File

@ -495,7 +495,7 @@ class config extends common {
'redirectLogin' => $this->getInput('connectRedirectLogin',helper::FILTER_BOOLEAN)
],
'i18n' => [
'default' => $this->getData(['config', 'i18n', 'default']),
'interface' => $this->getData(['config', 'i18n', 'default']),
'fr' => $this->getData(['config', 'i18n', 'fr']),
'de' => $this->getData(['config', 'i18n', 'de']),
'en' => $this->getData(['config', 'i18n', 'en']),

View File

@ -42,7 +42,7 @@ class init extends common {
'redirectLogin' => true
],
'i18n' => [
'default' => 'fr',
'interface' => 'fr',
'fr'=> 'none',
'de'=> 'none',
'en'=> 'none',

View File

@ -218,7 +218,7 @@ class translate extends common {
]);
// Sauvegarder les langues de contenu
$this->setData(['config', 'i18n', [
'default' => $this->getInput('translateI18n'),
'interface' => $this->getInput('translateI18n'),
'fr' => $this->getInput('translateFR'),
'de' => $this->getInput('translateDE'),
'en' => $this->getInput('translateEN'),

View File

@ -46,13 +46,13 @@
<div class="col12">
<div class="block" id="flagsWrapper">
<h4>
<?php echo template::topic('Interface de Zwii'); ?>
<?php echo template::topic('Interface'); ?>
</h4>
<div class="row">
<div class="col4 offset4">
<?php echo template::select('translateI18n', $module::$i18nFiles, [
'label' => 'Traductions installées',
'selected' => $this->getData(['config', 'i18n' , 'default']),
'selected' => $this->getData(['config', 'i18n' , 'interface']),
]); ?>
</div>
</div>

View File

@ -11,12 +11,15 @@ if (function_exists('mb_regex_encoding')) {
}
ob_start('mb_output_handler');
date_default_timezone_set('Europe/Paris');
setlocale(LC_CTYPE, 'fr_FR'); //correct transliteration
// Lire la langue installée
$tab = json_decode(file_get_contents('../../../site/data/config.json'), true);
$lang = $tab['config']['i18n']['interface'];
setlocale(LC_CTYPE, $lang); //correct transliteration
/* Lecture du groupe de l'utilisateur connecté pour attribuer les droits et les dossiers */
$userId = $_COOKIE['ZWII_USER_ID'];
$json = file_get_contents('../../../site/data/user.json');
$tab = json_decode($json, true);
$tab = json_decode(file_get_contents('../../../site/data/user.json'), true);
$group = $tab['user'][$userId]['group'];
$uploadDir = '/site/file/source/';
$currentPath = '../../../site/file/source/';
@ -300,7 +303,7 @@ $config = array(
| default language file name
|--------------------------------------------------------------------------
*/
'default_language' => "fr_FR",
'default_language' => 'fr_FR',
/*
|--------------------------------------------------------------------------

View File

@ -328,7 +328,7 @@
"Interface": "",
"Contenu du site": "",
"Traductions installées": "",
"Interface de Zwii": "",
"Interface": "",
"Paramétres": "",
"Maintenance": "",
"Scripts externes": "",

View File

@ -328,7 +328,7 @@
"Interface": "",
"Contenu du site": "",
"Traductions installées": "",
"Interface de Zwii": "",
"Interface": "",
"Paramétres": "",
"Maintenance": "",
"Scripts externes": "",