From 46a691c39795fd596424ebaa01ff96ccc2635fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Gonz=C3=A1lez?= Date: Fri, 30 Apr 2021 13:24:55 +0200 Subject: [PATCH] Added standard headers --- .../godmode/reporting/graph_builder.php | 60 +++++++++++-------- .../reporting/visual_console_builder.php | 58 +++++++++++++----- .../operation/visual_console/view.php | 22 +++++-- 3 files changed, 94 insertions(+), 46 deletions(-) diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index 79fdfde250..53d5fbcbd1 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -26,10 +26,9 @@ * ============================================================================ */ +// Begin. global $config; - - if (is_ajax()) { $search_agents = (bool) get_parameter('search_agents'); @@ -340,37 +339,43 @@ if ($edit_graph) { $head = __('Graph builder'); -if (isset($name)) { - $head .= ' - '.$name; +if (isset($name) === true) { + $head .= ' » '.$name; } // Header. -$tab = get_parameter('tab', ''); +$tab = get_parameter('tab'); switch ($tab) { - default: - case 'main': - ui_print_page_header( - $head, - 'images/chart.png', - false, - 'graph_builder', - false, - $buttons - ); + case 'graph_editor': + $headerHelp = ''; break; - case 'graph_editor': - ui_print_page_header( - $head, - 'images/chart.png', - false, - '', - false, - $buttons - ); + case 'main': + default: + $headerHelp = 'graph_builder'; break; } +// Header. +ui_print_standard_header( + $head, + 'images/chart.png', + false, + $headerHelp, + false, + [$buttons], + [ + [ + 'link' => '', + 'label' => __('Reporting'), + ], + [ + 'link' => '', + 'label' => __('Custom graphs'), + ], + ] +); + if ($add_graph) { ui_print_result_message( $id_graph, @@ -418,7 +423,8 @@ if (!$delete_module) { $chunk1 = explode('|', $chunkdata); $modules = ''; $weights = ''; - for ($a = 0; $a < count($chunk1); $a++) { + $chunkCount = count($chunk1); + for ($a = 0; $a < $chunkCount; $a++) { $chunk2[$a] = []; $chunk2[$a] = explode(',', $chunk1[$a]); if (strpos($modules, $chunk2[$a][1]) == 0) { @@ -450,4 +456,8 @@ switch ($active_tab) { case 'graph_editor': include_once 'godmode/reporting/graph_builder.graph_editor.php'; break; + + default: + // Nothing to do. + break; } diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index b03b55dd76..8c18dccd2c 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -1,16 +1,33 @@ '', + 'label' => __('Topology maps'), + ], + [ + 'link' => '', + 'label' => __('Visual console'), + ], + ] ); } diff --git a/pandora_console/operation/visual_console/view.php b/pandora_console/operation/visual_console/view.php index 3b9250b865..12ca2e3869 100644 --- a/pandora_console/operation/visual_console/view.php +++ b/pandora_console/operation/visual_console/view.php @@ -36,8 +36,6 @@ require_once $config['homedir'].'/vendor/autoload.php'; // TODO: include file functions. require_once $config['homedir'].'/include/functions_visual_map.php'; -error_log('HOLA'); - /** * Function for return button visual console edition. @@ -200,7 +198,7 @@ $options['view']['text'] = ''.html_print_image( 'images/full_screen.png', @@ -210,13 +208,25 @@ if (!is_metaconsole()) { 'class' => 'invert_filter', ] ).''; - ui_print_page_header( + + // Header. + ui_print_standard_header( $visualConsoleName, 'images/visual_console.png', false, 'visual_console_view', false, - $options + $options, + [ + [ + 'link' => '', + 'label' => __('Topology maps'), + ], + [ + 'link' => '', + 'label' => __('Visual console'), + ], + ] ); } @@ -467,7 +477,7 @@ if ($pure === true) { // Check groups can access user. $aclUserGroups = []; -if (!users_can_manage_group_all('AR')) { +if (users_can_manage_group_all('AR') === false) { $aclUserGroups = array_keys(users_get_groups(false, 'AR')); }