Added standard headers

This commit is contained in:
José González 2021-04-30 13:24:55 +02:00
parent 3f33a0ec29
commit 46a691c397
3 changed files with 94 additions and 46 deletions

View File

@ -26,10 +26,9 @@
* ============================================================================
*/
// Begin.
global $config;
if (is_ajax()) {
$search_agents = (bool) get_parameter('search_agents');
@ -340,36 +339,42 @@ 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(
case 'main':
default:
$headerHelp = 'graph_builder';
break;
}
// Header.
ui_print_standard_header(
$head,
'images/chart.png',
false,
'',
$headerHelp,
false,
$buttons
[$buttons],
[
[
'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom graphs'),
],
]
);
break;
}
if ($add_graph) {
ui_print_result_message(
@ -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;
}

View File

@ -1,16 +1,33 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Login check
/**
* Extension to manage a list of gateways and the node address where they should
* point to.
*
* @category Extensions
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
global $statusProcessInDB;
@ -810,14 +827,25 @@ $buttons[$activeTab]['active'] = true;
$tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : '';
if (!defined('METACONSOLE')) {
ui_print_page_header(
if (is_metaconsole() === false) {
// Header.
ui_print_standard_header(
$visualConsoleName,
'images/visual_console.png',
false,
$tab_builder,
false,
$buttons
$buttons,
[
[
'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('Visual console'),
],
]
);
}

View File

@ -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'] = '<a href="index.php?sec=network&sec2=operation/visual
).'</a>';
$options['view']['active'] = true;
if (!is_metaconsole()) {
if (is_metaconsole() === false) {
if (!$config['pure']) {
$options['pure']['text'] = '<a href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$visualConsoleId.'&pure=1&refr='.$refr.'">'.html_print_image(
'images/full_screen.png',
@ -210,13 +208,25 @@ if (!is_metaconsole()) {
'class' => 'invert_filter',
]
).'</a>';
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'));
}