From 9d6e229e0aaba11f0a946decd947f05ff5b08429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Thu, 30 Jan 2025 13:03:40 +0100 Subject: [PATCH] =?UTF-8?q?1.20.02=20Installe=20la=20variable=20de=20masqu?= =?UTF-8?q?age=20des=20pages=20dans=20les=20th=C3=A8mes=20o=C3=B9=20elle?= =?UTF-8?q?=20n'a=20pas=20=C3=A9t=C3=A9=20d=C3=A9finie.=20Corrige=20le=20d?= =?UTF-8?q?=C3=A9calage=20du=20contenu=20de=20la=20page=20lorsque=20les=20?= =?UTF-8?q?pages=20sont=20masqu=C3=A9es=20du=20menu.=20Mise=20=C3=A0=20jou?= =?UTF-8?q?r=20du=20jeu=20de=20donn=C3=A9es=201.20.02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- core/class/layout.class.php | 3 +- core/core.js.php | 2 +- core/core.php | 2 +- core/include/update.inc.php | 32 +++++++++++++++++-- core/layout/common.css | 1 + core/module/install/ressource/defaultdata.php | 2 +- 7 files changed, 36 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fdad8e3..e5251c0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ZwiiCampus 1.20.01 +# ZwiiCampus 1.20.02 ZwiiCampus (Learning Management System) est logiciel auteur destiné à mettre en ligne des tutoriels. Il dispose de plusieurs modalités d'ouverture et d'accès des contenus. Basé sur la version 13 du CMS Zwii, la structure logicielle est solide, le framework de Zwii est éprouvé. diff --git a/core/class/layout.class.php b/core/class/layout.class.php index fd39177..47b93d5 100644 --- a/core/class/layout.class.php +++ b/core/class/layout.class.php @@ -613,8 +613,7 @@ class layout extends common } // Retourne les items du menu - echo ''; + echo ''; } /** diff --git a/core/core.js.php b/core/core.js.php index 708d538..63f7492 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -378,7 +378,7 @@ core.start = function () { }); // Par défaut pour tous les thèmes. - $("#menuLeft, nav").css("max-height", totalHeight + "px").css("min-height", totalHeight + "px"); + $("#menuLeft").css("max-height", totalHeight + "px").css("min-height", totalHeight + "px"); } }; diff --git a/core/core.php b/core/core.php index 74d95f6..93f2203 100644 --- a/core/core.php +++ b/core/core.php @@ -51,7 +51,7 @@ class common const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '1.20.01'; + const ZWII_VERSION = '1.20.02'; // URL autoupdate const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/'; diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 59f1ec0..ee11543 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -22,7 +22,6 @@ if ( $this->setData(['core', 'dataVersion', 1700]); } - if ( $this->getData(['core', 'dataVersion']) < 1800 ) { @@ -45,4 +44,33 @@ if ( fclose($fp); } $this->setData(['core', 'dataVersion', 1800]); -} \ No newline at end of file +} + +if ( + $this->getData(['core', 'dataVersion']) < 12002 +) { + + /** + * Installe dans le thème du menu la variable hidePages + **/ + // Tableau à insérer + $a = [ + 'theme' => + ['menu' => [ + 'hidePages' => false + ]]]; + // Parcourir la structure pour écrire dans les fichiers JSON + foreach ($this->getData(['course']) as $courseId => $courseValues) { + $d = json_decode(file_get_contents(self::DATA_DIR . $courseId . '/theme.json'), true); + // Insérer la variable hidePages si elle n'existe pas + if (isset($d['theme']['menu']['hidePages']) === false) { + $result = array_replace_recursive($d, $a); + file_put_contents(self::DATA_DIR . $courseId . '/theme.json', json_encode($result,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); + } + // Forcer la régénération du fichier theme.css + if (file_exists(self::DATA_DIR . $courseId . '/theme.css')) { + unlink(self::DATA_DIR . $courseId . '/theme.css'); + } + } + //$this->setData(['core', 'dataVersion', 12002]); +} diff --git a/core/layout/common.css b/core/layout/common.css index bc4bc29..f7619eb 100644 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -657,6 +657,7 @@ nav a:hover { #menuLeft { display: inline-flex; + float: left; } #menuRight { diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 5812ecd..15d489b 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -64,7 +64,7 @@ class init extends common ] ], 'core' => [ - 'dataVersion' => 1700, + 'dataVersion' => 12002, 'lastBackup' => 0, 'lastClearTmp' => 0, 'lastAutoUpdate' => 0,