diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2004-01-10 19:53:50 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2004-01-10 19:53:50 +0000 |
commit | aa75108f001293d5e8b25aedb4b754b3133f944e (patch) | |
tree | 487d5f0b3b065805891a80052677b966edde56de /frontends/php/sysmap.php | |
parent | a28f56fd253c4e79dd9e5ff3e89e780b25da4e5c (diff) | |
download | zabbix-aa75108f001293d5e8b25aedb4b754b3133f944e.tar.gz zabbix-aa75108f001293d5e8b25aedb4b754b3133f944e.tar.xz zabbix-aa75108f001293d5e8b25aedb4b754b3133f944e.zip |
Sysmaps to work under all versions of GD.
git-svn-id: svn://svn.zabbix.com/trunk@1161 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/sysmap.php')
-rw-r--r-- | frontends/php/sysmap.php | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/frontends/php/sysmap.php b/frontends/php/sysmap.php index a4953945..0cbf0713 100644 --- a/frontends/php/sysmap.php +++ b/frontends/php/sysmap.php @@ -95,7 +95,14 @@ $y_=DBget_field($result,$i,6); $status_=DBget_field($result,$i,7); - $map=$map."\n<area shape=rect coords=$x_,$y_,".($x_+32).",".($y_+32)." href=\"sysmap.php?sysmapid=$sysmapid_&shostid=$shostid_#form\" alt=\"$host_\">"; + if(function_exists("imagecreatetruecolor")) + { + $map=$map."\n<area shape=rect coords=$x_,$y_,".($x_+48).",".($y_+48)." href=\"sysmap.php?sysmapid=$sysmapid_&shostid=$shostid_#form\" alt=\"$host_\">"; + } + else + { + $map=$map."\n<area shape=rect coords=$x_,$y_,".($x_+32).",".($y_+32)." href=\"sysmap.php?sysmapid=$sysmapid_&shostid=$shostid_#form\" alt=\"$host_\">"; + } } $map=$map."\n</map>"; echo $map; @@ -264,19 +271,27 @@ show_table2_h_delimiter(); echo "<select class=\"biginput\" name=\"icon\" size=1>"; $icons=array(); - $icons[0]="Server"; - $icons[1]="Workstation"; - $icons[2]="Printer"; - $icons[3]="Hub"; - $icons[4]="Battery"; - $icons[5]="Display"; - $icons[6]="Network"; - $icons[7]="Palm"; - $icons[8]="Phone"; - $icons[9]="PrinterLaser"; - $icons[10]="Satellite"; - $icons[11]="Terminal"; - for($i=0;$i<12;$i++) + if(function_exists("imagecreatetruecolor")) + { + $icons[0]="Server"; + $icons[1]="Workstation"; + $icons[2]="Printer"; + $icons[3]="Hub"; + $icons[4]="UPS"; + $icons[5]="Network"; + $icons[6]="Phone"; + $icons[7]="Satellite"; + $num=8; + } + else + { + $icons[0]="Server"; + $icons[1]="Workstation"; + $icons[2]="Printer"; + $icons[3]="Hub"; + $num=4; + } + for($i=0;$i<$num;$i++) { if(isset($HTTP_GET_VARS["shostid"]) && ($icon==$icons[$i])) // if(isset($HTTP_GET_VARS["hostid"]) && ($HTTP_GET_VARS["icon"]==$icons[$i])) |