From c648d328d6c10bf722e98449e96a7c4f27ca61d4 Mon Sep 17 00:00:00 2001 From: Prof Langues Date: Tue, 9 Feb 2021 18:20:53 +0100 Subject: [PATCH 1/6] appel en trop --- core/module/config/config.php | 1 - 1 file changed, 1 deletion(-) diff --git a/core/module/config/config.php b/core/module/config/config.php index 79c03d23..9faf5392 100755 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -604,7 +604,6 @@ class config extends common { */ public function modules() { - helper::getModules(); // Préparation du tableau des modules installés // Liste des modules installés (répertoire de module/) if ($dh = opendir( 'module/' )) { From 041da51cac2cfe5bd4871c573c7b5cb62e10a6a1 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 9 Feb 2021 19:11:50 +0100 Subject: [PATCH 2/6] changes --- CHANGES.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0d49a1bf..028c8565 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,9 +3,10 @@ ## version 10.4.02 - Corrections : - Thème : aperçu du site amélioré. - - Editeur de texte : couleur de fond parasite quand une image en arrière-plan est sélectionnée. + - Thème : rétablissement du contrôle de l'import d'une version ancienne d'un thème. + - Éditeur de texte : couleur de fond parasite quand une image en arrière-plan est sélectionnée. -## version 10.4.01 +## version 10.4.01 Corrections : - Module form, erreur de syntaxe. - Chargement d'un thème, désactivation du contrôle des clés. From a5437ef3330df6a776e59c836ee03eba99797aee Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 10 Feb 2021 09:49:27 +0100 Subject: [PATCH 3/6] =?UTF-8?q?m=C3=A9thode=20de=20sauvegarde=208=20cl?= =?UTF-8?q?=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/core.php b/core/core.php index 82c56899..7246dac0 100755 --- a/core/core.php +++ b/core/core.php @@ -972,8 +972,7 @@ class common { $db->set($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3].'.'.$keys[4].'.'.$keys[5],$keys[6], true); break; case 8: - $db->set($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3].'.'.$keys[4].'.'.$keys[5].'.'.$keys[6],$keys[7] ); - $db->save(); + $db->set($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3].'.'.$keys[4].'.'.$keys[5].'.'.$keys[6],$keys[7], true ); break; } return true; From 3f6889763923787f1738fe7fdb20618001fcffb9 Mon Sep 17 00:00:00 2001 From: Prof Langues Date: Wed, 10 Feb 2021 16:59:17 +0100 Subject: [PATCH 4/6] scanSubDir and check empty folder --- core/class/helper.class.php | 59 +++++++++++++++++++++++++------------ module/gallery/gallery.php | 22 +------------- 2 files changed, 41 insertions(+), 40 deletions(-) diff --git a/core/class/helper.class.php b/core/class/helper.class.php index 4ce97ef5..3505241e 100755 --- a/core/class/helper.class.php +++ b/core/class/helper.class.php @@ -137,30 +137,51 @@ class helper { public static function getModules() { $dirs = array_diff(scandir('module'), array('..', '.')); foreach ($dirs as $key => $value) { - // Lire les constantes - $class_reflex = new \ReflectionClass($value); - $class_constants = $class_reflex->getConstants(); - // Constante REALNAME - if (array_key_exists('REALNAME', $class_constants)) { - $realName = $value::REALNAME; - } else { - $realName = ucfirst($value); + // Dossier non vide + if (file_exists('module/' . $value . '/' . $value . '.php')) { + // Lire les constantes + $class_reflex = new \ReflectionClass($value); + $class_constants = $class_reflex->getConstants(); + // Constante REALNAME + if (array_key_exists('REALNAME', $class_constants)) { + $realName = $value::REALNAME; + } else { + $realName = ucfirst($value); + } + // Constante VERSION + if (array_key_exists('VERSION', $class_constants)) { + $version = $value::VERSION; + } else { + $version = '0.0'; + } + // Affection + $modules [$value] = [ + 'realName' => $realName, + 'version' => $version + ]; } - // Constante VERSION - if (array_key_exists('VERSION', $class_constants)) { - $version = $value::VERSION; - } else { - $version = '0.0'; - } - // Affection - $modules [$value] = [ - 'realName' => $realName, - 'version' => $version - ]; } return($modules); } + + /** + * Scanne le contenu d'un dossier et de ses sous-dossiers + * @param string $dir Dossier à scanner + * @return array + */ + public static function scanSubDir($dir) { + $dirContent = []; + $iterator = new DirectoryIterator($dir); + foreach($iterator as $fileInfos) { + if($fileInfos->isDot() === false AND $fileInfos->isDir()) { + $dirContent[] = $dir . '/' . $fileInfos->getBasename(); + $dirContent = array_merge($dirContent, self::scanSubDir($dir . '/' . $fileInfos->getBasename())); + } + } + return $dirContent; + } + /** * Retourne true si le protocole est en TLS diff --git a/module/gallery/gallery.php b/module/gallery/gallery.php index e8526b7c..7156931c 100755 --- a/module/gallery/gallery.php +++ b/module/gallery/gallery.php @@ -324,7 +324,7 @@ class gallery extends common { // Valeurs en sortie $this->addOutput([ 'display' => self::DISPLAY_JSON, - 'content' => galleriesHelper::scanDir(self::FILE_DIR.'source') + 'content' => helper::scanSubDir(self::FILE_DIR.'source') ]); } @@ -673,24 +673,4 @@ class gallery extends common { ]); } -} - -class galleriesHelper extends helper { - - /** - * Scan le contenu d'un dossier et de ses sous-dossiers - * @param string $dir Dossier à scanner - * @return array - */ - public static function scanDir($dir) { - $dirContent = []; - $iterator = new DirectoryIterator($dir); - foreach($iterator as $fileInfos) { - if($fileInfos->isDot() === false AND $fileInfos->isDir()) { - $dirContent[] = $dir . '/' . $fileInfos->getBasename(); - $dirContent = array_merge($dirContent, self::scanDir($dir . '/' . $fileInfos->getBasename())); - } - } - return $dirContent; - } } \ No newline at end of file From c1a1cdf1bdb44e368e54c5761be1a348dea57167 Mon Sep 17 00:00:00 2001 From: Prof Langues Date: Wed, 10 Feb 2021 17:00:15 +0100 Subject: [PATCH 5/6] readme version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 71521879..cb9d1c5f 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# ZwiiCMS 10.4.00 +# ZwiiCMS 10.4.02 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. From 1cad66691c899a754cd433c569bff76e66a44dd1 Mon Sep 17 00:00:00 2001 From: Prof Langues Date: Wed, 10 Feb 2021 17:04:41 +0100 Subject: [PATCH 6/6] Commentaire --- core/class/helper.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/class/helper.class.php b/core/class/helper.class.php index 3505241e..ae3fd0bb 100755 --- a/core/class/helper.class.php +++ b/core/class/helper.class.php @@ -168,7 +168,7 @@ class helper { /** * Scanne le contenu d'un dossier et de ses sous-dossiers * @param string $dir Dossier à scanner - * @return array + * @return array liste de dossiers contenus dans le répertoire cible. */ public static function scanSubDir($dir) { $dirContent = [];