2011-08-17 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_html.php, include/functions_networkmap.php,
	include/functions_ui.php: fixed to use the name of file in tconfig_os
	instead the id for icon networkmap.

	* images/networkmap/*: renamed the image files to use the names of
	tconfig_os.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4760 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2011-08-17 16:22:29 +00:00
parent e37825274d
commit d587b33f0a
17 changed files with 35 additions and 13 deletions

View File

@ -1,3 +1,12 @@
2011-08-17 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php, include/functions_networkmap.php,
include/functions_ui.php: fixed to use the name of file in tconfig_os
instead the id for icon networkmap.
* images/networkmap/*: renamed the image files to use the names of
tconfig_os.
2011-08-17 Sancho Lerena <slerena@artica.es>
* operation/snmpconsole/snmp_view.php: SQL optimization and

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -1144,15 +1144,15 @@ function html_print_image ($src, $return = false, $options = false, $return_src
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
$skin_path = enterprise_hook('skins_get_image_path',array($src));
if ($skin_path)
$src = $skin_path;
$src = $skin_path;
}
// path to image (relative or absolute)
$src = ($relative? '' : $config["homeurl"] . '/') . $src;
// Only return src field of image
if ($return_src){
if (!$return){
if ($return_src) {
if (!$return) {
echo io_safe_input($src);
return;
}

View File

@ -433,11 +433,8 @@ function networkmap_create_agent_node ($agent, $simple = 0, $font_size = 10) {
if ($simple == 0){
// Set node icon
if (file_exists (html_print_image('images/networkmap/'.$agent['id_os'].'.png', true, false, true, true))) {
$img_node = 'images/networkmap/'.$agent['id_os'].'.png';
} else {
$img_node = 'images/networkmap/0.png';
}
$img_node = ui_print_os_icon ($agent['id_os'], false, true, true, true, true);
$img_node = str_replace('/pandora_console/', '', $img_node);
$node = $agent['id_node'].' [ color="'.$status_color.'", fontsize='.$font_size.', style="filled", fixedsize=true, width=0.40, height=0.40, label=<<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR><TD>' . html_print_image($img_node, true, false, false, true) . '</TD></TR>
<TR><TD>'.$name.'</TD></TR></TABLE>>,

View File

@ -390,18 +390,34 @@ function ui_print_group_icon_path ($id_group, $return = false, $path = "images/g
*
* @return string HTML with icon of the OS
*/
function ui_print_os_icon ($id_os, $name = true, $return = false, $apply_skin = true) {
function ui_print_os_icon ($id_os, $name = true, $return = false, $apply_skin = true, $networkmap = false, $only_src = false) {
$subfolter = 'os_icons';
if ($networkmap) {
$subfolter = 'networkmap';
}
$icon = (string) db_get_value ('icon_name', 'tconfig_os', 'id_os', (int) $id_os);
$os_name = get_os_name ($id_os);
if (empty ($icon)) {
return "-";
if ($only_src) {
$output = html_print_image("images/".$subfolter."/unknown.png", false, false, true);
}
else {
return "-";
}
}
if ($apply_skin)
$output = html_print_image("images/os_icons/".$icon, true, array("alt" => $os_name, "title" => $os_name));
if ($apply_skin) {
if ($only_src) {
$output = html_print_image("images/".$subfolter."/".$icon, true, false, true);
}
else {
$output = html_print_image("images/".$subfolter."/".$icon, true, array("alt" => $os_name, "title" => $os_name));
}
}
else
//$output = "<img src='images/os_icons/" . $icon . "' alt='" . $os_name . "' title='" . $os_name . "'>";
$output = "images/os_icons/" . $icon;
$output = "images/".$subfolter."/" . $icon;
if ($name === true) {
$output .= ' - '.$os_name;