Emplacement menu dans une barre []

This commit is contained in:
fredtempez 2019-05-03 22:03:07 +02:00
parent 7297e0fa24
commit 3560c0aa3d
3 changed files with 33 additions and 30 deletions

View File

@ -1817,10 +1817,23 @@ class layout extends common {
/** /**
* Affiche le contenu de la barre gauche * Affiche le contenu de la barre gauche
* @param page chargée *
*/ */
public function showBarContentLeft() { public function showBarContentLeft() {
echo $this->core->output['contentLeft']; // Détermine si le menu est présent
if ($this->getData(['page',$this->getData(['page',$this->getUrl(0),'barLeft']),'displayMenu']) === 'none') {
// Pas de menu
echo $this->core->output['contentLeft'];
} else {
// $mark contient 0 le menu est positionné à la fin du contenu
$contentLeft = $this->core->output['contentLeft'];
$mark = strrpos($contentLeft,'[]') !== false ? strrpos($contentLeft,'[]') : strlen($contentLeft);
echo substr($contentLeft,0,$mark);
echo '<div id="menuSideLeft>';
echo $this->showMenuSide($this->getData(['page',$this->getData(['page',$this->getUrl(0),'barLeft']),'displayMenu']) === 'parents' ? false : true);
echo '</div>';
echo substr($contentLeft,$mark+2,strlen($contentLeft));
}
} }
/** /**
@ -1828,7 +1841,20 @@ class layout extends common {
* @param page chargée * @param page chargée
*/ */
public function showBarContentRight() { public function showBarContentRight() {
echo $this->core->output['contentRight']; // Détermine si le menu est présent
if ($this->getData(['page',$this->getData(['page',$this->getUrl(0),'barRight']),'displayMenu']) === 'none') {
// Pas de menu
echo $this->core->output['contentRight'];
} else {
// $mark contient 0 le menu est positionné à la fin du contenu
$contentRight = $this->core->output['contentRight'];
$mark = strrpos($contentRight,'[]') !== false ? strrpos($contentRight,'[]') : strlen($contentRight);
echo substr($contentRight,0,$mark);
echo '<div id="menuSideRight>';
echo $this->showMenuSide($this->getData(['page',$this->getData(['page',$this->getUrl(0),'barRight']),'displayMenu']) === 'parents' ? false : true);
echo '</div>';
echo substr($contentRight,$mark+2,strlen($contentRight));
}
} }
/** /**

View File

@ -169,19 +169,7 @@
<?php <?php
if ($blockleft !== "") :?> if ($blockleft !== "") :?>
<div class="<?php echo $blockleft; ?>" id="contentLeft"> <div class="<?php echo $blockleft; ?>" id="contentLeft">
<?php <?php $layout->showBarContentLeft(); ?>
// Détermine si le bloc a un menu à inclure
$layout->showBarContentLeft();
// Type de menu affiché
// 0 : aucun
// 1 : menu complet
// 2 : sous-menu de la page parente
if ($this->getData(['page',$this->getData(['page',$this->getUrl(0),'barLeft']),'displayMenu']) !== 'none') {
?> <div id="menuSideLeft"><?php
$layout->showMenuSide($this->getData(['page',$this->getData(['page',$this->getUrl(0),'barLeft']),'displayMenu']) === 'parents' ? false : true);
?></div><?php
}
?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="<?php echo $content; ?> <div class="<?php echo $content; ?>
@ -190,19 +178,7 @@
<?php <?php
if ($blockright !== "") :?> if ($blockright !== "") :?>
<div class="<?php echo $blockright; ?>" id="contentRight"> <div class="<?php echo $blockright; ?>" id="contentRight">
<?php <?php $layout->showBarContentRight(); ?>
// Détermine si le bloc a un menu à inclure
$layout->showBarContentRight();
// Type de menu affiché
// 0 : aucun
// 1 : menu complet
// 2 : sous-menu de la page parente
if ($this->getData(['page',$this->getData(['page',$this->getUrl(0),'barRight']),'displayMenu']) !== 'none') {
?> <div id="menuSideRight"><?php
$layout->showMenuSide($this->getData(['page',$this->getData(['page',$this->getUrl(0),'barRight']),'displayMenu']) === 'parents' ? false : true);
?></div><?php
}
?>
</div> </div>
<?php endif; ?> <?php endif; ?>
</div> </div>

View File

@ -122,7 +122,8 @@ $this->pages2Json();
<div class="col12"> <div class="col12">
<?php echo template::select('pageEditDisplayMenu', $module::$displayMenu, [ <?php echo template::select('pageEditDisplayMenu', $module::$displayMenu, [
'label' => 'Configuration du menu vertical', 'label' => 'Configuration du menu vertical',
'selected' => $this->getData(['page', $this->getUrl(2), 'displayMenu']) 'selected' => $this->getData(['page', $this->getUrl(2), 'displayMenu']),
'help' => 'Par défaut le menu est affiché APRES le contenu de la page. Pour le placer à un emplacement précis, y insérez [] (deux crochets).'
]); ?> ]); ?>
</div> </div>
</div> </div>