diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 46732e0f08..1033727f70 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2012-10-10 Miguel de Dios + + * include/functions_networkmap.php: fixes and changes for the new + form to set the urls and url images. + + * include/functions_html.php: fixed the "html_print_image" for the + relative urls images (uses in the networkmap). + 2012-10-10 Sergio Martin * pandoradb_data.sql diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 54cf5a559e..1c88d4bd1b 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -1255,7 +1255,7 @@ function html_print_image ($src, $return = false, $options = false, $return_src // If metaconsole is in use then don't use skins if (!defined('METACONSOLE')) { - + /* Checks if user's skin is available */ $isFunctionSkins = enterprise_include_once ('include/functions_skins.php'); @@ -1267,13 +1267,20 @@ function html_print_image ($src, $return = false, $options = false, $return_src } - $src_tmp = $src; - $src = ui_get_full_url($src); + if (!$relative) { + $src_tmp = $src; + $src = ui_get_full_url($src); + } // If metaconsole is activated and image doesn't exists try to search on normal console if (defined('METACONSOLE')) { - if (false === file_get_contents($src,0,null,0,1)) { - $src = ui_get_full_url('../../' . $src_tmp); + if (!$relative) { + if (false === @file_get_contents($src,0,null,0,1)) { + $src = ui_get_full_url('../../' . $src_tmp); + } + } + else { + $src = '../../' . $src; } } diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index 4596fa81d1..3249d1ce84 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -501,9 +501,10 @@ function networkmap_create_agent_node ($agent, $simple = 0, $font_size = 10, $cu // Set node icon $img_node = ui_print_os_icon ($agent['id_os'], false, true, true, true, true, $relative); $img_node = str_replace($config['homeurl'] . '/', '', $img_node); + $img_node = str_replace($config['homeurl'], '', $img_node); if (defined('METACONSOLE')) { - $img_node = '../../' . $img_node; + $img_node = str_replace('../../', '', $img_node); } if ($relative) { @@ -582,7 +583,6 @@ function networkmap_create_pandora_node ($name, $font_size = 10, $simple = 0, $s $img_src = "images/networkmap/pandora_node.png"; if (defined('METACONSOLE')) { - $img_src = '../../' . $img_src; $url_tooltip = '../../ajax.php?' . 'page=include/ajax/networkmap.ajax&' .