From c411c026fac43a5169960bf29501e8a783bb6a98 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Diaz Date: Mon, 5 Oct 2015 16:45:49 +0200 Subject: [PATCH] Fixed external link images in meta. Ticket#2827 --- pandora_console/include/functions_html.php | 9 ++++++-- .../include/functions_visual_map.php | 22 +++++++++++-------- .../visual_console/public_console.php | 2 +- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 54586d884f..cdfc4349c7 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -1775,7 +1775,7 @@ function html_print_checkbox ($name, $value, $checked = false, $return = false, * @return string HTML code if return parameter is true. */ function html_print_image ($src, $return = false, $options = false, - $return_src = false, $relative = false, $no_in_meta = false) { + $return_src = false, $relative = false, $no_in_meta = false, $isExternalLink = false) { global $config; @@ -1808,7 +1808,12 @@ function html_print_image ($src, $return = false, $options = false, } if (!is_readable($working_dir . '/enterprise/meta' . $src)) { - $src = ui_get_full_url('../..' . $src); + if ($isExternalLink) { + $src = ui_get_full_url($src); + } + else { + $src = ui_get_full_url('../..' . $src); + } } else { $src = ui_get_full_url($src); diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 5e4d8a30d6..6a5917d577 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -88,7 +88,7 @@ function visual_map_print_user_line_handles($layoutData) { } function visual_map_print_item($mode = "read", $layoutData, - $proportion = null, $show_links = true) { + $proportion = null, $show_links = true, $isExternalLink = false) { global $config; require_once ($config["homedir"] . '/include/functions_graph.php'); @@ -158,7 +158,7 @@ function visual_map_print_item($mode = "read", $layoutData, $element_enterprise = array(); if (enterprise_installed()) { $element_enterprise = enterprise_visual_map_print_item( - $mode, $layoutData, $proportion, $show_links); + $mode, $layoutData, $proportion, $show_links, $isExternalLink); } @@ -873,13 +873,15 @@ function visual_map_print_item($mode = "read", $layoutData, "width" => "$width", "height" => "$height", "title" => $img_style_title, - "style" => $borderStyle)); + "style" => $borderStyle), false, + false, false, $isExternalLink); else echo html_print_image($img, true, array("class" => "image", "id" => "image_" . $id, "title" => $img_style_title, - "style" => $borderStyle)); + "style" => $borderStyle), false, + false, false, $isExternalLink); echo '
'; } echo io_safe_output($text); @@ -983,10 +985,12 @@ function visual_map_print_item($mode = "read", $layoutData, array("class" => "image", "id" => "image_" . $id, "width" => "$width", - "height" => "$height")); + "height" => "$height"), false, + false, false, $isExternalLink); else echo html_print_image($img, true, - array("class" => "image", "id" => "image_" . $id)); + array("class" => "image", "id" => "image_" . $id), + false, false, false, $isExternalLink); echo '
'; } break; @@ -1768,8 +1772,8 @@ function visual_map_print_user_lines($layout_data, $proportion = null) { * @param bool $draw_lines */ function visual_map_print_visual_map ($id_layout, $show_links = true, - $draw_lines = true, $width = null, $height = null, $home_url = '') { - + $draw_lines = true, $width = null, $height = null, $home_url = '', $isExternalLink = false) { + enterprise_include_once('include/functions_visual_map.php'); global $config; @@ -1917,7 +1921,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, break; default: visual_map_print_item("read", $layout_data, - $proportion, $show_links); + $proportion, $show_links, $isExternalLink); break; } } diff --git a/pandora_console/operation/visual_console/public_console.php b/pandora_console/operation/visual_console/public_console.php index 0145ecbfa4..4bd57a8b1f 100755 --- a/pandora_console/operation/visual_console/public_console.php +++ b/pandora_console/operation/visual_console/public_console.php @@ -79,7 +79,7 @@ $options = array(); echo '
'; echo "

" . $layout_name . "

"; -visual_map_print_visual_map ($id_layout, true, true, null, null, '../../'); +visual_map_print_visual_map ($id_layout, true, true, null, null, '../../', true); $values = array (); $values[5] = human_time_description_raw (5);