From 83c47c48334e1326d2206c48374697f828e81a29 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 13 Nov 2013 10:29:04 +0000 Subject: [PATCH] 2013-11-13 Miguel de Dios * operation/visual_console/render_view.php, operation/visual_console/public_console.php: fixed the refresh of visualmaps. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9070 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 +++ .../visual_console/public_console.php | 49 +++++++++---------- .../operation/visual_console/render_view.php | 47 ------------------ 3 files changed, 30 insertions(+), 72 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 8a23d7ec75..779ffac1f9 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2013-11-13 Miguel de Dios + + * operation/visual_console/render_view.php, + operation/visual_console/public_console.php: fixed the refresh of + visualmaps. + 2013-11-12 Sergio Martin * general/shortcut_bar.php: Fix styles, icons and links of the diff --git a/pandora_console/operation/visual_console/public_console.php b/pandora_console/operation/visual_console/public_console.php index c55cd98006..a668ee4ced 100644 --- a/pandora_console/operation/visual_console/public_console.php +++ b/pandora_console/operation/visual_console/public_console.php @@ -35,10 +35,6 @@ ob_start ('ui_process_page_head'); require ('include/functions_visual_map.php'); -// Auto Refresh page (can now be disabled anywhere in the script) -$config["refr"] = (int) get_parameter ("refr"); -$config["remote_addr"] = $_SERVER['REMOTE_ADDR']; - $hash = get_parameter ('hash'); $id_layout = (int) get_parameter ('id_layout'); $config["id_user"] = get_parameter ('id_user'); @@ -46,12 +42,11 @@ $config["id_user"] = get_parameter ('id_user'); $myhash = md5($config["dbpass"].$id_layout. $config["id_user"]); // Check input hash -if ( $myhash != $hash) { +if ($myhash != $hash) { exit; } -$refr = (int) get_parameter ('refr', $config['vc_refr']); -$vc_refr = false; +$refr = (int) get_parameter ('refr', 0); $layout = db_get_row ('tlayout', 'id', $id_layout); if (! $layout) { @@ -92,22 +87,13 @@ $table->style = array (); $table->style[2] = 'text-align: center'; $table->data[0][0] = __('Autorefresh time'); -if (empty($config["vc_refr"])) { - $vc_refr = true; - $config["vc_refr"] = $refr; -} - -$table->data[0][1] = html_print_select ($values, 'refr', $config["vc_refr"], '', 'N/A', 0, true, false, false); +$table->data[0][1] = html_print_select ($values, 'refr', $refr, '', 'N/A', 0, true, false, false); $table->data[0][2] = html_print_submit_button (__('Refresh'), '', false, 'class="sub next"', true); $table->data[0][2] .= html_print_input_hidden ('vc_refr', $config["vc_refr"], true); -if ($vc_refr) { - $config["vc_refr"] = 0; -} - echo '
 
'; -if ($config['pure'] && $config["refr"] != 0) { +if ($refr > 0) { echo '

'; } @@ -120,10 +106,12 @@ html_print_table ($table); echo ''; echo ''; -if ($config["pure"] && $config["refr"] != 0) { - ui_require_jquery_file ('countdown'); - ui_require_css_file ('countdown'); -} + +ui_require_jquery_file ('countdown'); +ui_require_css_file ('countdown'); + + + ui_require_javascript_file ('wz_jsgraphics'); ui_require_javascript_file ('pandora_visual_console'); ?> @@ -135,11 +123,22 @@ $(document).ready (function () { }); 0) { + if ($refr > 0) { ?> t = new Date(); - t.setTime (t.getTime() + ); - $("#countdown").countdown({until: t, format: 'MS', description: ''}); + t.setTime (t.getTime() + ); + $("#countdown").countdown( + { + until: t, + format: 'MS', + description: '', + onExpiry: function () { + href = ""; + href = href + "&refr="; + $(document).attr ("location", href); + } + } + ); width = '90%'; -$table->data = array (); -$table->style = array (); -$table->style[2] = 'text-align: center'; -$table->data[0][0] = __('Autorefresh time'); - -if (empty($config["vc_refr"])) { - $vc_refr = true; - $config["vc_refr"] = $refr; -} - -$table->data[0][1] = html_print_select ($values, 'refr', $config["vc_refr"], '', 'N/A', 0, true, false, false); -$table->data[0][2] = html_print_submit_button (__('Refresh'), '', false, 'class="sub next"', true); -$table->data[0][2] .= html_print_input_hidden ('vc_refr', $config["vc_refr"], true); - -if ($vc_refr) { - $config["vc_refr"] = 0; -} - -echo '
 
'; - -if ($config['pure'] && ((int)get_parameter('refr', 0)) != 0) { - echo '

'; -} - -echo '
 
'; - -if (!defined('METACONSOLE')) - echo '
'; -else - echo ''; - -html_print_input_hidden ('pure', $config["pure"]); -if (!defined('METACONSOLE')) - html_print_input_hidden ('id', $id_layout); -else - html_print_input_hidden ('id_visualmap', $id_layout); -html_print_table ($table); -echo '
'; if ($config["pure"] && ((int)get_parameter('refr', 0)) != 0) { ui_require_jquery_file ('countdown');