From ba107ac872cffa38140fe303a5b49a54b16ea9d1 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 9 Oct 2021 21:16:53 +0200 Subject: [PATCH] =?UTF-8?q?Bug=20position=20du=20menu=20selon=20celle=20de?= =?UTF-8?q?=20la=20banni=C3=A8re?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/theme/theme.php | 46 ++++++++++--------------------------- 1 file changed, 12 insertions(+), 34 deletions(-) diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index d97948f8..4a80be8a 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -443,42 +443,20 @@ class theme extends common { 'imageContainer' => $this->getInput('themeHeaderImageContainer') ]]); // Modification de la position du menu selon la position de la bannière - if ( $this->getInput('themeHeaderPosition') && - ( $this->getData(['theme','menu','position']) !== 'site' || - $this->getData(['theme','menu','position']) !== 'top') ) + if ( $this->getData(['theme','header','position']) == 'site' ) { - switch ($this->getInput('themeHeaderPosition')) { - case 'site' : - $position = str_replace ('body','site',$this->getData(['theme','menu','position'])); - break; - case 'body' : - $position = str_replace ('site','body',$this->getData(['theme','menu','position'])); - break; - default: - $position = $this->getData(['theme','menu','position']); - } + $this->setData(['theme', 'menu', 'position',str_replace ('body-','site-',$this->getData(['theme','menu','position']))]); + } + if ( $this->getData(['theme','header','position']) == 'body') + { + $this->setData(['theme', 'menu', 'position',str_replace ('site-','body-',$this->getData(['theme','menu','position']))]); + } + if ( $this->getData(['theme','header','position']) == 'hide' && + ( $this->getData(['theme','menu','position']) == 'body-first' || + $this->getData(['theme','menu','position']) == 'site-first') ) + { + $this->setData(['theme', 'menu', 'position','site']); } - - $this->setData(['theme', 'menu', [ - 'backgroundColor' => $this->getData(['theme', 'menu', 'backgroundColor']), - 'backgroundColorSub' => $this->getData(['theme', 'menu', 'backgroundColorSub']), - 'font' => $this->getData(['theme', 'menu', 'font']), - 'fontSize' => $this->getData(['theme', 'menu', 'fontSize']), - 'fontWeight' => $this->getData(['theme', 'menu', 'fontWeight']), - 'height' => $this->getData(['theme', 'menu', 'height']), - 'loginLink' => $this->getData(['theme', 'menu', 'loginLink']), - 'margin' => $this->getData(['theme', 'menu', 'margin']), - 'position' => $position, - 'textAlign' => $this->getData(['theme', 'menu', 'textAlign']), - 'textColor' => $this->getData(['theme', 'menu', 'textColor']), - 'textTransform' => $this->getData(['theme','menu','textTransform']), - 'fixed' => $this->getData(['theme','menu','fixed']), - 'activeColorAuto' => $this->getData(['theme','menu','activeColorAuto']), - 'activeColor' => $this->getData(['theme','menu','activeColor']), - 'activeTextColor' => $this->getData(['theme','menu','activeTextColor']), - 'radius' => $this->getData(['theme','menu','radius']), - 'memberBar' => $this->getData(['theme','menu','memberBar']) - ]]); // Valeurs en sortie $this->addOutput([ 'notification' => 'Modifications enregistrées',