summaryrefslogtreecommitdiffstats
path: root/frontends/php/map.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-06 12:36:19 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-06 12:36:19 +0000
commitd31ab2fdc7a4e1629c62480005e7df1e9c412944 (patch)
treea256fc701506ed857cf429dccf2fa166babc5afb /frontends/php/map.php
parent9ef27a42a050c16a0e76757507d922b5798eb2ef (diff)
downloadzabbix-d31ab2fdc7a4e1629c62480005e7df1e9c412944.tar.gz
zabbix-d31ab2fdc7a4e1629c62480005e7df1e9c412944.tar.xz
zabbix-d31ab2fdc7a4e1629c62480005e7df1e9c412944.zip
- added 'UNKNOWN' status for elements of map (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3871 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/map.php')
-rw-r--r--frontends/php/map.php59
1 files changed, 19 insertions, 40 deletions
diff --git a/frontends/php/map.php b/frontends/php/map.php
index e11c5d6f..5a05b40d 100644
--- a/frontends/php/map.php
+++ b/frontends/php/map.php
@@ -157,10 +157,10 @@ include_once "include/page_header.php";
while($db_element = DBfetch($db_elements))
{
- $img = get_png_by_selementid($db_element["selementid"]);
-
- if($img)
+ if( ($img = get_png_by_selementid($db_element["selementid"])) )
+ {
ImageCopy($im,$img,$db_element["x"],$db_element["y"],0,0,ImageSX($img),ImageSY($img));
+ }
if($label_type==MAP_LABEL_TYPE_NOTHING) continue;
@@ -172,53 +172,32 @@ include_once "include/page_header.php";
$label_line = $db_element["label"];
+ $el_info = get_info_by_selementid($db_element["selementid"]);
+
+ $info_line = $el_info['info'];
+ $color = $el_info['color'];
+
if($label_type==MAP_LABEL_TYPE_STATUS)
+ {
$label_line = "";
+ }
+ else if($label_type==MAP_LABEL_TYPE_NAME)
+ {
+ $label_line = $el_info['name'];
+ }
+
+ unset($el_info);
if($db_element["elementtype"] == SYSMAP_ELEMENT_TYPE_HOST)
{
$host = get_host_by_hostid($db_element["elementid"]);
-
- if($label_type==MAP_LABEL_TYPE_NAME)
- {
- $label_line=$host["host"];
- }
- else if($label_type==MAP_LABEL_TYPE_IP)
- {
+
+ if( $label_type==MAP_LABEL_TYPE_IP )
$label_line=$host["ip"];
- }
- if($host["status"] == HOST_STATUS_NOT_MONITORED)
- {
+ if( $host["status"] == HOST_STATUS_NOT_MONITORED )
$label_color=$darkred;
- }
- }
- elseif($db_element["elementtype"] == SYSMAP_ELEMENT_TYPE_MAP)
- {
- $map = get_sysmap_by_sysmapid($db_element["elementid"]);
- if($label_type==MAP_LABEL_TYPE_NAME)
- {
- $label_line=$map["name"];
- }
-
}
- elseif($db_element["elementtype"] == SYSMAP_ELEMENT_TYPE_TRIGGER && $db_element["elementid"]>0)
- {
- if($label_type==MAP_LABEL_TYPE_NAME)
- {
- $label_line = expand_trigger_description_simple($db_element["elementid"]);
- }
- }
- elseif($db_element["elementtype"] == SYSMAP_ELEMENT_TYPE_HOST_GROUP && $db_element["elementid"]>0)
- {
- if($label_type==MAP_LABEL_TYPE_NAME)
- {
- $group = DBfetch(DBselect('select * from groups where groupid='.$db_element["elementid"]));
- $label_line = $group["name"];
- }
- }
-
- get_info_by_selementid($db_element["selementid"],$info_line, $color);
if($label_line=="" && $info_line=="") continue;