Renommer la varaible i18n de active à enable

This commit is contained in:
Fred Tempez 2021-09-29 16:40:25 +02:00
parent 206ab7f9a1
commit f633f177d6
6 changed files with 24 additions and 13 deletions

View File

@ -253,7 +253,7 @@ class common {
* - L'auto-détection est active * - L'auto-détection est active
*/ */
if ( $this->getData(['config', 'i18n', 'active']) === true if ( $this->getData(['config', 'i18n', 'enable']) === true
AND $this->getData(['config', 'i18n','scriptGoogle']) === true AND $this->getData(['config', 'i18n','scriptGoogle']) === true
AND $this->getData(['config', 'i18n','autoDetect']) === true AND $this->getData(['config', 'i18n','autoDetect']) === true
AND $this->getInput('ZWII_I18N_SITE') !== '' AND $this->getInput('ZWII_I18N_SITE') !== ''
@ -1179,7 +1179,7 @@ class common {
* @param Page par défaut * @param Page par défaut
*/ */
public function showContent() { public function showContent() {
if ($this->getData(['config', 'i18n', 'active']) === true) { if ($this->getData(['config', 'i18n', 'enable']) === true) {
echo $this->showi18n('Site'); echo $this->showi18n('Site');
} }
if( if(
@ -1200,7 +1200,7 @@ class common {
* La traduction est active et le site n'est pas en français. * La traduction est active et le site n'est pas en français.
* La fonction est activée. * La fonction est activée.
*/ */
if ( $this->getData(['config', 'i18n', 'active']) === true if ( $this->getData(['config', 'i18n', 'enable']) === true
AND $this->getData(['config', 'i18n','scriptGoogle']) === true AND $this->getData(['config', 'i18n','scriptGoogle']) === true
AND $this->getData(['config', 'i18n','showCredits']) === true AND $this->getData(['config', 'i18n','showCredits']) === true
AND AND
@ -1566,7 +1566,7 @@ class common {
} }
// Retourne les items du menu // Retourne les items du menu
echo '<ul class="navMain" id="menuLeft">' . $itemsLeft . '</ul><ul class="navMain" id="menuRight">' . $itemsRight . '</ul>'; echo '<ul class="navMain" id="menuLeft">' . $itemsLeft . '</ul><ul class="navMain" id="menuRight">' . $itemsRight . '</ul>';
if ($this->getData(['config', 'i18n', 'active']) === true) { if ($this->getData(['config', 'i18n', 'enable']) === true) {
echo $this->showi18n('Nav'); echo $this->showi18n('Nav');
} }
} }
@ -1808,7 +1808,7 @@ class common {
$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') .'" data-tippy-content="Gérer les fichiers" data-lity>' . template::ico('folder') . '</a></li>';
} }
if($this->getUser('group') >= self::GROUP_ADMIN) { if($this->getUser('group') >= self::GROUP_ADMIN) {
if ($this->getData(['config', 'i18n', 'active']) === true) { if ($this->getData(['config', 'i18n', 'enable']) === true) {
$rightItems .= '<li><a href="' . helper::baseUrl() . 'translate" data-tippy-content="Gestion des langues">' . template::ico('flag') . '</a></li>'; $rightItems .= '<li><a href="' . helper::baseUrl() . 'translate" data-tippy-content="Gestion des langues">' . template::ico('flag') . '</a></li>';
} }
$rightItems .= '<li><a href="' . helper::baseUrl() . 'theme" data-tippy-content="Personnaliser les thèmes">' . template::ico('brush') . '</a></li>'; $rightItems .= '<li><a href="' . helper::baseUrl() . 'theme" data-tippy-content="Personnaliser les thèmes">' . template::ico('brush') . '</a></li>';
@ -2586,7 +2586,7 @@ class core extends common {
// Chargement de la bibliothèque googtrans // Chargement de la bibliothèque googtrans
// Le script de traduction est sélectionné // Le script de traduction est sélectionné
if ($this->getData(['config', 'i18n', 'active']) === true) { if ($this->getData(['config', 'i18n', 'enable']) === true) {
if ( $this->getData(['config', 'i18n','scriptGoogle']) === true if ( $this->getData(['config', 'i18n','scriptGoogle']) === true
// et la traduction de la langue courante est automatique // et la traduction de la langue courante est automatique
AND ( $this->getInput('ZWII_I18N_SCRIPT') !== '' AND ( $this->getInput('ZWII_I18N_SCRIPT') !== ''

View File

@ -595,7 +595,7 @@ if ($this->getData(['core', 'dataVersion']) < 11000) {
$this->setData(['config','autoDisconnect',true]); $this->setData(['config','autoDisconnect',true]);
// Mettre à jour les données de langue // Mettre à jour les données de langue
$this->setData(['config', 'i18n','active', true ]); $this->setData(['config', 'i18n', 'enable', true ]);
$this->setData(['config', 'i18n','scriptGoogle', false ]); $this->setData(['config', 'i18n','scriptGoogle', false ]);
$this->setData(['config', 'i18n','showCredits', false ]); $this->setData(['config', 'i18n','showCredits', false ]);
$this->setData(['config', 'i18n','autoDetect', false ]); $this->setData(['config', 'i18n','autoDetect', false ]);
@ -642,4 +642,15 @@ if ($this->getData(['core', 'dataVersion']) < 11000) {
$this->setData(['config','seo','robots',true]); $this->setData(['config','seo','robots',true]);
$this->setData(['core', 'dataVersion', 11000]); $this->setData(['core', 'dataVersion', 11000]);
}
// Version 11.0.10
if ($this->getData(['core', 'dataVersion']) < 11010) {
// Renommer une variable
$data = $this->getData(['config', 'i18n', 'active']);
$this->deleteData(['config', 'i18n', 'active']);
$this->setData(['config', 'i18n', 'enable', $data ]);
$this->setData(['core', 'dataVersion', 11010]);
} }

View File

@ -412,7 +412,7 @@ class config extends common {
'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true) 'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true)
] ]
]); ]);
$this->setData(['config', 'i18n', 'active', $this->getInput('configI18n',helper::FILTER_BOOLEAN) ]); $this->setData(['config', 'i18n', 'enable', $this->getInput('configI18n',helper::FILTER_BOOLEAN) ]);
// Générer robots.txt et sitemap // Générer robots.txt et sitemap
$this->generateFiles(); $this->generateFiles();
// Valeurs en sortie // Valeurs en sortie
@ -495,7 +495,7 @@ class config extends common {
'captcha' => $this->getInput('configAdvancedConnectCaptcha',helper::FILTER_BOOLEAN), 'captcha' => $this->getInput('configAdvancedConnectCaptcha',helper::FILTER_BOOLEAN),
], ],
'i18n' => [ 'i18n' => [
'active' => $this->getData(['config', 'i18n', 'active']) 'enable' => $this->getData(['config', 'i18n', 'enable'])
] ]
] ]
]); ]);

View File

@ -69,7 +69,7 @@
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php echo template::checkbox('configI18n', true, 'Activer la gestion des langues étrangères', [ <?php echo template::checkbox('configI18n', true, 'Activer la gestion des langues étrangères', [
'checked' => $this->getData(['config', 'i18n', 'active']), 'checked' => $this->getData(['config', 'i18n', 'enable']),
'help'=> 'Une nouvelle icône apparaîtra dans la barre d\'administration. Consultez l\'aide de la page concernée pour en apprendre plus.' 'help'=> 'Une nouvelle icône apparaîtra dans la barre d\'administration. Consultez l\'aide de la page concernée pour en apprendre plus.'
]); ?> ]); ?>
</div> </div>

View File

@ -37,7 +37,7 @@ class init extends common {
'captcha' => true 'captcha' => true
], ],
"i18n" => [ "i18n" => [
"active"=> true, "enable"=> true,
"scriptGoogle"=> false, "scriptGoogle"=> false,
"showCredits"=> false, "showCredits"=> false,
"autoDetect"=> false, "autoDetect"=> false,
@ -52,7 +52,7 @@ class init extends common {
] ]
], ],
'core' => [ 'core' => [
'dataVersion' => 11000, 'dataVersion' => 11010,
'lastBackup' => 0, 'lastBackup' => 0,
'lastClearTmp' => 0, 'lastClearTmp' => 0,
'lastAutoUpdate' => 0, 'lastAutoUpdate' => 0,

View File

@ -124,7 +124,7 @@ class translate extends common {
// Enregistrement des données // Enregistrement des données
$this->setData(['config','i18n', [ $this->setData(['config','i18n', [
'active' => $this->getData(['config', 'i18n', 'active']), 'enable' => $this->getData(['config', 'i18n', 'enable']),
'scriptGoogle' => $script, 'scriptGoogle' => $script,
'showCredits' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) ? $this->getInput('translateCredits', helper::FILTER_BOOLEAN) : false, 'showCredits' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) ? $this->getInput('translateCredits', helper::FILTER_BOOLEAN) : false,
'autoDetect' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) ? $this->getInput('translateAutoDetect', helper::FILTER_BOOLEAN) : false, 'autoDetect' => $this->getInput('translateScriptGoogle', helper::FILTER_BOOLEAN) ? $this->getInput('translateAutoDetect', helper::FILTER_BOOLEAN) : false,