[9.0.07] menu organisé

This commit is contained in:
fredtempez 2019-03-16 16:25:54 +01:00
parent 23fd7dcb41
commit 9649170c94
2 changed files with 27 additions and 4 deletions

View File

@ -3,7 +3,8 @@
## Version 9.0.07 ## Version 9.0.07
- Correction : - Correction :
- Disparition du menu quand la bannière est masquée - Disparition du menu quand la bannière est masquée
- Modifications :
- Barre d'administration, pages organisées
## Version 9.0.06 ## Version 9.0.06
- Correction : - Correction :

View File

@ -1076,7 +1076,6 @@ class common {
* Mises à jour * Mises à jour
*/ */
private function update() { private function update() {
echo "pop";
// Version 8.1.0 // Version 8.1.0
if($this->getData(['core', 'dataVersion']) < 810) { if($this->getData(['core', 'dataVersion']) < 810) {
$this->setData(['config', 'timezone', 'Europe/Paris']); $this->setData(['config', 'timezone', 'Europe/Paris']);
@ -2338,13 +2337,36 @@ class layout extends common {
if($this->getUser('group') >= self::GROUP_MODERATOR) { if($this->getUser('group') >= self::GROUP_MODERATOR) {
$leftItems .= '<li><select id="barSelectPage">'; $leftItems .= '<li><select id="barSelectPage">';
$leftItems .= '<option value="">Choisissez une page</option>'; $leftItems .= '<option value="">Choisissez une page</option>';
$leftItems .= '<optgroup label="Pages orphelines">';
$orpheline = true ;
$currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2); $currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2);
foreach($this->getHierarchy(null, false) as $parentPageId => $childrenPageIds) { foreach($this->getHierarchy(null,false) as $parentPageId => $childrenPageIds) {
if ($this->getData(['page', $parentPageId, 'position']) !== 0 &&
$orpheline ) {
$orpheline = false;
$leftItems .= '<optgroup label="Pages dans le menu">';
}
// Exclure les barres
if ($this->getData(['page', $parentPageId, 'block']) !== 'bar') {
$leftItems .= '<option value="' .
helper::baseUrl() .
$parentPageId . '"' .
($parentPageId === $currentPageId ? ' selected' : false) . '>' .
$this->getData(['page', $parentPageId, 'title']) .
'</option>';
foreach($childrenPageIds as $childKey) {
$leftItems .= '<option value="' . helper::baseUrl() . $childKey . '"' . ($childKey === $currentPageId ? ' selected' : false) . '>&nbsp;&nbsp;&nbsp;&nbsp;' . $this->getData(['page', $childKey, 'title']) . '</option>';
}
}
}
// Afficher les barres
$leftItems .= '<optgroup label="Barres latérales">';
foreach($this->getHierarchy(null, false,true) as $parentPageId => $childrenPageIds) {
$leftItems .= '<option value="' . helper::baseUrl() . $parentPageId . '"' . ($parentPageId === $currentPageId ? ' selected' : false) . '>' . $this->getData(['page', $parentPageId, 'title']) . '</option>'; $leftItems .= '<option value="' . helper::baseUrl() . $parentPageId . '"' . ($parentPageId === $currentPageId ? ' selected' : false) . '>' . $this->getData(['page', $parentPageId, 'title']) . '</option>';
foreach($childrenPageIds as $childKey) { foreach($childrenPageIds as $childKey) {
$leftItems .= '<option value="' . helper::baseUrl() . $childKey . '"' . ($childKey === $currentPageId ? ' selected' : false) . '>&nbsp;&nbsp;&nbsp;&nbsp;' . $this->getData(['page', $childKey, 'title']) . '</option>'; $leftItems .= '<option value="' . helper::baseUrl() . $childKey . '"' . ($childKey === $currentPageId ? ' selected' : false) . '>&nbsp;&nbsp;&nbsp;&nbsp;' . $this->getData(['page', $childKey, 'title']) . '</option>';
} }
} }
$leftItems .= '</select></li>'; $leftItems .= '</select></li>';
$leftItems .= '<li><a href="' . helper::baseUrl() . 'page/add" data-tippy-content="Créer une page ou<br>une barre latérale">' . template::ico('plus') . '</a></li>'; $leftItems .= '<li><a href="' . helper::baseUrl() . 'page/add" data-tippy-content="Créer une page ou<br>une barre latérale">' . template::ico('plus') . '</a></li>';
if( if(