diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-08-03 08:36:00 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-08-03 08:36:00 +0000 |
| commit | 9e13643b3cfdaf32f457e6325d24bcd8094f0ffb (patch) | |
| tree | 893624ccbab78753acd0be21b6416df31e493841 /frontends/php | |
| parent | ed5710a320bc6a18b0152c31e92c8f6414bb085d (diff) | |
| download | zabbix-9e13643b3cfdaf32f457e6325d24bcd8094f0ffb.tar.gz zabbix-9e13643b3cfdaf32f457e6325d24bcd8094f0ffb.tar.xz zabbix-9e13643b3cfdaf32f457e6325d24bcd8094f0ffb.zip | |
- merged rev. 4506:4507 of branches/1.4.2 (Eugene)
[- added dotted drowing type for links of map
- fixed links drowing type of map ]
git-svn-id: svn://svn.zabbix.com/trunk@4508 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
| -rw-r--r-- | frontends/php/include/defines.inc.php | 5 | ||||
| -rw-r--r-- | frontends/php/include/forms.inc.php | 6 | ||||
| -rw-r--r-- | frontends/php/include/maps.inc.php | 100 |
3 files changed, 105 insertions, 6 deletions
diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php index c1fe99cb..5e882a8d 100644 --- a/frontends/php/include/defines.inc.php +++ b/frontends/php/include/defines.inc.php @@ -191,6 +191,11 @@ define('GRAPH_ITEM_DRAWTYPE_DOT', 3); define('GRAPH_ITEM_DRAWTYPE_DASHED_LINE', 4); + define('MAP_LINK_DRAWTYPE_LINE', 0); + define('MAP_LINK_DRAWTYPE_BOLD_LINE', 2); + define('MAP_LINK_DRAWTYPE_DOT', 3); + define('MAP_LINK_DRAWTYPE_DASHED_LINE', 4); + define('SERVICE_ALGORITHM_NONE',0); define('SERVICE_ALGORITHM_MAX',1); define('SERVICE_ALGORITHM_MIN',2); diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php index a4fad70d..89b29fc3 100644 --- a/frontends/php/include/forms.inc.php +++ b/frontends/php/include/forms.inc.php @@ -2693,7 +2693,7 @@ if($graphtype == GRAPH_TYPE_NORMAL) { $cmbType = new CComboBox("drawtype",$drawtype); - for($i=0; $i < 5; ++$i) + foreach( graph_item_drawtypes() as $i ) { $cmbType->AddItem($i,graph_item_drawtype2str($i)); } @@ -4726,9 +4726,9 @@ include_once 'include/discovery.inc.php'; $cmbType_off = new CComboBox("drawtype_off",$drawtype_off); $cmbType_on = new CComboBox("drawtype_on",$drawtype_on); - for($i=0; $i < 5; ++$i) + foreach(map_link_drawtypes() as $i) { - $value = graph_item_drawtype2str($i); + $value = map_link_drawtype2str($i); $cmbType_off->AddItem($i, $value); $cmbType_on->AddItem($i, $value); } diff --git a/frontends/php/include/maps.inc.php b/frontends/php/include/maps.inc.php index ad1e6666..802a64b3 100644 --- a/frontends/php/include/maps.inc.php +++ b/frontends/php/include/maps.inc.php @@ -23,6 +23,61 @@ require_once "include/hosts.inc.php"; require_once "include/triggers.inc.php"; + /* + * Function: map_link_drawtypes + * + * Description: + * Return available drawing types for links + * + * Author: + * Eugene Grigorjev + * + */ + function map_link_drawtypes() + { + return array( + MAP_LINK_DRAWTYPE_LINE, + MAP_LINK_DRAWTYPE_BOLD_LINE, + (function_exists('imagesetstyle') ? MAP_LINK_DRAWTYPE_DOT : null), + MAP_LINK_DRAWTYPE_DASHED_LINE + ); + } + + /* + * Function: map_link_drawtype2str + * + * Description: + * Represent integer value of links drawing type into the string + * + * Author: + * Eugene Grigorjev + * + */ + function map_link_drawtype2str($drawtype) + { + switch($drawtype) + { + case MAP_LINK_DRAWTYPE_LINE: $drawtype = "Line"; break; + case MAP_LINK_DRAWTYPE_BOLD_LINE: $drawtype = "Bold line"; break; + case MAP_LINK_DRAWTYPE_DOT: $drawtype = "Dot"; break; + case MAP_LINK_DRAWTYPE_DASHED_LINE: $drawtype = "Dashed line"; break; + default: $drawtype = S_UNKNOWN; break; + } + return $drawtype; + } + + /* + * Function: sysmap_accessiable + * + * Description: + * Check permission for map + * + * Return: true on success + + * Author: + * Eugene Grigorjev + * + */ function sysmap_accessiable($sysmapid,$perm) { global $USER_DETAILS; @@ -181,6 +236,16 @@ return DBexecute("delete from sysmaps_links where linkid=$linkid"); } + /* + * Function: check_circle_elements_link + * + * Description: + * Check circeling of maps + * + * Author: + * Eugene Grigorjev + * + */ function check_circle_elements_link($sysmapid,$elementid,$elementtype) { if($elementtype!=SYSMAP_ELEMENT_TYPE_MAP) return FALSE; @@ -326,6 +391,16 @@ return imagecreatefromstring($image['image']); } + /* + * Function: get_info_by_selementid + * + * Description: + * Retrive information for map element + * + * Author: + * Eugene Grigorjev + * + */ function get_info_by_selementid($selementid) { global $colors; @@ -480,6 +555,16 @@ return $out; } + /* + * Function: get_action_map_by_sysmapid + * + * Description: + * Retrive action for map element + * + * Author: + * Eugene Grigorjev + * + */ function get_action_map_by_sysmapid($sysmapid) { $action_map = new CMap("links$sysmapid"); @@ -555,7 +640,7 @@ function MyDrawLine($image,$x1,$y1,$x2,$y2,$color,$drawtype) { - if($drawtype == GRAPH_DRAW_TYPE_BOLDLINE) + if($drawtype == MAP_LINK_DRAWTYPE_BOLD_LINE) { ImageLine($image,$x1,$y1,$x2,$y2,$color); if(($x1-$x2) < ($y1-$y2)) @@ -568,11 +653,14 @@ } ImageLine($image,$x1,$y1,$x2,$y2,$color); } - else if($drawtype == GRAPH_DRAW_TYPE_DASHEDLINE) + else if($drawtype == MAP_LINK_DRAWTYPE_DASHED_LINE) { if(function_exists("imagesetstyle")) { /* Use ImageSetStyle+ImageLIne instead of bugged ImageDashedLine */ - $style = array($color, $color, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT); + $style = array( + $color, $color, $color, $color, + IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT + ); ImageSetStyle($image, $style); ImageLine($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); } @@ -581,6 +669,12 @@ ImageDashedLine($image,$x1,$y1,$x2,$y2,$color); } } + else if ( $drawtype == MAP_LINK_DRAWTYPE_DOT && function_exists("imagesetstyle")) + { + $style = array($color,IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT, IMG_COLOR_TRANSPARENT); + ImageSetStyle($image, $style); + ImageLine($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + } else { ImageLine($image,$x1,$y1,$x2,$y2,$color); |
