diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index d10ed9c341..0cfd1387b3 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -75,6 +75,11 @@ var id_user = ""; var cookie_name = id_user + '-pandora_menu_state'; var cookie_name_encoded = btoa(cookie_name); var click_display = ""; +var classic_menu = ""; + +if (classic_menu) { + autohidden_menu = true; +} var menuState = $.cookie(cookie_name_encoded); if (!menuState) { @@ -226,29 +231,18 @@ $(document).ready( function() { */ handsInMenu = 0; openTimeMenu = 0; - if(!click_display){ - $('#menu').mouseenter(function() { - $('div#title_menu').show(); - handsInMenu = 1; - openTimeMenu = new Date().getTime(); - $('#menu').css('width', '145px'); - $('li.menu_icon').addClass( " no_hidden_menu" ); - $('ul.submenu').css('left', '144px'); - }).mouseleave(function() { - handsInMenu = 0; - setTimeout(function() { - openedMenu = new Date().getTime() - openTimeMenu; - if(openedMenu > 1000 && handsInMenu == 0) { - $('#menu').css('width', '45px'); - $('li.menu_icon').removeClass( " no_hidden_menu"); - $('ul.submenu').css('left', '44px'); - $('div#title_menu').hide(); - } - }, 2500); - }); - }else{ - $(document).ready(function() { - $('#menu').on("click", function() { + if (classic_menu) { + $('div#title_menu').show(); + handsInMenu = 1; + openTimeMenu = new Date().getTime(); + $('#menu').css('width', '145px'); + $('#menu').css('position', 'block'); + $('li.menu_icon').addClass( " no_hidden_menu" ); + $('ul.submenu').css('left', '144px'); + } + else { + if(!click_display){ + $('#menu').mouseenter(function() { $('div#title_menu').show(); handsInMenu = 1; openTimeMenu = new Date().getTime(); @@ -267,10 +261,35 @@ $(document).ready( function() { $('ul.submenu').css('left', '44px'); $('div#title_menu').hide(); } - }, 5500); + }, 2500); }); - }); + }else{ + $(document).ready(function() { + $('#menu').on("click", function() { + $('div#title_menu').show(); + handsInMenu = 1; + openTimeMenu = new Date().getTime(); + $('#menu').css('width', '145px'); + $('li.menu_icon').addClass( " no_hidden_menu" ); + $('li.menu_icon').find('li').addClass( " no_hidden_menu" ); + $('ul.submenu').css('left', '144px'); + }).mouseleave(function() { + handsInMenu = 0; + setTimeout(function() { + openedMenu = new Date().getTime() - openTimeMenu; + if(openedMenu > 1000 && handsInMenu == 0) { + $('#menu').css('width', '45px'); + $('li.menu_icon').removeClass( " no_hidden_menu"); + $('li.menu_icon').find('li').removeClass( " no_hidden_menu" ); + $('ul.submenu').css('left', '44px'); + $('div#title_menu').hide(); + } + }, 5500); + }); + }); + } } + /*$('#menu').mouseenter(function() { $('div#title_menu').show(); handsInMenu = 1; @@ -416,9 +435,76 @@ $(document).ready( function() { }); $(document).ready(function() { - //Daniel maya 02/06/2016 Display menu with click --INI - if(!click_display){ + if (!classic_menu) { + //Daniel maya 02/06/2016 Display menu with click --INI + if(!click_display){ + $('#container').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); + $('#menu').css('width', '45px'); + $('li.menu_icon').removeClass( " no_hidden_menu"); + $('ul.submenu').css('left', '44px'); + $('div#title_menu').hide(); + }); + }else{ + $('#main').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); + $('#menu').css('width', '45px'); + $('li.menu_icon').removeClass( " no_hidden_menu"); + $('ul.submenu').css('left', '44px'); + $('div#title_menu').hide(); + }); + } + //Daniel maya 02/06/2016 Display menu with click --END + } + else { $('#container').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); + $('ul.submenu').css('left', '144px'); + }); + + $('#main').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); + $('ul.submenu').css('left', '144px'); + }); + } + + if (classic_menu) { + $('div.menu>ul>li>ul>li>a').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); + $('ul.submenu').css('left', '144px'); + }); + + $('div.menu>ul>li>ul>li>ul>li>a').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); + $('ul.submenu').css('left', '144px'); + }); + } + else { + $('div.menu>ul>li>ul>li>a').click(function() { openTime = 4000; if( typeof(table_hover) != 'undefined') $("ul#sub"+table_hover[0].id).hide(); @@ -428,9 +514,9 @@ $(document).ready( function() { $('li.menu_icon').removeClass( " no_hidden_menu"); $('ul.submenu').css('left', '44px'); $('div#title_menu').hide(); - }); - }else{ - $('#main').click(function() { + }); + + $('div.menu>ul>li>ul>li>ul>li>a').click(function() { openTime = 4000; if( typeof(table_hover) != 'undefined') $("ul#sub"+table_hover[0].id).hide(); @@ -442,30 +528,6 @@ $(document).ready( function() { $('div#title_menu').hide(); }); } - //Daniel maya 02/06/2016 Display menu with click --END - - $('div.menu>ul>li>ul>li>a').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('#menu').css('width', '45px'); - $('li.menu_icon').removeClass( " no_hidden_menu"); - $('ul.submenu').css('left', '44px'); - $('div#title_menu').hide(); - }); - $('div.menu>ul>li>ul>li>ul>li>a').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('#menu').css('width', '45px'); - $('li.menu_icon').removeClass( " no_hidden_menu"); - $('ul.submenu').css('left', '44px'); - $('div#title_menu').hide(); - }); }); diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index f518622353..9c34f9b501 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -122,6 +122,17 @@ if (enterprise_installed()) { $row++; } +$table_behaviour->data[$row][0] = __('Classic menu mode'). + ui_print_help_tip(__('Text menu options always visible, don\'t hide'), true); +$table_behaviour->data[$row][1] = __('Yes') . ' ' . + html_print_radio_button ('classic_menu', 1, '', + $config["classic_menu"], true) . + ' '; +$table_behaviour->data[$row][1] .= __('No') . ' ' . + html_print_radio_button ('classic_menu', 0, '', + $config["classic_menu"], true); +$row++; + echo "