From 0acf4f41ebb8e589a1e2c9f81a5394db6d3f5026 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 2 Jun 2016 11:59:35 +0200 Subject: [PATCH] New development. Display lateral menus whit left click. --- pandora_console/general/main_menu.php | 114 ++++++++++++------ .../godmode/setup/setup_visuals.php | 13 ++ pandora_console/include/functions_config.php | 15 ++- 3 files changed, 101 insertions(+), 41 deletions(-) diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index 51a08a7e50..ad53a5bcbf 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -74,6 +74,7 @@ var fixed_header = ; var id_user = ""; var cookie_name = id_user + '-pandora_menu_state'; var cookie_name_encoded = btoa(cookie_name); +var click_display = ""; var menuState = $.cookie(cookie_name_encoded); if (!menuState) { @@ -250,31 +251,54 @@ $(document).ready( function() { openTime2 = 0; handsIn = 0; handsIn2 = 0; - - $('.menu_icon').mouseenter(function() { - table_hover = $(this); - handsIn = 1; - openTime = new Date().getTime(); - $("ul#sub"+table_hover[0].id).show(); - //$('div#menu').offset().top; - //$('div#menu').css('overflow','visible'); - if( typeof(table_noHover) != 'undefined') - if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id ) - $("ul#sub"+table_noHover[0].id).hide(); - }).mouseleave(function() { - //$('div#menu').css('overflow', 'hidden'); - table_noHover = $(this); - handsIn = 0; - setTimeout(function() { - opened = new Date().getTime() - openTime; - if(opened > 3000 && handsIn == 0) { - openTime = 4000; - $("ul#sub"+table_hover[0].id).hide(); - } - }, 3500); - }); - - + + //Daniel maya 02/06/2016 Display menu with click --INI + if(!click_display){ + $('.menu_icon').mouseenter(function() { + table_hover = $(this); + handsIn = 1; + openTime = new Date().getTime(); + $("ul#sub"+table_hover[0].id).show(); + if( typeof(table_noHover) != 'undefined') + if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id ) + $("ul#sub"+table_noHover[0].id).hide(); + }).mouseleave(function() { + table_noHover = $(this); + handsIn = 0; + setTimeout(function() { + opened = new Date().getTime() - openTime; + if(opened > 3000 && handsIn == 0) { + openTime = 4000; + $("ul#sub"+table_hover[0].id).hide(); + } + }, 3500); + }); + + }else{ + $(document).ready(function() { + $('.menu_icon').on("click", function() { + if( typeof(table_hover) != 'undefined'){ + $("ul#sub"+table_hover[0].id).hide(); + } + table_hover = $(this); + handsIn = 1; + openTime = new Date().getTime(); + $("ul#sub"+table_hover[0].id).show(); + }).mouseleave(function() { + table_noHover = $(this); + handsIn = 0; + setTimeout(function() { + opened = new Date().getTime() - openTime; + if(opened > 5000 && handsIn == 0) { + openTime = 6000; + $("ul#sub"+table_hover[0].id).hide(); + } + }, 5500); + }); + }); + } + //Daniel maya 02/06/2016 Display menu with click --END + - $('.has_submenu').mouseenter(function() { table_hover2 = $(this); handsIn2 = 1; @@ -296,18 +320,34 @@ $(document).ready( function() { }); $(document).ready(function() { - $('#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(); - }); - + //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 + $('div.menu>ul>li>ul>li>a').click(function() { openTime = 4000; if( typeof(table_hover) != 'undefined') diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 50d7ba5e38..ec927a38e2 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -99,6 +99,19 @@ $table_behaviour->data[$row][0] = __('Display text when proc modules have state $table_behaviour->data[$row][1] = html_print_input_text ('render_proc_fail', $config["render_proc_fail"], '', 25, 25, true); $row++; +//Daniel maya 02/06/2016 Display menu with click --INI +$table_behaviour->data[$row][0] = __('Display lateral menus with click'). + ui_print_help_tip(__('If you check this option, the lateral menus display with left click. Otherwise it will show by placing the mouse over'), true); +$table_behaviour->data[$row][1] = __('Yes') . ' ' . + html_print_radio_button ('click_display', 1, '', + $config["click_display"], true) . + '  '; +$table_behaviour->data[$row][1] .= __('No') . ' ' . + html_print_radio_button ('click_display', 0, '', + $config["click_display"], true); +$row++; +//Daniel maya 02/06/2016 Display menu with click --END + echo "
"; echo "" . __('Behaviour configuration') . ""; html_print_table ($table_behaviour); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 627dd1a682..69104a1f45 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -498,9 +498,12 @@ function config_update_config () { $error_update[] = __('Display text proc modules have state is ok'); if (!config_update_value ('render_proc_fail', (string) get_parameter('render_proc_fail', __('Fail') ))) $error_update[] = __('Display text when proc modules have state critical'); - - - + //Daniel maya 02/06/2016 Display menu with click --INI + if (!config_update_value ('click_display', (bool) get_parameter('click_display', false))) + $error_update[] = __('Display data of proc modules in other format'); + //Daniel maya 02/06/2016 Display menu with click --END + + //-------------------------------------------------- // CUSTOM VALUES POST PROCESS //-------------------------------------------------- @@ -1389,7 +1392,11 @@ function config_process_config () { if (!isset($config["render_proc_fail"])) { config_update_value ('render_proc_fail', __('Fail') ); } - + //Daniel maya 02/06/2016 Display menu with click --INI + if (!isset($config["click_display"])) { + config_update_value ('click_display', 0); + } + //Daniel maya 02/06/2016 Display menu with click --END if (!isset($config['command_snapshot'])) { config_update_value ('command_snapshot', 1); }