From 185f501e77f6f3415844863738ea70d84f4385a5 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Thu, 2 Mar 2023 09:27:45 +0100 Subject: [PATCH 1/3] 12300 delete disabled language from database --- core/module/translate/translate.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php index 81ad96ca..47fcc1b4 100644 --- a/core/module/translate/translate.php +++ b/core/module/translate/translate.php @@ -175,14 +175,21 @@ class translate extends common // Langues installées $installedUI = $this->getData(['languages']); + // Check si la langue est bien disponible sinon la supprime de la BDD + if ($installedUI) { + foreach ($installedUI as $key => $value) + if (file_exists(self::I18N_DIR . $key . '.json' ) === false ) { + $this->deleteData(['languages', $key]); + } + } + // Langues disponibles avec la mise à jour $store = json_decode(file_get_contents('core/module/install/ressource/i18n/languages.json'), true); $store = $store['languages']; - if ($installedUI) { - foreach($installedUI as $key => $value) { - if ($store[$key]['version'] > $value['version']) { - $this->setData(['languages', $key, $store[$key]]); - } + + foreach($installedUI as $key => $value) { + if ($store[$key]['version'] > $value['version']) { + $this->setData(['languages', $key, $store[$key]]); } } From 482de27ef8e88e27741a7caac74cd2e34d6225d2 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Thu, 2 Mar 2023 14:17:12 +0100 Subject: [PATCH 2/3] gr_GR --- core/core.php | 2 +- core/include/update.inc.php | 20 +------------------ .../filemanager/lang/{el_GR.php => gr_GR.php} | 0 core/vendor/filemanager/lang/languages.php | 2 +- module/blog/i18n/{el_GR.json => gr_GR.json} | 0 module/form/i18n/{el_GR.json => gr_GR.json} | 0 .../gallery/i18n/{el_GR.json => gr_GR.json} | 0 module/news/i18n/{el_GR.json => gr_GR.json} | 0 .../i18n/{el_GR.json => gr_GR.json} | 0 module/search/i18n/{el_GR.json => gr_GR.json} | 0 10 files changed, 3 insertions(+), 21 deletions(-) rename core/vendor/filemanager/lang/{el_GR.php => gr_GR.php} (100%) rename module/blog/i18n/{el_GR.json => gr_GR.json} (100%) rename module/form/i18n/{el_GR.json => gr_GR.json} (100%) rename module/gallery/i18n/{el_GR.json => gr_GR.json} (100%) rename module/news/i18n/{el_GR.json => gr_GR.json} (100%) rename module/redirection/i18n/{el_GR.json => gr_GR.json} (100%) rename module/search/i18n/{el_GR.json => gr_GR.json} (100%) diff --git a/core/core.php b/core/core.php index c76e4ffa..2cf63b5a 100644 --- a/core/core.php +++ b/core/core.php @@ -181,7 +181,7 @@ class common //'fa' => 'فارسی', 'fr_FR' => 'Français', 'he_IL' => 'Hebrew (Israel)', - 'el_GR' => 'Ελληνικά', + 'gr_GR' => 'Ελληνικά', 'hr' => 'Hrvatski jezik', 'hu_HU' => 'Magyar', 'id' => 'Bahasa Indonesia', diff --git a/core/include/update.inc.php b/core/include/update.inc.php index e78e4fde..4c02a60b 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -931,25 +931,7 @@ if ($this->getData(['core', 'dataVersion']) < 12000) { if ($this->getData(['core', 'dataVersion']) < 12300) { // Valeur par défaut du délai de recherche de mise à jour en ligne $this->setData(['config', 'autoUpdateDelay', 86400]); - // Changement de nom des fichiers de langue greque - if (file_exists('core/module/install/ressource/i18n/gr_GR.json')) { - unlink('core/module/install/ressource/i18n/gr_GR.json'); - } - if (file_exists(self::I18N_DIR . 'gr_GR.json')) { - rename(self::I18N_DIR . 'gr_GR.json', self::I18N_DIR . 'el_GR.json'); - } - $d = $this->getData(['languages', 'gr_GR']); - if ($d) { - $this->setData(['languages', 'el_GR', $d]); - $this->deleteData(['languages', 'gr_GR']); - } - // Idem pour les modules - $moduleIds = ['blog', 'news', 'gallery', 'search', 'redirection', 'form']; - foreach ($moduleIds as $key => $value) { - if (file_exists('module/' . $value . '/i18n/gr_GR.json')) { - unlink('module/' . $value . '/i18n/gr_GR.json'); - } - } + // Nettoyage de flatPickr if (is_dir('core/vendor/flatpickr')) { diff --git a/core/vendor/filemanager/lang/el_GR.php b/core/vendor/filemanager/lang/gr_GR.php similarity index 100% rename from core/vendor/filemanager/lang/el_GR.php rename to core/vendor/filemanager/lang/gr_GR.php diff --git a/core/vendor/filemanager/lang/languages.php b/core/vendor/filemanager/lang/languages.php index 2ecc4c98..86614068 100644 --- a/core/vendor/filemanager/lang/languages.php +++ b/core/vendor/filemanager/lang/languages.php @@ -2,7 +2,7 @@ return array( 'de' => 'Deutsch', - 'el_GR' => 'ελληνικά', + 'gr_GR' => 'ελληνικά', 'en_EN' => 'English', 'es' => 'Español', 'fr_FR' => 'Français', diff --git a/module/blog/i18n/el_GR.json b/module/blog/i18n/gr_GR.json similarity index 100% rename from module/blog/i18n/el_GR.json rename to module/blog/i18n/gr_GR.json diff --git a/module/form/i18n/el_GR.json b/module/form/i18n/gr_GR.json similarity index 100% rename from module/form/i18n/el_GR.json rename to module/form/i18n/gr_GR.json diff --git a/module/gallery/i18n/el_GR.json b/module/gallery/i18n/gr_GR.json similarity index 100% rename from module/gallery/i18n/el_GR.json rename to module/gallery/i18n/gr_GR.json diff --git a/module/news/i18n/el_GR.json b/module/news/i18n/gr_GR.json similarity index 100% rename from module/news/i18n/el_GR.json rename to module/news/i18n/gr_GR.json diff --git a/module/redirection/i18n/el_GR.json b/module/redirection/i18n/gr_GR.json similarity index 100% rename from module/redirection/i18n/el_GR.json rename to module/redirection/i18n/gr_GR.json diff --git a/module/search/i18n/el_GR.json b/module/search/i18n/gr_GR.json similarity index 100% rename from module/search/i18n/el_GR.json rename to module/search/i18n/gr_GR.json From 117d67f9c42cb5016dc11fdcc486afede8ff4089 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Thu, 2 Mar 2023 14:26:45 +0100 Subject: [PATCH 3/3] Install depreciation --- core/module/install/install.php | 7 ------- core/module/page/page.php | 9 ++++++++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/module/install/install.php b/core/module/install/install.php index 8c6f700e..9e579b43 100644 --- a/core/module/install/install.php +++ b/core/module/install/install.php @@ -234,13 +234,6 @@ class install extends common // Fixe l'adresse from pour les envois d'email $this->setData(['config', 'smtp', 'from', 'no-reply@' . str_replace('www.', '', $_SERVER['HTTP_HOST'])]); - // Création de la liste des pages et du sitemap uniquement en FR, autres sites sont vides. - // Mise à jour de la liste des pages pour TinyMCE - $this->listPages(); - - // Créer sitemap - $this->createSitemap(); - // Valeurs en sortie $this->addOutput([ 'redirect' => helper::baseUrl(true) . $this->getData(['locale', 'homePageId']), diff --git a/core/module/page/page.php b/core/module/page/page.php index c9c14031..52b525bc 100644 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -553,6 +553,13 @@ class page extends common self::$pagesBarId[$parentPageId] = $this->getData(['page', $parentPageId, 'title']); } } + + // Met à jour le site map + $this->createSitemap('all'); + + // Mise à jour de la liste des pages pour TinyMCE + $this->listPages(); + // Valeurs en sortie $this->addOutput([ 'title' => $this->getData(['page', $this->getUrl(2), 'title']), @@ -571,7 +578,7 @@ class page extends common { // Soumission du formulaire if ($this->isPost()) { - $css = $this->getInput('pageCssEditorContent') === null ? '': $this->getInput('pageCssEditorContent'); + $css = $this->getInput('pageCssEditorContent') === null ? '' : $this->getInput('pageCssEditorContent'); // Enregistre le CSS $this->setData([ 'page', $this->getUrl(2),