From 052a2b1746f1b4d8f0fd30fd1a53cba139d8e681 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 14 Jun 2021 16:44:26 +0200 Subject: [PATCH] Revert "config i18n supp la varaible enable" This reverts commit c97a0847a84338e79f1ae50e154ab89d63424ab8. --- core/core.php | 12 ++++++------ core/module/config/config.php | 5 +++-- core/module/config/view/index/index.php | 2 +- core/module/install/ressource/defaultdata.php | 3 +-- core/module/translate/translate.php | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/core/core.php b/core/core.php index 4a3243ce..47f818fb 100755 --- a/core/core.php +++ b/core/core.php @@ -252,7 +252,7 @@ class common { * - L'auto-détection est active */ - if ( $this->getData(['config', 'i18n']) === true + if ( $this->getData(['config', 'i18n', 'enabled']) === true AND $this->getData(['config', 'i18n','scriptGoogle']) === true AND $this->getData(['config', 'i18n','autoDetect']) === true AND $this->getInput('ZWII_I18N_SITE') !== '' @@ -1745,7 +1745,7 @@ class core extends common { // Chargement de la bibliothèque googtrans // Le script de traduction est sélectionné - if ($this->getData(['config', 'i18n']) === true) { + if ($this->getData(['config', 'i18n', 'enabled']) === true) { if ( $this->getData(['config', 'i18n','scriptGoogle']) === true // et la traduction de la langue courante est automatique AND ( $this->getInput('ZWII_I18N_SCRIPT') !== '' @@ -1892,7 +1892,7 @@ class layout extends common { * @param Page par défaut */ public function showContent() { - if ($this->getData(['config', 'i18n']) === true) { + if ($this->getData(['config', 'i18n', 'enabled']) === true) { echo $this->showi18n('Site'); } if( @@ -1913,7 +1913,7 @@ class layout extends common { * La traduction est active et le site n'est pas en français. * La fonction est activée. */ - if ( $this->getData(['config', 'i18n']) === true + if ( $this->getData(['config', 'i18n', 'enabled']) === true AND $this->getData(['config', 'i18n','scriptGoogle']) === true AND $this->getData(['config', 'i18n','showCredits']) === true AND @@ -2279,7 +2279,7 @@ class layout extends common { } // Retourne les items du menu echo ''; - if ($this->getData(['config', 'i18n']) === true) { + if ($this->getData(['config', 'i18n', 'enabled']) === true) { echo $this->showi18n('Nav'); } } @@ -2522,7 +2522,7 @@ class layout extends common { } if($this->getUser('group') >= self::GROUP_ADMIN) { $rightItems .= '
  • ' . template::ico('brush') . '
  • '; - if ($this->getData(['config', 'i18n']) === true) { + if ($this->getData(['config', 'i18n', 'enabled']) === true) { $rightItems .= '
  • ' . template::ico('flag') . '
  • '; } $rightItems .= '
  • ' . template::ico('puzzle') . '
  • '; diff --git a/core/module/config/config.php b/core/module/config/config.php index 0119b80e..c9b2c6fb 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -401,7 +401,7 @@ class config extends common { 'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true) ] ]); - $this->setData(['config', 'i18n', $this->getInput('configI18n',helper::FILTER_BOOLEAN) ]); + $this->setData(['config', 'i18n', 'enabled', $this->getInput('configI18n',helper::FILTER_BOOLEAN) ]); // Générer robots.txt et sitemap $this->generateFiles(); // Valeurs en sortie @@ -480,7 +480,8 @@ class config extends common { 'log' => $this->getInput('configAdvancedConnectLog',helper::FILTER_BOOLEAN), 'captcha' => $this->getInput('configAdvancedConnectCaptcha',helper::FILTER_BOOLEAN), ], - 'i18n' => [ $this->getData(['config', 'i18n']) + 'i18n' => [ + 'enabled' => $this->getData(['config', 'i18n', 'enabled']) ] ] ]); diff --git a/core/module/config/view/index/index.php b/core/module/config/view/index/index.php index 2e702ae2..94d32920 100644 --- a/core/module/config/view/index/index.php +++ b/core/module/config/view/index/index.php @@ -69,7 +69,7 @@
    $this->getData(['config', 'i18n']), + 'checked' => $this->getData(['config', 'i18n', 'enabled']), 'help'=> 'Une nouvelle icône apparaîtra dans la barre d\'administration. Consultez l\'aide de la page concernée pour en apprendre plus.' ]); ?>
    diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 05258581..f118179d 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -32,8 +32,7 @@ class init extends common { 'attempt' => 3, 'log' => false, 'captcha' => true - ], - 'i18n' => false + ] ], 'core' => [ 'dataVersion' => 10602, diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php index 0c3e5ba8..5349240d 100644 --- a/core/module/translate/translate.php +++ b/core/module/translate/translate.php @@ -129,7 +129,7 @@ class translate extends common { } // Enregistrement des données $this->setData(['config','i18n', [ - 'enabled' => $this->getData(['config', 'i18n']), + 'enabled' => $this->getData(['config', 'i18n', 'enabled']), 'scriptGoogle' => $script, '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,