From 49e636a726221fd2ebcb67832512144cae63a0d8 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 26 Jul 2022 20:12:58 +0200 Subject: [PATCH] 11507 dossier fontes --- CHANGES.md | 6 ++++++ README.md | 2 +- core/class/helper.class.php | 4 ++-- core/core.php | 2 +- core/include/update.inc.php | 4 ++-- core/module/theme/theme.php | 7 ++++++- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6bfda7f1..ba4a053f 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # Changelog +## Version 11.5.07 +### Correction : +- Création du dossier des fontes personnalisées en cas d'absence. +### Amélioration : +- Détection d'une mise à jour. + ## Version 11.5.06 ### Corrections : - Défaut d'affichage de la barre des membres dans la zone de menu. diff --git a/README.md b/README.md index 0acd3765..5c5e5a71 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ZwiiCMS 11.5.06 +# ZwiiCMS 11.5.07 Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation. diff --git a/core/class/helper.class.php b/core/class/helper.class.php index 10348db1..d2584911 100644 --- a/core/class/helper.class.php +++ b/core/class/helper.class.php @@ -290,8 +290,8 @@ class helper { * @return bool */ public static function checkNewVersion() { - - if($version = helper::getOnlineVersion()) { + $version = helper::getOnlineVersion(); + if( !empty($version) ) { return ((version_compare(common::ZWII_VERSION, $version)) === -1); } else { diff --git a/core/core.php b/core/core.php index f733acb1..5bbd3828 100644 --- a/core/core.php +++ b/core/core.php @@ -45,7 +45,7 @@ class common { // Numéro de version const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/'; - const ZWII_VERSION = '11.5.06'; + const ZWII_VERSION = '11.5.07'; const ZWII_UPDATE_CHANNEL = "v11"; public static $actions = []; diff --git a/core/include/update.inc.php b/core/include/update.inc.php index f95b46f6..5b146b7d 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -938,7 +938,7 @@ if ($this->getData(['core', 'dataVersion']) < 11400) { // Consersion des fontes importées $imported = $this->getData(['fonts', 'imported']); if (is_array($imported)) { - foreach ($imported as $fontId => $fontUrl) { + foreach ($imported as $fontsId => $fontUrl) { if ( gettype($fontUrl) === 'string' ) { $this->setData(['fonts', 'imported', $fontId, [ 'name' => ucfirst($fontId), @@ -966,7 +966,7 @@ if ($this->getData(['core', 'dataVersion']) < 11400) { // Version 11.5.06 -if ($this->getData(['core', 'dataVersion']) < 11506) { +if ($this->getData(['core', 'dataVersion']) < 11506) { // Renommage de la barre de membre dans le pied de page $data = $this->getData(['theme', 'footer', 'displayMemberBar']); diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 2244ea5e..521fa132 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -1214,7 +1214,7 @@ class theme extends common { } } } - + // Ajoute le préconnect des fontes Googles. $fileContent = $gf ? '' . $fileContent : $fileContent; @@ -1246,6 +1246,11 @@ class theme extends common { } } + // Créer le dossier des fontes + if (!is_dir(self::DATA_DIR . 'fonts')) { + mkdir(self::DATA_DIR . 'fonts'); + } + // Enregistre la personnalisation file_put_contents(self::DATA_DIR.'fonts/fonts.html', $fileContent); // Enregistre la personnalisation