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 .= '';
- } else {
- $items .= $this->getData(['page', $parentPageId, 'shortTitle']);
- }
- break;
- case 'icontitle':
- if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") {
- $items .= '';
- } 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 .= '';
- foreach ($childrenPageIds as $childKey) {
- // Propriétés de l'item
- $active = ($childKey === $currentPageId) ? 'active ' : '';
- $targetBlank = $this->getData(['page', $childKey, 'targetBlank']) ? ' target="_blank"' : '';
- // Mise en page du sous-item
- $items .= '- ';
if (
- ($this->getData(['page', $childKey, 'disable']) === true
+ // 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', $childKey, 'disable']) === true
+ ) or ($this->getData(['page', $parentPageId, 'disable']) === true
and $this->isConnected() === true
and $this->getUser('group') < self::GROUP_EDITOR
)
@@ -719,45 +660,113 @@ class layout extends common
$pageUrl = ($this->getData(['config', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
$items .= '';
} else {
- $pageUrl = ($this->getData(['config', 'homePageId']) === $childKey) ? helper::baseUrl(false) : helper::baseUrl() . $childKey;
- $items .= '';
+ $pageUrl = ($this->getData(['config', 'homePageId']) === $parentPageId) ? helper::baseUrl(false) : helper::baseUrl() . $parentPageId;
+ $items .= '';
}
- switch ($this->getData(['page', $childKey, 'typeMenu'])) {
+ switch ($this->getData(['page', $parentPageId, 'typeMenu'])) {
case '':
- $items .= $this->getData(['page', $childKey, 'shortTitle']);
+ $items .= $this->getData(['page', $parentPageId, 'shortTitle']);
break;
case 'text':
- $items .= $this->getData(['page', $childKey, 'shortTitle']);
+ $items .= $this->getData(['page', $parentPageId, 'shortTitle']);
break;
case 'icon':
- if ($this->getData(['page', $childKey, 'iconUrl']) != "") {
- $items .= '';
+ if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") {
+ $items .= '';
} else {
$items .= $this->getData(['page', $parentPageId, 'shortTitle']);
}
break;
case 'icontitle':
- if ($this->getData(['page', $childKey, 'iconUrl']) != "") {
- $items .= '';
+ if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") {
+ $items .= '';
} else {
- $items .= $this->getData(['page', $childKey, 'shortTitle']);
- }
- break;
- case 'icontext':
- if ($this->getData(['page', $childKey, 'iconUrl']) != "") {
- $items .= '';
- $items .= $this->getData(['page', $childKey, 'shortTitle']);
- } else {
- $items .= $this->getData(['page', $childKey, 'shortTitle']);
+ $items .= $this->getData(['page', $parentPageId, 'shortTitle']);
}
break;
}
- $items .= '
';
+ // 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 .= '';
+ foreach ($childrenPageIds as $childKey) {
+ // Propriétés de l'item
+ $active = ($childKey === $currentPageId) ? 'active ' : '';
+ $targetBlank = $this->getData(['page', $childKey, 'targetBlank']) ? ' target="_blank"' : '';
+ // Mise en page du sous-item
+ $items .= '- ';
+ if (
+ ($this->getData(['page', $childKey, 'disable']) === true
+ and $this->isConnected() === false
+ ) or ($this->getData(['page', $childKey, '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']) === $childKey) ? helper::baseUrl(false) : helper::baseUrl() . $childKey;
+ $items .= '';
+ }
+
+ switch ($this->getData(['page', $childKey, 'typeMenu'])) {
+ case '':
+ $items .= $this->getData(['page', $childKey, 'shortTitle']);
+ break;
+ case 'text':
+ $items .= $this->getData(['page', $childKey, 'shortTitle']);
+ break;
+ case 'icon':
+ if ($this->getData(['page', $childKey, 'iconUrl']) != "") {
+ $items .= '';
+ } else {
+ $items .= $this->getData(['page', $parentPageId, 'shortTitle']);
+ }
+ break;
+ case 'icontitle':
+ if ($this->getData(['page', $childKey, 'iconUrl']) != "") {
+ $items .= '';
+ } else {
+ $items .= $this->getData(['page', $childKey, 'shortTitle']);
+ }
+ break;
+ case 'icontext':
+ if ($this->getData(['page', $childKey, 'iconUrl']) != "") {
+ $items .= '';
+ $items .= $this->getData(['page', $childKey, 'shortTitle']);
+ } else {
+ $items .= $this->getData(['page', $childKey, 'shortTitle']);
+ }
+ break;
+ }
+ $items .= '
';
+ }
+ $items .= '
';
}
- $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/';