diff --git a/CHANGES.md b/CHANGES.md index e49dcef..48b8045 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,7 +14,9 @@ - Blog 6.8 et News 4.7 : les dates s'adaptent automatiquement à la traduction rédigée, - Blog 6.8 et News 4.7 : amélioration de la navigation entre les articles, - Theme / Footer : amélioration, 'Qui est en ligne ?' s'affiche dans la langue de rédaction du site avec les labels réglables dans Configuration / Localisation. + - Scripts : les fichiers body.inc.html et head.inc.html sont renommés body.inc.php et head.inc.php - Correction : + - Langues : la langue originale de rédaction du site choisie à l'installation peut être modifiée - Slider 4.8 / Configuration : les liens sur les images étaient modifiés au changement de l'ordre des pages. ## Version 4.4.10 de Deltacms diff --git a/core/core.php b/core/core.php index fa0d7f1..b1dcd5d 100644 --- a/core/core.php +++ b/core/core.php @@ -1255,8 +1255,8 @@ class common { in_array($this->getUrl(1),$pattern) ) ) { // Pleine page en mode configuration $this->showContent(); - if (file_exists(self::DATA_DIR . 'body.inc.html')) { - include( self::DATA_DIR . 'body.inc.html'); + if (file_exists(self::DATA_DIR . 'body.inc.php')) { + include( self::DATA_DIR . 'body.inc.php'); } if($this->getData(['config', 'statislite', 'enable'])){ if(is_dir("./module/statislite")) include "./module/statislite/include/stat.php"; @@ -1290,8 +1290,8 @@ class common { */ echo '
'; $this->showContent(); - if (file_exists(self::DATA_DIR . 'body.inc.html')) { - include(self::DATA_DIR . 'body.inc.html'); + if (file_exists(self::DATA_DIR . 'body.inc.php')) { + include(self::DATA_DIR . 'body.inc.php'); } if($this->getData(['config', 'statislite', 'enable'])){ if(is_dir("./module/statislite")) include "./module/statislite/include/stat.php"; diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 9c84372..c493cfe 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -164,6 +164,8 @@ if ($this->getData(['core', 'dataVersion']) < 4501) { $this->setData(['locale', 'editorLabel', $groupWhoIs[2] ]); $this->setData(['locale', 'moderatorLabel', $groupWhoIs[3] ]); $this->setData(['locale', 'administratorLabel', $groupWhoIs[4] ]); + if( is_file('./site/data/body.inc.html')) rename('./site/data/body.inc.html', './site/data/body.inc.php' ); + if( is_file('./site/data/head.inc.html')) rename('./site/data/head.inc.html', './site/data/head.inc.php' ); $this->setData(['core', 'dataVersion', 4501]); } ?> diff --git a/core/layout/main.php b/core/layout/main.php index 080363f..0871174 100644 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -32,7 +32,7 @@ else { echo ''; } AND $this->getData(['module', $this->getUrl(0), 'config', 'feeds']) === TRUE ): ?> + if (file_exists(self::DATA_DIR .'head.inc.php')) include(self::DATA_DIR .'head.inc.php'); ?> isPost()) { // Ecrire les fichiers de script if ($this->geturl(2) === 'head') { - file_put_contents(self::DATA_DIR . 'head.inc.html',$this->getInput('configScriptHead',null)); + file_put_contents(self::DATA_DIR . 'head.inc.php',$this->getInput('configScriptHead',null)); } if ($this->geturl(2) === 'body') { - file_put_contents(self::DATA_DIR . 'body.inc.html',$this->getInput('configScriptBody',null)); + file_put_contents(self::DATA_DIR . 'body.inc.php',$this->getInput('configScriptBody',null)); } // Valeurs en sortie $this->addOutput([ diff --git a/core/module/config/view/script/script.php b/core/module/config/view/script/script.php index 0329c7b..990bd2c 100644 --- a/core/module/config/view/script/script.php +++ b/core/module/config/view/script/script.php @@ -23,7 +23,7 @@ echo template::formOpen('configScript'); ?>
file_exists( self::DATA_DIR . 'head.inc.html') ? file_get_contents (self::DATA_DIR . 'head.inc.html') : '' , + 'value' => file_exists( self::DATA_DIR . 'head.inc.php') ? file_get_contents (self::DATA_DIR . 'head.inc.php') : '' , 'class' => 'editor' ]); ?>
@@ -33,7 +33,7 @@ echo template::formOpen('configScript'); ?>
file_exists( self::DATA_DIR . 'body.inc.html') ? file_get_contents (self::DATA_DIR . 'body.inc.html') : '' , + 'value' => file_exists( self::DATA_DIR . 'body.inc.php') ? file_get_contents (self::DATA_DIR . 'body.inc.php') : '' , 'class' => 'editor' ]); ?>
diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php index f39e555..c17119d 100644 --- a/core/module/translate/translate.php +++ b/core/module/translate/translate.php @@ -124,6 +124,16 @@ class translate extends common { // Soumission du formulaire if($this->isPost()) { + // Si la langue originale du site est modifiée + if( $this->getData(['config', 'i18n', 'langBase']) !== $this->getInput('translateLangBase') ){ + // Sauvegarde du dossier 'base' dans un dossier code ISO de l'ancienne langue originale du site + $this->copyDir('./site/data/base', './site/data/'. $this->getData(['config', 'i18n', 'langBase'])); + // La nouvelle langue originale du site était une langue en traduction rédigée + if( is_dir('./site/data/'.$this->getInput('translateLangBase'))){ + $this->removeDir('./site/data/base'); + rename('./site/data/'. $this->getInput('translateLangBase') , './site/data/base'); + } + } // Edition des langues foreach (self::$i18nList as $keyi18n => $value) { if ($keyi18n === 'base') continue;