public function drawLine($x1, $y1, $x2, $y2, $color, $drawtype) { myDrawLine($this->canvas, $x1, $y1, $x2, $y2, $this->getColor($color), $drawtype); }
function drawMapConnectors(&$im, $map, $mapInfo, $drawAll = false) { $selements = $map['selements']; foreach ($map['links'] as $link) { $selement1 = $selements[$link['selementid1']]; $selement2 = $selements[$link['selementid2']]; list($x1, $y1) = get_icon_center_by_selement($selement1, $mapInfo[$link['selementid1']], $map); list($x2, $y2) = get_icon_center_by_selement($selement2, $mapInfo[$link['selementid2']], $map); if (isset($selement1['elementsubtype']) && $selement1['elementsubtype'] == SYSMAP_ELEMENT_AREA_TYPE_CUSTOM) { if (!$drawAll && $selement2['elementsubtype'] != SYSMAP_ELEMENT_SUBTYPE_HOST_GROUP_ELEMENTS) { continue; } if ($selement1['areatype'] == SYSMAP_ELEMENT_AREA_TYPE_CUSTOM) { $w = $selement1['width']; $h = $selement1['height']; } else { $w = $map['width']; $h = $map['height']; } list($x1, $y1) = calculateMapAreaLinkCoord($x1, $y1, $w, $h, $x2, $y2); } if (isset($selement2['elementsubtype']) && $selement2['elementsubtype'] == SYSMAP_ELEMENT_AREA_TYPE_CUSTOM) { if (!$drawAll && $selement1['elementsubtype'] != SYSMAP_ELEMENT_SUBTYPE_HOST_GROUP_ELEMENTS) { continue; } if ($selement2['areatype'] == SYSMAP_ELEMENT_AREA_TYPE_CUSTOM) { $w = $selement2['width']; $h = $selement2['height']; } else { $w = $map['width']; $h = $map['height']; } list($x2, $y2) = calculateMapAreaLinkCoord($x2, $y2, $w, $h, $x1, $y1); } $drawtype = $link['drawtype']; $color = convertColor($im, $link['color']); $linktriggers = $link['linktriggers']; order_result($linktriggers, 'triggerid'); if (!empty($linktriggers)) { $max_severity = 0; $triggers = array(); foreach ($linktriggers as $link_trigger) { if ($link_trigger['triggerid'] == 0) { continue; } $id = $link_trigger['linktriggerid']; $triggers[$id] = zbx_array_merge($link_trigger, get_trigger_by_triggerid($link_trigger['triggerid'])); if ($triggers[$id]['status'] == TRIGGER_STATUS_ENABLED && $triggers[$id]['value'] == TRIGGER_VALUE_TRUE) { if ($triggers[$id]['priority'] >= $max_severity) { $drawtype = $triggers[$id]['drawtype']; $color = convertColor($im, $triggers[$id]['color']); $max_severity = $triggers[$id]['priority']; } } } } myDrawLine($im, $x1, $y1, $x2, $y2, $color, $drawtype); } }