From c97a0847a84338e79f1ae50e154ab89d63424ab8 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 7 Jun 2021 19:29:14 +0200 Subject: [PATCH] config i18n supp la varaible enable --- 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 e236e7d6..bf67c4b6 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', 'enabled']) === true + if ( $this->getData(['config', 'i18n']) === true AND $this->getData(['config', 'i18n','scriptGoogle']) === true AND $this->getData(['config', 'i18n','autoDetect']) === true AND $this->getInput('ZWII_I18N_SITE') !== '' @@ -2387,7 +2387,7 @@ class core extends common { // Chargement de la bibliothèque googtrans // Le script de traduction est sélectionné - if ($this->getData(['config', 'i18n', 'enabled']) === true) { + if ($this->getData(['config', 'i18n']) === true) { if ( $this->getData(['config', 'i18n','scriptGoogle']) === true // et la traduction de la langue courante est automatique AND ( $this->getInput('ZWII_I18N_SCRIPT') !== '' @@ -2534,7 +2534,7 @@ class layout extends common { * @param Page par défaut */ public function showContent() { - if ($this->getData(['config', 'i18n', 'enabled']) === true) { + if ($this->getData(['config', 'i18n']) === true) { echo $this->showi18n('Site'); } if( @@ -2555,7 +2555,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', 'enabled']) === true + if ( $this->getData(['config', 'i18n']) === true AND $this->getData(['config', 'i18n','scriptGoogle']) === true AND $this->getData(['config', 'i18n','showCredits']) === true AND @@ -2921,7 +2921,7 @@ class layout extends common { } // Retourne les items du menu echo ''; - if ($this->getData(['config', 'i18n', 'enabled']) === true) { + if ($this->getData(['config', 'i18n']) === true) { echo $this->showi18n('Nav'); } } @@ -3165,7 +3165,7 @@ class layout extends common { if($this->getUser('group') >= self::GROUP_ADMIN) { $rightItems .= '
  • ' . template::ico('users') . '
  • '; $rightItems .= '
  • ' . template::ico('brush') . '
  • '; - if ($this->getData(['config', 'i18n', 'enabled']) === true) { + if ($this->getData(['config', 'i18n']) === true) { $rightItems .= '
  • ' . template::ico('flag') . '
  • '; } $rightItems .= '
  • ' . template::ico('puzzle') . '
  • '; diff --git a/core/module/config/config.php b/core/module/config/config.php index c9b2c6fb..0119b80e 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', 'enabled', $this->getInput('configI18n',helper::FILTER_BOOLEAN) ]); + $this->setData(['config', 'i18n', $this->getInput('configI18n',helper::FILTER_BOOLEAN) ]); // Générer robots.txt et sitemap $this->generateFiles(); // Valeurs en sortie @@ -480,8 +480,7 @@ class config extends common { 'log' => $this->getInput('configAdvancedConnectLog',helper::FILTER_BOOLEAN), 'captcha' => $this->getInput('configAdvancedConnectCaptcha',helper::FILTER_BOOLEAN), ], - 'i18n' => [ - 'enabled' => $this->getData(['config', 'i18n', 'enabled']) + 'i18n' => [ $this->getData(['config', 'i18n']) ] ] ]); diff --git a/core/module/config/view/index/index.php b/core/module/config/view/index/index.php index 94d32920..2e702ae2 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', 'enabled']), + 'checked' => $this->getData(['config', 'i18n']), '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 f118179d..05258581 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -32,7 +32,8 @@ 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 5349240d..0c3e5ba8 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']), + 'enabled' => $this->getData(['config', 'i18n']), '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,