From 2a4c603bb433fc21d4deaa87d1c0b41cc55a1bea Mon Sep 17 00:00:00 2001 From: hugetoad Date: Sun, 4 Jan 2004 10:13:41 +0000 Subject: More support for different connector types/colors. git-svn-id: svn://svn.zabbix.com/trunk@1130 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/map.php | 44 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) (limited to 'frontends/php/map.php') diff --git a/frontends/php/map.php b/frontends/php/map.php index e811201d..698f5f89 100644 --- a/frontends/php/map.php +++ b/frontends/php/map.php @@ -54,6 +54,19 @@ $black=ImageColorAllocate($im,0,0,0); $gray=ImageColorAllocate($im,150,150,150); + $colors["Red"]=ImageColorAllocate($im,255,0,0); + $colors["Dark Red"]=ImageColorAllocate($im,150,0,0); + $colors["Green"]=ImageColorAllocate($im,0,255,0); + $colors["Dark Green"]=ImageColorAllocate($im,0,150,0); + $colors["Blue"]=ImageColorAllocate($im,0,0,255); + $colors["Dark Blue"]=ImageColorAllocate($im,0,0,150); + $colors["Yellow"]=ImageColorAllocate($im,255,255,0); + $colors["Dark Yellow"]=ImageColorAllocate($im,150,150,0); + $colors["Cyan"]=ImageColorAllocate($im,0,255,255); + $colors["Black"]=ImageColorAllocate($im,0,0,0); + $colors["Gray"]=ImageColorAllocate($im,150,150,150); + $colors["White"]=ImageColorAllocate($im,255,255,255); + $x=imagesx($im); $y=imagesy($im); @@ -62,11 +75,11 @@ if(!isset($HTTP_GET_VARS["border"])) { - ImageRectangle($im,0,0,$width-1,$height-1,$black); + ImageRectangle($im,0,0,$width-1,$height-1,$colors["Black"]); } $x=imagesx($im)/2-ImageFontWidth(4)*strlen($name)/2; - ImageString($im, 4,$x,1, $name , $darkred); + ImageString($im, 4,$x,1, $name , $colors["Dark Red"]); $str=date("m.d.Y H:i:s",time(NULL)); ImageString($im, 0,imagesx($im)-120,imagesy($im)-12,"$str", $gray); @@ -96,12 +109,16 @@ # Draw connectors - $result=DBselect("select shostid1,shostid2,triggerid from sysmaps_links where sysmapid=".$HTTP_GET_VARS["sysmapid"]); + $result=DBselect("select shostid1,shostid2,triggerid,color_off,drawtype_off,color_on,drawtype_on from sysmaps_links where sysmapid=".$HTTP_GET_VARS["sysmapid"]); for($i=0;$i