diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 8a29ff44a3..e94132dee4 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -213,85 +213,107 @@ if ($config['menu_type'] == 'classic') { $select[0]['autorefresh_white_list'] ); - if ($autorefresh_list !== null - && array_search($_GET['sec2'], $autorefresh_list) !== false + if ($_GET['sec2'] === 'operation/visual_console/render_view' + && $config['legacy_vc'] ) { - $do_refresh = true; - if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') { - if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) { - $do_refresh = false; + if ($autorefresh_list !== null + && array_search($_GET['sec2'], $autorefresh_list) !== false + ) { + $do_refresh = true; + if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') { + if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) { + $do_refresh = false; + } } - } - if ($do_refresh) { + if ($do_refresh) { + $autorefresh_img = html_print_image( + 'images/header_refresh_gray.png', + true, + [ + 'class' => 'bot', + 'alt' => 'lightning', + 'title' => __('Configure autorefresh'), + ] + ); + + if ((isset($select[0]['time_autorefresh']) === true) + && $select[0]['time_autorefresh'] !== 0 + && $config['refr'] === null + ) { + $config['refr'] = $select[0]['time_autorefresh']; + $autorefresh_txt .= ' ('; + $autorefresh_txt .= date( + 'i:s', + $config['refr'] + ); + $autorefresh_txt .= ')'; + } else if ($_GET['refr']) { + $autorefresh_txt .= ' ('; + $autorefresh_txt .= date('i:s', $config['refr']); + $autorefresh_txt .= ')'; + } + + $ignored_params['refr'] = ''; + $values = get_refresh_time_array(); + + $autorefresh_additional = ' '; + unset($values); + if ($home_page != '') { + $autorefresh_link_open_img = ''; + } else { + $autorefresh_link_open_img = ''; + } + + if ($_GET['refr'] + || ((isset($select[0]['time_autorefresh']) === true) + && $select[0]['time_autorefresh'] !== 0) + ) { + if ($home_page != '') { + $autorefresh_link_open_txt = ''; + } else { + $autorefresh_link_open_txt = ''; + } + } else { + $autorefresh_link_open_txt = ''; + } + + $autorefresh_link_close = ''; + $display_counter = 'display:block'; + } else { + $autorefresh_img = html_print_image('images/header_refresh_disabled_gray.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]); + + $ignored_params['refr'] = false; + + $autorefresh_link_open_img = ''; + $autorefresh_link_open_txt = ''; + $autorefresh_link_close = ''; + + $display_counter = 'display:none'; + } + } else { $autorefresh_img = html_print_image( - 'images/header_refresh_gray.png', + 'images/header_refresh_disabled_gray.png', true, [ - 'class' => 'bot', + 'class' => 'bot autorefresh_disabled', 'alt' => 'lightning', - 'title' => __('Configure autorefresh'), + 'title' => __('Disabled autorefresh'), ] ); - if ((isset($select[0]['time_autorefresh']) === true) - && $select[0]['time_autorefresh'] !== 0 - && $config['refr'] === null - ) { - $config['refr'] = $select[0]['time_autorefresh']; - $autorefresh_txt .= ' ('; - $autorefresh_txt .= date( - 'i:s', - $config['refr'] - ); - $autorefresh_txt .= ')'; - } else if ($_GET['refr']) { - $autorefresh_txt .= ' ('; - $autorefresh_txt .= date('i:s', $config['refr']); - $autorefresh_txt .= ')'; - } - - $ignored_params['refr'] = ''; - $values = get_refresh_time_array(); - - $autorefresh_additional = ' '; - unset($values); - if ($home_page != '') { - $autorefresh_link_open_img = ''; - } else { - $autorefresh_link_open_img = ''; - } - - if ($_GET['refr'] - || ((isset($select[0]['time_autorefresh']) === true) - && $select[0]['time_autorefresh'] !== 0) - ) { - if ($home_page != '') { - $autorefresh_link_open_txt = ''; - } else { - $autorefresh_link_open_txt = ''; - } - } else { - $autorefresh_link_open_txt = ''; - } - - $autorefresh_link_close = ''; - $display_counter = 'display:block'; - } else { - $autorefresh_img = html_print_image('images/header_refresh_disabled_gray.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]); - $ignored_params['refr'] = false; $autorefresh_link_open_img = ''; @@ -300,39 +322,21 @@ if ($config['menu_type'] == 'classic') { $display_counter = 'display:none'; } - } else { - $autorefresh_img = html_print_image( - 'images/header_refresh_disabled_gray.png', - true, - [ - 'class' => 'bot autorefresh_disabled', - 'alt' => 'lightning', - 'title' => __('Disabled autorefresh'), - ] - ); - $ignored_params['refr'] = false; + $header_autorefresh = '