From cfdd9d11ea9bb83ee31e2b94978be683cf8f8281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Wed, 15 Jan 2025 09:48:29 +0100 Subject: [PATCH] =?UTF-8?q?1.17.03=20Dans=20le=20th=C3=A8me,=20les=20pages?= =?UTF-8?q?=20en=20sont=20pas=20affich=C3=A9es=20dan=20sle=20menu,=20elles?= =?UTF-8?q?=20ne=20sont=20plus=20g=C3=A9n=C3=A9r=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/layout.class.php | 233 +++++++++++++++++++----------------- core/core.php | 2 +- 2 files changed, 122 insertions(+), 113 deletions(-) diff --git a/core/class/layout.class.php b/core/class/layout.class.php index c46f1b5..b8aacf4 100644 --- a/core/class/layout.class.php +++ b/core/class/layout.class.php @@ -536,14 +536,13 @@ class layout extends common break; case self::GROUP_EDITOR: if ( - $this->getData(['enrolment', self::$siteContent ]) && ($this->getUser('id') === $this->getData(['course', self::$siteContent , 'author'])) + $this->getData(['enrolment', self::$siteContent]) && ($this->getUser('id') === $this->getData(['course', self::$siteContent, 'author'])) // Permission d'accéder aux espaces dans lesquels le membre est inscrit || - ($this->getData(['enrolment', self::$siteContent ]) - && $this->getUser('permission', __CLASS__, 'tutor') === true - && array_key_exists($this->getUser('id'), $this->getData(['enrolment', self::$siteContent ]))) - ) - { + ($this->getData(['enrolment', self::$siteContent]) + && $this->getUser('permission', __CLASS__, 'tutor') === true + && array_key_exists($this->getUser('id'), $this->getData(['enrolment', self::$siteContent]))) + ) { $href = helper::baseUrl() . 'course/users/' . self::$siteContent; } break; @@ -625,93 +624,35 @@ class layout extends common { $items = ''; $currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2); - foreach ($this->getHierarchy() as $parentPageId => $childrenPageIds) { - // Menu extra ou standard + // La liste des pages n'est générée si le thème ne l'autorise pas sauf pour la page home. + if ( + self::$siteContent === 'home' + || ( + self::$siteContent !== 'home' + && $this->getData(['theme', 'menu', 'hidePages']) === true + ) + ) { + foreach ($this->getHierarchy() as $parentPageId => $childrenPageIds) { + // Menu extra ou standard - if ( - // Absence de la position extra, la page est toujours affichée à gauche. - ($this->getData(['page', $parentPageId, 'extraPosition']) !== NULL || $extra === true) - && - $this->getData(['page', $parentPageId, 'extraPosition']) !== $extra - ) { - continue; - } - // Propriétés de l'item - $active = ($parentPageId === $currentPageId or in_array($currentPageId, $childrenPageIds)) ? 'active ' : ''; - $targetBlank = $this->getData(['page', $parentPageId, 'targetBlank']) ? ' target="_blank"' : ''; - // Mise en page de l'item - $items .= '
  • '; - - if ( - ($this->getData(['page', $parentPageId, 'disable']) === true - and $this->isConnected() === false - ) or ($this->getData(['page', $parentPageId, 'disable']) === true - and $this->isConnected() === true - and $this->getUser('group') < self::GROUP_EDITOR - ) - ) { - $pageUrl = ($this->getData(['config', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0); - $items .= ''; - } else { - $pageUrl = ($this->getData(['config', 'homePageId']) === $parentPageId) ? helper::baseUrl(false) : helper::baseUrl() . $parentPageId; - $items .= ''; - } - - switch ($this->getData(['page', $parentPageId, 'typeMenu'])) { - case '': - $items .= $this->getData(['page', $parentPageId, 'shortTitle']); - break; - case 'text': - $items .= $this->getData(['page', $parentPageId, 'shortTitle']); - break; - case 'icon': - if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") { - $items .= '' . $this->getData(['page', $parentPageId, 'shortTitle']) . ''; - } else { - $items .= $this->getData(['page', $parentPageId, 'shortTitle']); - } - break; - case 'icontitle': - if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") { - $items .= '' . $this->getData(['page', $parentPageId, 'titlshortTitlee']) . ''; - } else { - $items .= $this->getData(['page', $parentPageId, 'shortTitle']); - } - break; - } - // Cas où les pages enfants enfant sont toutes masquées dans le menu - // ne pas afficher de symbole lorsqu'il n'y a rien à afficher - $totalChild = 0; - $disableChild = 0; - foreach ($childrenPageIds as $childKey) { - $totalChild += 1; - } - if ( - $childrenPageIds && $disableChild !== $totalChild && - $this->getdata(['page', $parentPageId, 'hideMenuChildren']) === false - ) { - $items .= template::ico('down', ['margin' => 'left']); - } - // ------------------------------------------------ - $items .= ''; - if ( - $this->getdata(['page', $parentPageId, 'hideMenuChildren']) === true || - empty($childrenPageIds) - ) { - continue; - } - $items .= ''; } + return ($items); } @@ -1063,7 +1072,7 @@ class layout extends common // Sur une page sans module or $this->getData(['page', $this->getUrl(0), 'moduleId']) === '' // Sur une page avec un module invalide - or (empty($this->getData(['page', $this->getUrl(0), 'moduleId'])) === false + or (empty($this->getData(['page', $this->getUrl(0), 'moduleId'])) === false and class_exists($this->getData(['page', $this->getUrl(0), 'moduleId'])) === false ) // Sur une page d'accueil diff --git a/core/core.php b/core/core.php index de20adc..b190e81 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.17.02'; + const ZWII_VERSION = '1.17.03'; // URL autoupdate const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';