diff --git a/library/ZendAfi/View/Helper/Menu/Boite.php b/library/ZendAfi/View/Helper/Menu/Boite.php index 15166bfba2c024a1a58de9968ec1a3830d25eba3..7ab534d35a669af20dbb9b94273c4a0eb44965d8 100644 --- a/library/ZendAfi/View/Helper/Menu/Boite.php +++ b/library/ZendAfi/View/Helper/Menu/Boite.php @@ -30,11 +30,14 @@ class ZendAfi_View_Helper_Menu_Boite extends ZendAfi_View_Helper_BaseHelper { $this->_params['type_module'] = Class_Systeme_ModulesMenu::moduleAccueilType($params); } - public function getBoite() { + + public function getBoite($li_class='') { $helper = ZendAfi_View_Helper_Accueil_Base::getModuleHelperFromParams($this->_id_module, $this->_params); $helper->setView($this->view); - return $helper->getBoite(); + + $class = $li_class ? $li_class.' boite' : 'boite'; + return '<li class="'.$class.'">'.$helper->getBoite().'</li>'; } } diff --git a/library/ZendAfi/View/Helper/Menu/Entry.php b/library/ZendAfi/View/Helper/Menu/Entry.php index 851192ce56d143e28f5d939c1cc3c22927f24bfa..6207752412ee23adc062196504fbdf6dfa33d69b 100644 --- a/library/ZendAfi/View/Helper/Menu/Entry.php +++ b/library/ZendAfi/View/Helper/Menu/Entry.php @@ -34,16 +34,18 @@ class ZendAfi_View_Helper_Menu_Entry extends ZendAfi_View_Helper_Menu_Base { } - public function getBoite() { + public function getBoite($li_class = '') { $html = $this->getTagAnchor(); if ($this->_sous_menus) { - $helper = new ZendAfi_View_Helper_Menu_SousMenus($this->_sous_menus); - $helper->setView($this->view); - $html .= $helper->getBoite(); - } + $helper = new ZendAfi_View_Helper_Menu_SousMenus($this->_sous_menus); + $helper->setView($this->view); + $html .= $helper->getBoite(); + } - return $html; + return $li_class + ? '<li class="'.$li_class.'">'.$html.'</li>' + : '<li>'.$html.'</li>'; } @@ -52,7 +54,7 @@ class ZendAfi_View_Helper_Menu_Entry extends ZendAfi_View_Helper_Menu_Base { $params = $modMenus->getUrl($this->_type_module, $this->_preferences); $url = $params['url']; $target = $params['target'] - ? "target='".$params['target']."'"; + ? "target='".$params['target']."'" : ''; $anchor='<a href="'.htmlspecialchars($url).'" '.$target.'>'; diff --git a/library/ZendAfi/View/Helper/Menu/Menus.php b/library/ZendAfi/View/Helper/Menu/Menus.php index 663e1226620e6626a1b948d1427d2410dbf92512..238d24a6315adb8182cf21667fc65fe6af1e715c 100644 --- a/library/ZendAfi/View/Helper/Menu/Menus.php +++ b/library/ZendAfi/View/Helper/Menu/Menus.php @@ -20,29 +20,26 @@ */ class ZendAfi_View_Helper_Menu_Menus extends ZendAfi_View_Helper_BaseHelper { - protected $_ul_class = ''; - protected $_li_class = 'menu'; protected $_menus = []; + protected $_menu_class = 'menu'; public function __construct($menus) { parent::__construct(); $this->_menus = $menus; } + public function getBoite() { - $html = '<ul class="'.$this->_ul_class.'">'; - - foreach($this->_menus as $id_menu => $entree) { - $li_class = Class_Systeme_ModulesMenu::isModuleAccueil($entree) - ? $this->_li_class.' boite' - : $this->_li_class; - - $html.= '<li class="'.$li_class.'">'; + return '<ul>'.$this->renderMenus().'</ul>'; + } + + + public function renderMenus() { + $html = ''; + + foreach($this->_menus as $id_menu => $entree) $html.= $this->renderModule($id_menu, $entree); - $html.='</li>'; - } - $html.='</ul>'; return $html; } @@ -50,7 +47,7 @@ class ZendAfi_View_Helper_Menu_Menus extends ZendAfi_View_Helper_BaseHelper { function renderModule($id_menu, $menu){ $helper = ZendAfi_View_Helper_Menu_Base::getModuleHelperFromParams($id_menu, $menu); $helper->setView($this->view); - return $helper->getBoite(); + return $helper->getBoite($this->_menu_class); } } diff --git a/library/ZendAfi/View/Helper/Menu/SousMenus.php b/library/ZendAfi/View/Helper/Menu/SousMenus.php index 02480cf4bc3c976bd7295394deb481ad90ac26c7..6ce32eb62f18a624b86217d6ea49b2ed7068b29c 100644 --- a/library/ZendAfi/View/Helper/Menu/SousMenus.php +++ b/library/ZendAfi/View/Helper/Menu/SousMenus.php @@ -20,8 +20,11 @@ */ class ZendAfi_View_Helper_Menu_SousMenus extends ZendAfi_View_Helper_Menu_Menus { - protected $_ul_class = 'sous-menus'; - protected $_li_class = ''; + protected $_menu_class = ''; + + public function getBoite() { + return '<ul>'.$this->renderMenus().'</ul>'; + } } ?> \ No newline at end of file diff --git a/public/opac/css/global.css b/public/opac/css/global.css index 46b8bed8e8d5f05bd0e3a8ea73e796492a6f4fc9..97b735727472ea05231a96af1c0086018453abe4 100644 --- a/public/opac/css/global.css +++ b/public/opac/css/global.css @@ -1112,7 +1112,7 @@ body.abonne_multimedia-hold-view .actions a { } -#menu_horizontal ul.sous_menu li.boite { +#menu_horizontal li.menu ul li.boite { width: 200px; float: left; white-space: normal;