diff --git a/library/ZendAfi/View/Helper/Admin/FrontNav.php b/library/ZendAfi/View/Helper/Admin/FrontNav.php index 06b5569016e7242aa0ba5f018839ceafd894a924..7f8b2b6a9733ea32c3bb6e042ab1ff48e9e737a3 100644 --- a/library/ZendAfi/View/Helper/Admin/FrontNav.php +++ b/library/ZendAfi/View/Helper/Admin/FrontNav.php @@ -100,67 +100,96 @@ class ZendAfi_View_Helper_Admin_FrontNav extends ZendAfi_View_Helper_BaseHelper Class_Url::absolute('/admin/index/update-skin/git/pull'), URL_ADMIN_IMG . 'loading.gif')]), - $this->_toggleAnchor($this->_('Déplacement des boites'), - 'block_sorting', - 'reactiveOpacBlocksSorting()', - 'deactiveOpacBlocksSorting()'), - - $this->_toggleAnchor($this->_('Editeur CSS'), - 'css_editor', - 'showCSSEditor()', - 'hideCSSEditor()'), - - $this->_toggleAnchor($this->_('Amber IDE'), - 'amber_ide', - 'showAmberIDE()', - 'hideAmberIDE()'), - - $this->_toggleAnchor($this->_('ZF Debug'), - 'zf_debug', - 'showZFDebug()', - 'hideZFDebug()')]; - - return $this->_tag('ul', - $this->_tag('h3', $this->_('Actions d\'administration')) . - implode($this->_lify($actions))); - } - - - protected function _toggleAnchor($value, $class_sufix, $js_on, $js_off) { - $toggleFy = function($js, $img, $class_prefix) use ($value, $class_sufix) { - return $this->view->tagAnchor('#', - $value . - $this->view->tagImg(Class_Admin_Skin::current() - ->getIconUrl('actions', - $img)), - ['class' => $class_prefix . $class_sufix, - 'title' => $value, - 'onclick' => $js . ';return true;']); - }; - - return $toggleFy($js_on, 'toggle_off', 'activate_') . $toggleFy($js_off, 'toggle_on', 'deactivate_'); + $this->_toggleAnchor($this->_('Déplacement des boites'), + 'block_sorting', + 'reactiveOpacBlocksSorting()', + 'deactiveOpacBlocksSorting()'), + + $this->_toggleAnchor($this->_('Editeur CSS'), + 'css_editor', + 'showCSSEditor()', + 'hideCSSEditor()'), + + $this->_toggleAnchor($this->_('Amber IDE'), + 'amber_ide', + 'showAmberIDE()', + 'hideAmberIDE()'), + + $this->_toggleAnchor($this->_('ZF Debug'), + 'zf_debug', + 'showZFDebug()', + 'hideZFDebug()'), + + $this->_changeProfile()]; + + return $this->_tag('ul', + $this->_tag('h3', $this->_('Actions d\'administration')) . + implode($this->_lify($actions))); + } + + + protected function _changeProfile() { + $form = (new ZendAfi_Form) + ->addElement('select', + 'change_profile', + ['label' => $this->_('Changer de page'), + 'onChange' => sprintf('document.location.href = \'%s\' + this.value;', Class_Url::absolute('/index/index/id_profil/')), + 'multiOptions' => array_map(function($profiles) + { + $options = []; + foreach($profiles as $profile) { + $label = $profile->getLibelle(); + $options[$profile->getId()] = $this->_('%s : Accueil', $label); + + foreach($profile->getSubProfils() as $sub_profile) + $options[$sub_profile->getId()] = $this->_('%s : %s', $label, $sub_profile->getLibelle()); } + return $options; + }, + Class_Profil::getProfilsByBib('ALL', 'ALL'))]) + ->addUniqDisplayGroup('group') + ->populate(['change_profile' => Class_Profil::getCurrentProfil()->getId()]); + + return $this->view->renderForm($form); + } + + + protected function _toggleAnchor($value, $class_sufix, $js_on, $js_off) { + $toggleFy = function($js, $img, $class_prefix) use ($value, $class_sufix) { + return $this->view->tagAnchor('#', + $value . + $this->view->tagImg(Class_Admin_Skin::current() + ->getIconUrl('actions', + $img)), + ['class' => $class_prefix . $class_sufix, + 'title' => $value, + 'onclick' => $js . ';return true;']); + }; + + return $toggleFy($js_on, 'toggle_off', 'activate_') . $toggleFy($js_off, 'toggle_on', 'deactivate_'); + } + - protected function _adminLinks() { - $links = [$this->view->tagAnchor(Class_Url::absolute('/admin'), - $this->_('Accès professionnel') . - $this->view->tagImg(Class_Admin_Skin::current() - ->getIconUrl('icons', - 'home'), - ['style' => 'height: 18px; filter: invert(0);'])), - - $this->view->tagAnchor($this->view->url(['module' => 'admin', - 'controller' => 'profil', - 'action' => 'accueil', - 'id_profil' => Class_Profil::getCurrentProfil()->getId()], - null, - true), - $this->_('Paramétrer cette page') . - $this->view->tagImg(Class_Admin_Skin::current() - ->getIconUrl('actions', - 'edit'), - ['style' => 'height: 18px;']))]; + protected function _adminLinks() { + $links = [$this->view->tagAnchor(Class_Url::absolute('/admin'), + $this->_('Accès professionnel') . + $this->view->tagImg(Class_Admin_Skin::current() + ->getIconUrl('icons', + 'home'), + ['style' => 'height: 18px; filter: invert(0);'])), + + $this->view->tagAnchor($this->view->url(['module' => 'admin', + 'controller' => 'profil', + 'action' => 'accueil', + 'id_profil' => Class_Profil::getCurrentProfil()->getId()], + null, + true), + $this->_('Paramétrer cette page') . + $this->view->tagImg(Class_Admin_Skin::current() + ->getIconUrl('actions', + 'edit'), + ['style' => 'height: 18px;']))]; return $this->_tag('ul', $this->_tag('h3', $this->_('Accéder à l\'administration')) . diff --git a/public/admin/skins/bokeh74/front_nav.css b/public/admin/skins/bokeh74/front_nav.css index c6130005b8733db3ec97d6ef84131da597f31fd0..dd63dc3b19534449bbb3ade6b98351d588896e42 100644 --- a/public/admin/skins/bokeh74/front_nav.css +++ b/public/admin/skins/bokeh74/front_nav.css @@ -1,3 +1,8 @@ +.menu_admin_front * { + box-sizing: content-box; + font-family: arial, sans-serif; +} + .menu_admin_front { position: fixed; top: 0; @@ -10,9 +15,13 @@ transition: all 0.4s; } +.menu_admin_front .form select, .menu_admin_front > div { - overflow: hidden; background-color: var(--nav-background); +} + +.menu_admin_front > div { + overflow: hidden; width: 300px; height: 500px; } @@ -30,9 +39,16 @@ transform: rotate(45deg); } +.menu_admin_front .form select, +.menu_admin_front label, .menu_admin_front h3, .menu_admin_front a { color: var(--nav-text); +} + +.menu_admin_front form tr, +.menu_admin_front h3, +.menu_admin_front a { display: block; line-height: 2em; } @@ -59,7 +75,45 @@ display: none; } +.footer select[onchange], .footer a[href*="/admin"], .admin_tools_lock { display: none !important; -} \ No newline at end of file +} + +.menu_admin_front fieldset { + padding: 0; + margin: 0; +} + +.menu_admin_front .form td { + display: inline-block; + text-align: left !important; +} + +.menu_admin_front .form td + td { + text-align: right !important; + width: 150px; + overflow: hidden; + float: right; + margin-right: 1.5em; + vertical-align: middle; +} + +.menu_admin_front form + .boutons { + display: none; +} + +.menu_admin_front .form { + text-align: left; +} + +.menu_admin_front .form * { + display: block; +} + +.menu_admin_front .form select { + height: 2em; + border: 1px solid var(--nav-text); + width: 149px; +} \ No newline at end of file diff --git a/tests/application/modules/opac/controllers/IndexControllerTest.php b/tests/application/modules/opac/controllers/IndexControllerTest.php index 31d5de1ee169826e710ae41d4c87bc4a698f27e0..d2b36b858a582d3d4d5605c0273c7de3f2fcaad8 100644 --- a/tests/application/modules/opac/controllers/IndexControllerTest.php +++ b/tests/application/modules/opac/controllers/IndexControllerTest.php @@ -784,4 +784,10 @@ class IndexControllerWithBibAdminLoggedTest extends AbstractControllerTestCase { public function linkToAskForSkinUpdateShouldBeInMenu() { $this->assertXPathContentContains('//body/div//ul/li/ul/li/a', 'Mettre à jour la charte graphique'); } + + + /** @test */ + public function changeProfileSelectorShouldBeInMenu() { + $this->assertXPath('//body/div//ul/li/ul/li/form//select'); + } } \ No newline at end of file