From 6093f6a0d872b3b4b18860e20e84fd9387d67a7d Mon Sep 17 00:00:00 2001 From: fermin831 Date: Wed, 28 Feb 2018 12:08:15 +0100 Subject: [PATCH] [Metaconsole] Fixed img broken links on metaconsole --- pandora_console/include/functions_ui.php | 21 ++++++++++++++----- .../agentes/interface_traffic_graph_win.php | 8 ++++++- .../operation/agentes/stat_win.php | 2 +- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index edcbad7ee4..56865d09e7 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1091,10 +1091,11 @@ function ui_print_alert_template_example ($id_alert_template, $return = false, $ * @param bool Whether to return or output the result * @param string Home url if its necessary * @param string Image path + * @param bool Route is relative or not * * @return string The help tip */ -function ui_print_help_icon ($help_id, $return = false, $home_url = '', $image = "images/help.png") { +function ui_print_help_icon ($help_id, $return = false, $home_url = '', $image = "images/help.png", $is_relative = false) { global $config; if (empty($home_url)) @@ -1104,10 +1105,16 @@ function ui_print_help_icon ($help_id, $return = false, $home_url = '', $image = $home_url = "../../" . $home_url; } - $output = html_print_image ($image, true, + $output = html_print_image ( + $image, + true, array ("class" => "img_help", "title" => __('Help'), - "onclick" => "open_help ('" . $help_id . "','" . $home_url . "','" . $config['id_user'] . "')")); + "onclick" => "open_help ('" . $help_id . "','" . $home_url . "','" . $config['id_user'] . "')" + ), + false, + $is_relative + ); if (!$return) echo $output; @@ -1904,11 +1911,15 @@ function ui_print_session_action_icon ($action, $return = false) { * @param string Complete text to show in the tip * @param bool whether to return an output string or echo now * @param img displayed image + * @param bool Print image in relative way * * @return string HTML code if return parameter is true. */ -function ui_print_help_tip ($text, $return = false, $img = 'images/tip.png') { - $output = '' . html_print_image ($img, true, array('title' => $text)) . ''; +function ui_print_help_tip ($text, $return = false, $img = 'images/tip.png', $is_relative = false) { + $output = + '' . + html_print_image ($img, true, array('title' => $text), false, $is_relative) . + ''; if ($return) return $output; diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index c232af6e91..d002194846 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -271,7 +271,13 @@ $interface_traffic_modules = array( $table->rowclass[] =''; $data = array(); - $data[0] = __('Show full scale graph (TIP)') . ui_print_help_tip(__('This option may cause performance issues'), true); + $data[0] = __('Show full scale graph (TIP)') . + ui_print_help_tip( + __('This option may cause performance issues'), + true, + 'images/tip.png', + true + ); $data[1] = html_print_checkbox ("fullscale", 1, (bool) $fullscale, true); $table->data[] = $data; $table->rowclass[] =''; diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 8e27312304..7465dfd144 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -290,7 +290,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); $params = array(); // TOP TEXT //Use the no_meta parameter because this image is only in the base console - $params['top_text'] = "
" . html_print_image('images/wrench_blanco.png', true, array('width' => '16px'), false, false, true) . ' ' . __('Pandora FMS Graph configuration menu') . ui_print_help_icon ("graphs",true, $config["homeurl"], "images/help_w.png") . "
"; + $params['top_text'] = "
" . html_print_image('images/wrench_blanco.png', true, array('width' => '16px'), false, false, true) . ' ' . __('Pandora FMS Graph configuration menu') . ui_print_help_icon ("graphs",true, $config["homeurl"], "images/help_w.png", true) . "
"; $params['body_text'] = "