diff --git a/library/ZendAfi/View/Helper/Admin/FrontNav.php b/library/ZendAfi/View/Helper/Admin/FrontNav.php index 9ad46ea694f00796f132b16eaab26bff8ff5e4ad..8165ed133d0ea3b545133968b0eb7e34fdb4c803 100644 --- a/library/ZendAfi/View/Helper/Admin/FrontNav.php +++ b/library/ZendAfi/View/Helper/Admin/FrontNav.php @@ -83,25 +83,41 @@ class ZendAfi_View_Helper_Admin_FrontNav extends ZendAfi_View_Helper_BaseHelper $actions = [$this->view->tagAnchor($clear_cache_url, $this->_("Vider le cache de Bokeh")), - $this->view->tagAnchor('#', - $this->_('Déplacement des boites') . - $this->view->tagImg(Class_Admin_Skin::current() - ->getIconUrl('actions', - 'toggle_off')), - ['class' => 'activate_block_sorting', - 'onclick' => 'window.reactiveOpacBlocksSorting();return true;']), - $this->view->tagAnchor('#', - $this->_('Déplacement des boites') . - $this->view->tagImg(Class_Admin_Skin::current() - ->getIconUrl('actions', - 'toggle_on')), - ['class' => 'deactivate_block_sorting', - 'onclick' => 'window.deactiveOpacBlocksSorting();return true;']), - $this->view->tagAnchor('#', - $this->_('Editeur CSS'), - ['onclick' => 'window.smalltalk.AFICssEditor._open();return true;'])]; - - return $this->_tag('ul', implode($this->_lify($actions))); + $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, + 'onclick' => $js . ';return true;']); + }; + + return $toggleFy($js_on, 'toggle_off', 'activate_') . $toggleFy($js_off, 'toggle_on', 'deactivate_'); } diff --git a/public/admin/js/cfg.accueil.js b/public/admin/js/cfg.accueil.js index f7a4c1fa060cf7611ba69b696716b67b98191c00..7a504fd6e86d50d69009e79a87d11ca096775671 100644 --- a/public/admin/js/cfg.accueil.js +++ b/public/admin/js/cfg.accueil.js @@ -43,7 +43,6 @@ function opacBlocksSorting(moduleSortUrl, currentProfilId) { opacBlocksSortingInitPositions(); }}); }}); - window.deactiveOpacBlocksSorting(); } diff --git a/public/admin/js/global.js b/public/admin/js/global.js index 4738de521fb20dfd8929d03eb8dd8748eaaf4146..fe529d3b30245696e454f02bff2eceaee904ca0f 100644 --- a/public/admin/js/global.js +++ b/public/admin/js/global.js @@ -270,16 +270,63 @@ if (initializeNoticeMurAnimation == undefined) { function deactiveOpacBlocksSorting() { $('div.layout-division>div').sortable("disable"); - $('.activate_block_sorting').closest('li').show(); - $('.deactivate_block_sorting').closest('li').hide(); + $('.activate_block_sorting').show(); + $('.deactivate_block_sorting').hide(); } + function reactiveOpacBlocksSorting() { $('div.layout-division>div').sortable("enable"); - $('.deactivate_block_sorting').closest('li').show(); - $('.activate_block_sorting').closest('li').hide(); + $('.deactivate_block_sorting').show(); + $('.activate_block_sorting').hide(); +} + + +function showCSSEditor() { + smalltalk.AFICssEditor._open(); + $('.activate_css_editor').hide(); + $('.deactivate_css_editor').show(); + $('#amber').show(); +} + + +function hideCSSEditor() { + smalltalk.AFICssEditor._close(); + $('.activate_css_editor').show(); + $('.deactivate_css_editor').hide(); + $('#amber').hide(); +} + + +function showAmberIDE() { + smalltalk.Browser._open(); + $('.activate_amber_ide').hide(); + $('.deactivate_amber_ide').show(); + $('#amber').show(); +} + + +function hideAmberIDE() { + $('.activate_amber_ide').show(); + $('.deactivate_amber_ide').hide(); + $('#amber').hide(); +} + + +function showZFDebug() { + $("#ZFDebug").show(); + $('.activate_zf_debug').hide(); + $('.deactivate_zf_debug').show(); } + +function hideZFDebug() { + $("#ZFDebug").hide(); + $('.activate_zf_debug').show(); + $('.deactivate_zf_debug').hide(); +} + + function hideMenuAdmin() { $('#menuAdmin').css('display','none'); } @@ -289,8 +336,6 @@ function showMenuAdmin() { $('#menuAdmin').css('display','block'); } - - function toggleMenuAdmin(anchor) { if(!$('#menuAdmin').length) return; diff --git a/public/admin/skins/bokeh74/front_nav.css b/public/admin/skins/bokeh74/front_nav.css index 6877089ca4dc55e781b3f6087dae9e8a1e334e2d..170bae1755ad9b8f4ce3980ea2ad43b87ead0696 100644 --- a/public/admin/skins/bokeh74/front_nav.css +++ b/public/admin/skins/bokeh74/front_nav.css @@ -30,13 +30,14 @@ transform: rotate(45deg); } +.menu_admin_front h3, .menu_admin_front a { color: var(--nav-text); display: block; line-height: 2em; } -.menu_admin_front img { +.menu_admin_front a img { filter: invert(); float: right; vertical-align: middle; @@ -47,4 +48,17 @@ .menu_admin_front li { margin: 0 0 0 0.5em; padding: 0 0 0 0.5em; + list-style: none; +} + +.menu_admin_front [class*="deactivate"] { + display: none; +} + +#amber_close { + display: none; +} + +.admin_tools_lock { + display: none !important; } \ No newline at end of file