summaryrefslogtreecommitdiffstats
path: root/frontends/php/map.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-01-10 19:53:50 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-01-10 19:53:50 +0000
commitaa75108f001293d5e8b25aedb4b754b3133f944e (patch)
tree487d5f0b3b065805891a80052677b966edde56de /frontends/php/map.php
parenta28f56fd253c4e79dd9e5ff3e89e780b25da4e5c (diff)
downloadzabbix-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/map.php')
-rw-r--r--frontends/php/map.php38
1 files changed, 30 insertions, 8 deletions
diff --git a/frontends/php/map.php b/frontends/php/map.php
index e1b8c507..a999447b 100644
--- a/frontends/php/map.php
+++ b/frontends/php/map.php
@@ -40,7 +40,14 @@
check_authorisation();
- $im = imagecreatetruecolor($width,$height);
+ if(function_exists("imagecreatetruecolor"))
+ {
+ $im = imagecreatetruecolor($width,$height);
+ }
+ else
+ {
+ $im = imagecreate($width,$height);
+ }
$red=ImageColorAllocate($im,255,0,0);
$darkred=ImageColorAllocate($im,150,0,0);
@@ -128,6 +135,14 @@
$x2=DBget_field($result1,0,0);
$y2=DBget_field($result1,0,1);
+ if(function_exists("imagecreatetruecolor"))
+ {
+ $size=48/2;
+ }
+ else
+ {
+ $size=32/2;
+ }
if(isset($triggerid))
{
$trigger=get_trigger_by_triggerid($triggerid);
@@ -135,29 +150,29 @@
{
if($drawtype_on == GRAPH_DRAW_TYPE_BOLDLINE)
{
- ImageLine($im,$x1+16,$y1+16,$x2+16,$y2+16,$colors[$color_on]);
- ImageLine($im,$x1+16,$y1+16+1,$x2+16,$y2+16+1,$colors[$color_on]);
+ ImageLine($im,$x1+$size,$y1+$size,$x2+$size,$y2+$size,$colors[$color_on]);
+ ImageLine($im,$x1+$size,$y1+$size+1,$x2+$size,$y2+$size+1,$colors[$color_on]);
}
else
{
- ImageLine($im,$x1+16,$y1+16,$x2+16,$y2+16,$colors[$color_on]);
+ ImageLine($im,$x1+$size,$y1+$size,$x2+$size,$y2+$size,$colors[$color_on]);
}
}
else
{
if($drawtype_off == GRAPH_DRAW_TYPE_BOLDLINE)
{
- ImageLine($im,$x1+16,$y1+16,$x2+16,$y2+16,$colors[$color_off]);
+ ImageLine($im,$x1+$size,$y1+$size,$x2+$size,$y2+$size,$colors[$color_off]);
}
else
{
- ImageLine($im,$x1+16,$y1+16+1,$x2+16,$y2+16+1,$colors[$color_off]);
+ ImageLine($im,$x1+$size,$y1+$size+1,$x2+$size,$y2+$size+1,$colors[$color_off]);
}
}
}
else
{
- ImageLine($im,$x1+16,$y1+16,$x2+16,$y2+16,$colors["Black"]);
+ ImageLine($im,$x1+$size,$y1+$size,$x2+$size,$y2+$size,$colors["Black"]);
}
}
@@ -179,7 +194,14 @@
if(@gettype($icons["$icon"])!="resource")
{
- $icons[$icon]=ImageCreateFromPNG("images/sysmaps/$icon.png");
+ if(function_exists("imagecreatetruecolor"))
+ {
+ $icons[$icon]=ImageCreateFromPNG("images/sysmaps/$icon.png");
+ }
+ else
+ {
+ $icons[$icon]=ImageCreateFromPNG("images/sysmaps/old/$icon.png");
+ }
}
$img=$icons[$icon];