diff -urN share-2.0.0/api/classes/CMap.php share/api/classes/CMap.php
--- share-2.0.0/api/classes/CMap.php	2012-05-21 10:07:35.000000000 -0400
+++ share/api/classes/CMap.php	2012-07-12 16:54:09.000000000 -0400
@@ -214,6 +214,7 @@
 					if (!isset($result[$sysmap['sysmapid']]['urls'])) {
 						$result[$sysmap['sysmapid']]['urls'] = array();
 					}
+					$sysmap = $this->splitLabelLocationAndFontSize($sysmap);
 					$result[$sysmap['sysmapid']] += $sysmap;
 				}
 			}
@@ -426,6 +427,7 @@
 				if (!isset($result[$selement['sysmapid']]['selements'])) {
 					$result[$selement['sysmapid']]['selements'] = array();
 				}
+				$selement = $this->splitLabelLocationAndRotation($selement);
 				if (!is_null($options['preservekeys'])) {
 					$result[$selement['sysmapid']]['selements'][$selement['selementid']] = $selement;
 				}
@@ -475,7 +477,7 @@
 				if (!isset($result[$link['sysmapid']]['links'])) {
 					$result[$link['sysmapid']]['links'] = array();
 				}
-
+				$link = $this->splitDrawtypeAndAnchors($link);
 				if (!is_null($options['preservekeys'])) {
 					$result[$link['sysmapid']]['links'][$link['linkid']] = $link;
 				}
@@ -712,6 +714,7 @@
  * @param string $maps['highlight']
  * @param array $maps['label_type']
  * @param int $maps['label_location']
+ * @param int $maps['font_size'] size of the font used for the labels
  * @param int $maps['grid_size'] size of a one grid cell. 100 refers to 100x100 and so on.
  * @param int $maps['grid_show'] does grid need to be shown. Constants: SYSMAP_GRID_SHOW_ON / SYSMAP_GRID_SHOW_OFF
  * @param int $maps['grid_align'] does elements need to be aligned to the grid. Constants: SYSMAP_GRID_ALIGN_ON / SYSMAP_GRID_ALIGN_OFF
@@ -722,6 +725,8 @@
 
 		$this->checkInput($maps, __FUNCTION__);
 
+		$maps=$this->mergeLabelLocationAndFontSize($maps);
+		
 		$sysmapids = DB::insert('sysmaps', $maps);
 
 		$newUrls = array();
@@ -783,6 +788,124 @@
 		return array('sysmapids' => $sysmapids);
 	}
 
+	/**
+	* Split the database label_location to return the proper label_location and font size.
+	* In order to avoid modifying the database, we use the last digit to keep the label_location and
+	* store the font_size in decimals.
+	*
+	* @param array $selement an array containing the element data
+	* @return the updated array containing the element data
+	*/
+	private function splitLabelLocationAndFontSize($map) {
+		if (key_exists('label_location',$map) && !is_null($map['label_location'])) {
+			$map['font_size'] = intval($map['label_location']/10);
+			$map['label_location'] = $map['label_location']%10;
+		}
+		// Not defined or 0 size: we use default value.
+		if (!key_exists('font_size',$map) || is_null($map['font_size']) || $map['font_size']==0)
+			$map['font_size'] = MAP_LABEL_SIZE_DEFAULT;
+		return $map;
+	}
+	
+	/**
+	 * Merge the label_location and font_size fields to be stored in the database.
+	 * In order to avoid modifying the database, we use the last digit to keep the label_location and
+	 * store the font_size in decimals.
+	 *
+	 * @param array $selements multidimensional array with elements data
+	 * @return the updated multidimensional array with elements data
+	 */
+	private function mergeLabelLocationAndFontSize($maps) {
+		foreach (array_keys($maps) as $key) {
+			# we don't store the font_size if we use the default one.
+			if (key_exists('font_size', $maps[$key]) && !is_null($maps[$key]['font_size']) && $maps[$key]['font_size']!=MAP_LABEL_SIZE_DEFAULT) {
+				# We use decimals to store font size. We only need the last digit for the location itself.
+				$maps[$key]['label_location'] = $maps[$key]['label_location']+10*$maps[$key]['font_size'];
+				unset($maps[$key]['font_size']);
+			}
+		}
+		return $maps;
+	}
+	
+	/**
+	* Split the database draw type to return the proper drawtype and anchors position.
+	* In order to avoid modifying the database, we use the last digit to keep the drawtype and
+	* store the anchor1 with the hundreds and anchor2 in decimals.
+	*
+	* @param array $selement an array containing the element data
+	* @return the updated array containing the element data
+	*/
+	private function splitDrawtypeAndAnchors($link) {
+		if (!is_null($link['drawtype'])) {
+			# Anchor1 is stored in the hundreds
+			$link['anchor1'] = intval($link['drawtype']/100);
+			# Anchor2 is stored in the decimals
+			$link['anchor2'] = intval($link['drawtype']/10)%10;
+			# drawtype is stored in the units
+			$link['drawtype'] = $link['drawtype']%10;
+		}
+		return $link;
+	}
+	
+	/**
+	 * Merge the drawtype and anchor fields to be stored in the database.
+	 * In order to avoid modifying the database, we use the last digit to keep the drawtype and
+	 * store the anchor1 with the hundreds and anchor2 in decimals.
+	 *
+	 * @param array $selements multidimensional array with elements data
+	 * @return the updated multidimensional array with elements data
+	 */
+	private function mergeDrawtypeAndAnchors($links) {
+		foreach (array_keys($links) as $key) {
+			if (key_exists('anchor1', $links[$key]) && !is_null($links[$key]['anchor1'])) {
+				$links[$key]['drawtype']+=$links[$key]['anchor1']*100;
+				unset($links[$key]['anchor1']);
+			}
+			if (key_exists('anchor2', $links[$key]) && !is_null($links[$key]['anchor2'])) {
+				$links[$key]['drawtype']+=$links[$key]['anchor2']*10;
+				unset($links[$key]['anchor2']);
+			}
+		}
+		return $links;
+	}
+	
+	/**
+	* Split the database label location to return the proper label_location and label rotation.
+	* In order to avoid modifying the database, we use the last digit to keep the label location and
+	* multiple the rotation angle by 10 to store it.
+	*
+	* @param array $selement an array containing the element data
+	* @return the updated array containing the element data
+	*/
+	private function splitLabelLocationAndRotation($selement) {
+		if (!is_null($selement['label_location'])) {
+			# We use decimals to store rotation. We only need the last digit for the location itself.
+			$selement['label_rotation'] = intval($selement['label_location']/10);
+			$selement['label_location'] = abs($selement['label_location']%10);
+		}
+		return $selement;
+	}
+	
+	/**
+	 * Merge the label location and label rotation field to be stored in the database.
+	 * In order to avoid modifying the database, we use the last digit to keep the label location and
+	 * multiple the rotation angle by 10 to store it.
+	 * 
+	 * @param array $selements multidimensional array with elements data
+ 	 * @return the updated multidimensional array with elements data
+	 */
+	private function mergeLabelLocationAndRotation($selements) {
+		foreach (array_keys($selements) as $key) {
+			if (key_exists('label_rotation', $selements[$key]) && !is_null($selements[$key]['label_rotation'])) {
+				# We use decimals to store rotation. We only need the last digit for the location itself.
+				$selements[$key]['label_location'] = $selements[$key]['label_location']+
+																							10*$selements[$key]['label_rotation'];
+			unset($selements[$key]['label_rotation']);
+			}
+		}
+		return $selements;
+	}
+	
 /**
  * Update Map
  *
@@ -794,6 +917,7 @@
  * @param string $maps['backgroundid']
  * @param array $maps['label_type']
  * @param int $maps['label_location']
+ * @param int $maps['font_size']
  * @param int $maps['grid_size'] size of a one grid cell. 100 refers to 100x100 and so on.
  * @param int $maps['grid_show'] does grid need to be shown. Constants: SYSMAP_GRID_SHOW_ON / SYSMAP_GRID_SHOW_OFF
  * @param int $maps['grid_align'] does elements need to be aligned to the grid. Constants: SYSMAP_GRID_ALIGN_ON / SYSMAP_GRID_ALIGN_OFF
@@ -810,6 +934,8 @@
 		$selementsToDelete = $selementsToUpdate = $selementsToAdd = array();
 		$linksToDelete = $linksToUpdate = $linksToAdd = array();
 
+		$maps=$this->mergeLabelLocationAndFontSize($maps);
+		
 		foreach ($maps as $map) {
 			$updateMaps[] = array(
 				'values' => $map,
@@ -875,11 +1001,15 @@
 
 		// Selements
 		$newSelementids = array('selementids' => array());
-		if (!empty($selementsToAdd))
+		if (!empty($selementsToAdd)) {
+			$selementsToAdd = $this->mergeLabelLocationAndRotation($selementsToAdd);
 			$newSelementids = $this->createSelements($selementsToAdd);
+		}
 
-		if (!empty($selementsToUpdate))
+		if (!empty($selementsToUpdate)) {
+			$selementsToUpdate = $this->mergeLabelLocationAndRotation($selementsToUpdate);
 			$this->updateSelements($selementsToUpdate);
+		}
 
 		if (!empty($selementsToDelete))
 			$this->deleteSelements($selementsToDelete);
@@ -910,10 +1040,12 @@
 
 		$newLinkids = $updLinkids = array('linkids' => array());
 		if (!empty($linksToAdd)) {
+			$linksToAdd=$this->mergeDrawtypeAndAnchors($linksToAdd);
 			$newLinkids = $this->createLinks($linksToAdd);
 		}
 
 		if (!empty($linksToUpdate)) {
+			$linksToUpdate=$this->mergeDrawtypeAndAnchors($linksToUpdate);
 			$updLinkids = $this->updateLinks($linksToUpdate);
 		}
 
diff -urN share-2.0.0/include/blocks.inc.php share/include/blocks.inc.php
--- share-2.0.0/include/blocks.inc.php	2012-05-21 10:07:27.000000000 -0400
+++ share/include/blocks.inc.php	2012-06-28 10:18:50.000000000 -0400
@@ -686,9 +686,9 @@
 	$title->setAttribute('title', _('Only items assigned to enabled hosts are counted'));
 	$table->addRow(array($title, $status['items_count'],
 		array(
-			new CSpan($status['items_count_monitored'], 'off'), ' / ',
-			new CSpan($status['items_count_disabled'], 'on'), ' / ',
-			new CSpan($status['items_count_not_supported'], 'unknown')
+			new CLink($status['items_count_monitored'],'items.php?filter_status=0&filter_set=1&start=0','off'),' / ',
+			new CLink($status['items_count_disabled'],'items.php?filter_status=1&filter_set=1&start=0','unknown'),' / ',
+			new CLink($status['items_count_not_supported'],'items.php?filter_status=3&filter_set=1&start=0','on')
 		)
 	));
 	$title = new CSpan(_('Number of triggers (enabled/disabled)[problem/unknown/ok]'));
diff -urN share-2.0.0/include/defines.inc.php share/include/defines.inc.php
--- share-2.0.0/include/defines.inc.php	2012-05-21 10:07:27.000000000 -0400
+++ share/include/defines.inc.php	2012-07-12 15:25:23.000000000 -0400
@@ -264,12 +264,23 @@
 define('MAP_LABEL_TYPE_STATUS',		3);
 define('MAP_LABEL_TYPE_NOTHING',	4);
 define('MAP_LABEL_TYPE_CUSTOM',		5);
+define('MAP_LABEL_TYPE_COLORED',		6);
 
 define('MAP_LABEL_LOC_BOTTOM',		0);
 define('MAP_LABEL_LOC_LEFT',		1);
 define('MAP_LABEL_LOC_RIGHT',		2);
 define('MAP_LABEL_LOC_TOP',			3);
 
+define('MAP_LABEL_ALIGN_CENTER',0);
+define('MAP_LABEL_ALIGN_BOTTOM',1);
+define('MAP_LABEL_ALIGN_LEFT',2);
+define('MAP_LABEL_ALIGN_RIGHT',3);
+define('MAP_LABEL_ALIGN_TOP',4);
+
+define('MAP_LABEL_SIZE_MIN',5);
+define('MAP_LABEL_SIZE_DEFAULT',8);
+define('MAP_LABEL_SIZE_MAX',14);
+
 define('SYSMAP_ELEMENT_TYPE_HOST',		0);
 define('SYSMAP_ELEMENT_TYPE_MAP',		1);
 define('SYSMAP_ELEMENT_TYPE_TRIGGER',	2);
diff -urN share-2.0.0/include/maps.inc.php share/include/maps.inc.php
--- share-2.0.0/include/maps.inc.php	2012-05-21 10:07:27.000000000 -0400
+++ share/include/maps.inc.php	2012-07-12 16:34:07.000000000 -0400
@@ -58,6 +58,7 @@
 function sysmapElementLabel($label = null) {
 	$labels = array(
 		MAP_LABEL_TYPE_LABEL => _('Label'),
+		MAP_LABEL_TYPE_COLORED => _('Colored label'),
 		MAP_LABEL_TYPE_IP => _('IP address'),
 		MAP_LABEL_TYPE_NAME => _('Element name'),
 		MAP_LABEL_TYPE_STATUS => _('Status only'),
@@ -1291,49 +1292,188 @@
 	}
 	return $elements;
 }
+/*
+ * Calculate the distance between two points
+*
+* Params:       $point1         The first point to evaluate (Array containing component for X,Y and Z)
+*               $point2         The second point to evaluate (Array containing component for X,Y and Z)
+*
+* Returns the distance between 2 points in space as a float
+*/
+function distancePointPoint($point1, $point2) {
+	$tmp=array('x'=>$point2['x']-$point1['x'],'y'=>$point2['y']-$point1['y'],'z'=>$point2['z']-$point1['z']);
+	return sqrt($tmp['x']*$tmp['x']+$tmp['y']*$tmp['y']+$tmp['z']*$tmp['z']);
+}
+/*
+ * Calculate the distance between a point and a line
+*
+* Params:       $point          The point to valuate (Array containing component for X,Y and Z)
+*               $start          The point where the segment starts (Array containing component for X,Y and Z)
+*               $end            The point where the segment ends (Array containing component for X,Y and Z)
+*
+* Returns the closest point on the line from the provided point. The distance between both points is also returned.
+*/
+function  distancePointLine($point, $start, $end) {
+	$res=array('x'=>-1,'y'=>-1,'z'=>-1,'dst'=>0);
+	$distance= distancePointPoint($end,$start);
+	// The next line allow to use this fonction to calculate the distance between two points ($start == $end)
+	if ($distance==0) $distance=1;
+	$u = (  (($point['x']-$start['x'])*($end['x']-$start['x'])) +
+					(($point['y']-$start['y'])*($end['y']-$start['y'])) +
+					(($point['z']-$start['z'])*($end['z']-$start['z']))) /
+					($distance*$distance);
+	if ($u<0) {
+		$res['x'] = $start['x'];
+		$res['y'] = $start['y'];
+		$res['z'] = $start['z'];
+	} else if ($u>1) {
+		$res['x'] = $end['x'];
+		$res['y'] = $end['y'];
+		$res['z'] = $end['z'];
+	} else {
+		$res['x'] = $start['x'] + $u * ($end['x'] - $start['x']);
+		$res['y'] = $start['y'] + $u * ($end['y'] - $start['y']);
+		$res['z'] = $start['z'] + $u * ($end['z'] - $start['z']);
+	}
+	$res['dst'] = distancePointPoint($point,$res);
+	return $res;
+}
+
+/*
+ * Determine if a point is closer than another point, inclusive or not.
+*
+* Params:       $point1         The first point to evaluate (Array containing component for X,Y,Z and distance)
+*               $point2         The second point to evaluate (Array containing component for X,Y,Z and distance)
+*               $inclusive      True if we want verification to be inclusive (if $p1.dst<=$p2.dst instead of $p1.dst<$p2.dst)
+*
+* Returns true if the distance contained in the $point1 array is lower (lower and equals if $inclusive) than the distance component of $point2
+*/
+function isCloser($point1,$point2,$inclusive) {
+	$res=false;
+	if ($inclusive and $point1['dst'] <= $point2['dst'])
+	$res=true;
+	else if ($point1['dst'] < $point2['dst'])
+	$res=true;
+	return $res;
+}
+function getIconLineByElement($element, $anchor, $map, $info=null) {
+	$res = array();
+	$x = $element['x'];
+	$y = $element['y'];
+	$dx = 0;
+	$dy = 0;
+	$image = get_png_by_selement($element, $info);
+	if($image){
+		$dx = imagesx($image);
+		$dy = imagesy($image);
+	}
+	switch($anchor) {
+		// Steady Y axis, we move along the X axis
+		case MAP_LABEL_ALIGN_BOTTOM:
+			$res['start']   = array('x'=>$x,        'y'=>$y+$dy,    'z'=>0);
+			$res['center']  = array('x'=>$x+$dx/2,  'y'=>$y+$dy,    'z'=>0);
+			$res['end']     = array('x'=>$x+$dx,    'y'=>$y+$dy,    'z'=>0);
+			break;
+		case MAP_LABEL_ALIGN_TOP:
+			$res['start']   = array('x'=>$x,        'y'=>$y,        'z'=>0);
+			$res['center']  = array('x'=>$x+$dx/2,  'y'=>$y,        'z'=>0);
+			$res['end']     = array('x'=>$x+$dx,    'y'=>$y,        'z'=>0);
+			break;
+			// Steady X axis, we move along the Y axis
+		case MAP_LABEL_ALIGN_LEFT:
+			$res['start']   = array('x'=>$x,        'y'=>$y,        'z'=>0);
+			$res['center']  = array('x'=>$x,        'y'=>$y+$dy/2,  'z'=>0);
+			$res['end']     = array('x'=>$x,        'y'=>$y+$dy,    'z'=>0);
+			break;
+		case MAP_LABEL_ALIGN_RIGHT:
+			$res['start']   = array('x'=>$x+$dx,    'y'=>$y,        'z'=>0);
+			$res['center']  = array('x'=>$x+$dx,    'y'=>$y+$dy/2,  'z'=>0);
+			$res['end']     = array('x'=>$x+$dx,    'y'=>$y+$dy,    'z'=>0);
+			break;
+			// Middle point (default behavior)
+		case MAP_LABEL_ALIGN_CENTER:
+		default:
+			$res=pointToCoord(get_icon_center_by_selement($element, $info, $map),0);
+	}
+	return $res;
+}
 
-function drawMapConnectors(&$im, $map, $map_info, $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, $map_info[$link['selementid1']], $map);
-		list($x2, $y2) = get_icon_center_by_selement($selement2, $map_info[$link['selementid2']], $map);
+function pointToCoord($point) {
+	$res = array();
+	$res['start'] = array('x'=>$point[0],'y'=>$point[1],'z'=>0);
+	$res['center'] = $res['start'];
+	$res['end'] = $res['start'];
+	return $res;
+}
 
-		if (isset($selement1['elementsubtype']) && $selement1['elementsubtype'] == SYSMAP_ELEMENT_AREA_TYPE_CUSTOM) {
-			if (!$drawAll && ($selement2['elementsubtype'] != SYSMAP_ELEMENT_SUBTYPE_HOST_GROUP_ELEMENTS)) {
-				continue;
-			}
+function getConnectorCoordinates($map, $map_info, $link, $drawAll = false) {
+	$selements = $map['selements'];
+	$selement1 = $selements[$link['selementid1']];
+	$selement2 = $selements[$link['selementid2']];
 
-			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);
+	$line1 = getIconLineByElement($selement1, $link['anchor1'], $map, $map_info[$link['selementid1']]);
+	$line2 = getIconLineByElement($selement2, $link['anchor2'], $map, $map_info[$link['selementid2']]);
+	
+	if (isset($selement1['elementsubtype']) && $selement1['elementsubtype'] == SYSMAP_ELEMENT_AREA_TYPE_CUSTOM) {
+		if (!$drawAll && ($selement2['elementsubtype'] != SYSMAP_ELEMENT_SUBTYPE_HOST_GROUP_ELEMENTS)) {
+			continue;
 		}
-
-		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);
+	
+		if ($selement1['areatype'] == SYSMAP_ELEMENT_AREA_TYPE_CUSTOM) {
+			$w = $selement1['width'];
+			$h = $selement1['height'];
 		}
+		else {
+			$w = $map['width'];
+			$h = $map['height'];
+		}
+		$line1 = pointToLine(caculateMapAreaLinkCoord($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'];
+		}
+		$line2 = pointToLine(calculateMapAreaLinkCoord($x2, $y2, $w,$h, $x1, $y1));
+	} 
+	
+	// Okay, this is where the fun begins. The next array (tests) will hold all distance that must be mesured. Since we are working
+	// with finite lines, we know for sure that the closest point will be an extremity of one of the two lines. Therefore,
+	// all we need to do is to test the extremities of each line (start-end) with the other line.
+	// Yet, for two parallel lines, I prefer to view the line starting from the center than the extremities.
+	// By adding the incl=true to those tests, that will give them predominance, line of element 2 being predominant
+	// of element 1.
+	$res=array('x'=>-1,'y'=>-1,'z'=>-1,'dst'=>99999999999);
+	$tests=array(   array('point'=>$line1['start'], 'incl'=>false,'line'=>$line2),
+	array('point'=>$line2['start'], 'incl'=>false,'line'=>$line1),
+	array('point'=>$line1['center'],'incl'=>true, 'line'=>$line2),
+	array('point'=>$line2['center'],'incl'=>true, 'line'=>$line1),
+	array('point'=>$line1['end'],   'incl'=>false,'line'=>$line2),
+	array('point'=>$line2['end'],   'incl'=>false,'line'=>$line1)
+	);
+	foreach ($tests as $test) {
+		$tmp=distancePointLine($test['point'],$test['line']['start'],$test['line']['end']);
+		if (isCloser($tmp,$res,$test['incl'])) {
+			$p1=$test['point'];
+			$res=$tmp;
+		}
+	}
+	return array($p1['x'],$p1['y'],$res['x'],$res['y']);
+}
 
+function drawMapConnectors(&$im, $map, $map_info, $drawAll = false) {
+	foreach ($map['links'] as $link) {
+		list($x1,$y1,$x2,$y2) = getConnectorCoordinates($map, $map_info, $link,$drawAll);
+		
 		$drawtype = $link['drawtype'];
 		$color = convertColor($im, $link['color']);
 
@@ -1591,44 +1731,15 @@
 
 function drawMapLinkLabels(&$im, $map, $map_info, $resolveMacros = true) {
 	global $colors;
-
+	$font_size = (key_exists('font_size',$map) && !is_null($map['font_size']))?$map['font_size']:MAP_LABEL_SIZE_DEFAULT;
 	$links = $map['links'];
-	$selements = $map['selements'];
 
 	foreach ($links as $link) {
 		if (empty($link['label'])) {
 			continue;
 		}
 
-		$selement1 = $selements[$link['selementid1']];
-		list($x1, $y1) = get_icon_center_by_selement($selement1, $map_info[$link['selementid1']], $map);
-
-		$selement2 = $selements[$link['selementid2']];
-		list($x2, $y2) = get_icon_center_by_selement($selement2, $map_info[$link['selementid2']], $map);
-
-		if (isset($selement1['elementsubtype']) && $selement1['elementsubtype'] == SYSMAP_ELEMENT_AREA_TYPE_CUSTOM) {
-			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 ($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);
-		}
+		list($x1,$y1,$x2,$y2) = getConnectorCoordinates($map, $map_info, $link);
 
 		$drawtype = $link['drawtype'];
 		$color = convertColor($im, $link['color']);
@@ -1670,7 +1781,7 @@
 		}
 
 		foreach ($strings as $str) {
-			$dims = imageTextSize(8, 0, $str);
+			$dims = imageTextSize($font_size, 0, $str);
 
 			$box_width = ($box_width > $dims['width']) ? $box_width : $dims['width'];
 			$box_height += $dims['height'] + 2;
@@ -1698,12 +1809,12 @@
 
 		$increasey = 4;
 		foreach ($strings as $str) {
-			$dims = imageTextSize(8, 0, $str);
+			$dims = imageTextSize($font_size, 0, $str);
 
 			$labelx = ($x1 + $x2) / 2 - ($dims['width'] / 2);
 			$labely = $boxY_top + $increasey;
 
-			imagetext($im, 8, 0, $labelx, $labely + $dims['height'], $colors['Black'], $str);
+			imagetext($im, $font_size, 0, $labelx, $labely + $dims['height'], $colors['Black'], $str);
 
 			$increasey += $dims['height'] + 2;
 		}
@@ -1717,6 +1828,8 @@
 		return;
 	}
 
+	$font_size = (key_exists('font_size',$map) && !is_null($map['font_size']))?$map['font_size']:MAP_LABEL_SIZE_DEFAULT;
+	
 	$selements = $map['selements'];
 	$all_strings = '';
 	$label_lines = array();
@@ -1803,7 +1916,7 @@
 		}
 	}
 
-	$allLabelsSize = imageTextSize(8, 0, str_replace("\r", '', str_replace("\n", '', $all_strings)));
+	$allLabelsSize = imageTextSize($font_size, 0, str_replace("\r", '', str_replace("\n", '', $all_strings)));
 	$labelFontHeight = $allLabelsSize['height'];
 	$labelFontBaseline = $allLabelsSize['baseline'];
 
@@ -1859,6 +1972,7 @@
 
 		$label_location = (is_null($selement['label_location']) || ($selement['label_location'] < 0))
 				? $map['label_location'] : $selement['label_location'];
+		$label_rotation = (!key_exists('label_rotation',$selement) || is_null($selement['label_rotation'])) ? 0 : $selement['label_rotation'];
 
 		$label = array();
 		if ($selement['label_type'] == MAP_LABEL_TYPE_IP && $selement['elementtype'] == SYSMAP_ELEMENT_TYPE_HOST) {
@@ -1874,6 +1988,14 @@
 			$label[] = array('msg' => $el_info['name']);
 			$label = array_merge($label, $status_lines[$selementid]);
 		}
+		elseif ($selement['label_type'] == MAP_LABEL_TYPE_COLORED) {
+			$label = $label_lines[$selementid];
+			# We assume that the most critical status will be the first due to the logic at line 1792
+			if (count($status_lines[$selementid])>0 && !is_null($status_lines[$selementid][0])) {
+				for ($i=0;$i<count($label);$i++)
+					$label[$i]['color'] =  $status_lines[$selementid][0]['color'];
+			}
+		}
 		else {
 			$label = array_merge($label_lines[$selementid], $status_lines[$selementid]);
 		}
@@ -1883,7 +2005,7 @@
 
 		$w = 0;
 		foreach ($label as $str) {
-			$dims = imageTextSize(8, 0, $str['msg']);
+			$dims = imageTextSize($font_size, 0, $str['msg']);
 			$w = max($w, $dims['width']);
 		}
 		$h = count($label) * $labelFontHeight;
@@ -1910,55 +2032,144 @@
 
 		switch ($label_location) {
 			case MAP_LABEL_LOC_TOP:
-				$y_rec = $y - $icon_hl - $h - 6;
-				$x_rec = $x + $iconX / 2 - $w / 2;
+				switch ($label_rotation) {
+					case 90:
+						$align=MAP_LABEL_ALIGN_LEFT;
+						break;
+					case 270:
+						$align=MAP_LABEL_ALIGN_RIGHT;
+						break;
+					default:
+						$align=MAP_LABEL_ALIGN_CENTER;
+				}
 				break;
 			case MAP_LABEL_LOC_LEFT:
-				$y_rec = $y - $h / 2 + $iconY / 2;
-				$x_rec = $x - $icon_hl - $w;
+				switch ($label_rotation) {
+					case 0:
+						$align=MAP_LABEL_ALIGN_RIGHT;
+						break;
+					case 180:
+						$align=MAP_LABEL_ALIGN_LEFT;
+						break;
+					default:
+						$align=MAP_LABEL_ALIGN_CENTER;
+				}
 				break;
 			case MAP_LABEL_LOC_RIGHT:
-				$y_rec = $y - $h / 2 + $iconY / 2;
-				$x_rec = $x + $iconX + $icon_hl;
+				switch ($label_rotation) {
+					case 0:
+						$align=MAP_LABEL_ALIGN_LEFT;
+						break;
+					case 180:
+						$align=MAP_LABEL_ALIGN_RIGHT;
+						break;
+					default:
+						$align=MAP_LABEL_ALIGN_CENTER;
+				}
 				break;
-			case MAP_LABEL_LOC_BOTTOM:
 			default:
-				$y_rec = $y + $iconY + $icon_hl;
-				$x_rec = $x + $iconX / 2 - $w / 2;
+				switch ($label_rotation) {
+					case 90:
+						$align=MAP_LABEL_ALIGN_RIGHT;
+						break;
+					case 270:
+						$align=MAP_LABEL_ALIGN_LEFT;
+						break;
+					default:
+						$align=MAP_LABEL_ALIGN_CENTER;
+				}				
 		}
 
-		$increasey = 12;
-		foreach ($label as $line) {
-			if (zbx_empty($line['msg'])) {
-				continue;
-			}
-
-			$str = str_replace("\r", '', $line['msg']);
-			$color = isset($line['color']) ? $line['color'] : $colors['Black'];
-
-			$dims = imageTextSize(8, 0, $str);
-
-			if ($label_location == MAP_LABEL_LOC_TOP || $label_location == MAP_LABEL_LOC_BOTTOM) {
-				$x_label = $x + ceil($iconX / 2) - ceil($dims['width'] / 2);
-			}
-			elseif ($label_location == MAP_LABEL_LOC_LEFT) {
-				$x_label = $x_rec + $w - $dims['width'];
-			}
-			else {
-				$x_label = $x_rec;
-			}
+		$imgg=generateTextImage($label,$align,$label_rotation,$font_size,$w,$labelFontHeight,$colors['Black'],$colors['White']);
+		
+		switch ($label_location) {
+			case MAP_LABEL_LOC_TOP:
+				switch ($label_rotation) {
+					case 90:
+					case 270:
+						$y_rec = $y - $icon_hl - 6 - imagesy($imgg);
+						$x_rec = ceil($x + ($iconX - imagesx($imgg)) / 2);
+						break;
+					default:
+						$y_rec = $y - $icon_hl - $h - 6;
+						$x_rec = $x + $iconX / 2 - $w / 2;
+				}
+				break;
+			case MAP_LABEL_LOC_LEFT:
+				switch ($label_rotation) {
+					case 90:
+					case 270:
+						$y_rec = ceil($y + ($iconY - imagesy($imgg))/2);
+						$x_rec = $x - $icon_hl - imagesx($imgg);
+						break;
+					default:
+						$y_rec = $y - $h / 2 + $iconY / 2;
+						$x_rec = $x - $icon_hl - $w;
+				}
+				break;
+			case MAP_LABEL_LOC_RIGHT:
+				case MAP_LABEL_LOC_LEFT:
+					switch ($label_rotation) {
+						case 90:
+						case 270:
+							$y_rec = ceil($y + ($iconY - imagesy($imgg))/2);
+							$x_rec = $x + $icon_hl + $iconX;
+							break;
+						default:
+							$y_rec = $y - $h / 2 + $iconY / 2;
+							$x_rec = $x + $iconX + $icon_hl;
+					}
+					break;
+				
+				break;
+			case MAP_LABEL_LOC_BOTTOM:
+			default:
+				switch ($label_rotation) {
+					case 90:
+					case 270:
+						$y_rec = $y + $iconY + $icon_hl + 6;
+						$x_rec = ceil($x + $iconX / 2 - imagesx($imgg) / 2);
+						break;
+					default:
+						$y_rec = $y + $iconY + $icon_hl;
+						$x_rec = $x + $iconX / 2 - $w / 2;
+				}
+		}
+		
+		imagecopy($im, $imgg, $x_rec, $y_rec, 0, 0, imagesx($imgg), imagesy($imgg));
+		imagedestroy($imgg);
+	}
+}
 
-			imagefilledrectangle(
-				$im,
-				$x_label - 1, $y_rec + $increasey - $labelFontHeight + $labelFontBaseline,
-				$x_label + $dims['width'] + 1, $y_rec + $increasey + $labelFontBaseline,
-				$colors['White']
-			);
-			imagetext($im, 8, 0, $x_label, $y_rec + $increasey, $color, $str);
 
-			$increasey += $labelFontHeight + 1;
+function generateTextImage($label, $align, $angle, $font_size, $maxWidth, $maxHeight, $fgColor, $bgColor) {
+	$imgg = imagecreatetruecolor($maxWidth + 1, count($label) * ($maxHeight+1));
+	$offset=0;
+	imagefill($imgg,0,0,$bgColor);
+	for ($i=0;$i!=count($label);$i++) {
+		$line=$label[$i];
+		$color = isset($line['color']) ? $line['color'] : $fgColor;
+		$str = str_replace("\r", '', $line['msg']);
+		$dims = imageTextSize($font_size, 0, $str);
+		switch ($align) {
+			case MAP_LABEL_ALIGN_RIGHT:
+				$x=$maxWidth-$dims['width'];
+				break;
+			case MAP_LABEL_ALIGN_CENTER:
+				$x=ceil(($maxWidth-$dims['width'])/2);
+				break;
+			default:
+				$x=0;
 		}
+		imageText($imgg, $font_size, 0, $x, $dims['height'] + $offset - $dims['baseline'], $color, $str);
+		$offset+=$maxHeight+1;
+	}
+	imagealphablending($imgg, false);
+	imagesavealpha($imgg, false);
+	if ($angle != 0) {
+		$imgg=imagerotate($imgg, $angle, $bgColor);
 	}
+	return $imgg;
 }
 
 /**
diff -urN share-2.0.0/include/views/configuration.sysmap.edit.php share/include/views/configuration.sysmap.edit.php
--- share-2.0.0/include/views/configuration.sysmap.edit.php	2012-05-21 10:07:27.000000000 -0400
+++ share/include/views/configuration.sysmap.edit.php	2012-07-12 16:56:05.000000000 -0400
@@ -132,6 +132,13 @@
 $cmbLocation->addItems(array(0 => _('Bottom'), 1 => _('Left'), 2 => _('Right'), 3 => _('Top')));
 $sysmapList->addRow(_('Icon label location'), $cmbLocation);
 
+// append Label font size box
+$cmbFontsize = new CComboBox('font_size', $this->data['font_size']);
+for ($i=MAP_LABEL_SIZE_MIN;$i<=MAP_LABEL_SIZE_MAX;$i++) {
+	$cmbFontsize->addItem($i, $i);
+}
+$sysmapList->addRow(_('Label font size'), $cmbFontsize);
+
 // append show unack to sysmap
 $selectShowUnack = new CComboBox('show_unack', $this->data['show_unack']);
 $selectShowUnack->addItems(array(
diff -urN share-2.0.0/include/views/js/configuration.sysmaps.js.php share/include/views/js/configuration.sysmaps.js.php
--- share-2.0.0/include/views/js/configuration.sysmaps.js.php	2012-05-21 10:07:27.000000000 -0400
+++ share/include/views/js/configuration.sysmaps.js.php	2012-07-12 11:01:56.000000000 -0400
@@ -74,7 +74,19 @@
 						<option value="<?php echo MAP_LABEL_LOC_LEFT; ?>"><?php echo _('Left'); ?></option>
 						<option value="<?php echo MAP_LABEL_LOC_RIGHT; ?>"><?php echo _('Right'); ?></option>
 						<option value="<?php echo MAP_LABEL_LOC_TOP; ?>"><?php echo _('Top'); ?></option>
-					</select></td>
+					</select>
+					</td>
+				</tr>
+				<tr>
+					<td><label for="label_rotation"><?php echo _('Label rotation'); ?></label></td>
+					<td><select id="label_rotation" class="input" name="label_rotation">
+							<option value="0">-</option>
+							<option value="90">-90</option>
+							<option value="180">180</option>
+							<option value="270">90</option>
+						</select>
+						</td>
+					</td>
 				</tr>
 				<tr id="hostGroupSelectRow">
 					<td><?php echo _('Host group'); ?></td>
@@ -207,6 +219,7 @@
 
 		<form id="linkForm" name="linkForm" style="display: none;">
 			<input type="hidden" name="selementid1">
+			<input type="hidden" name="anchor1">
 
 			<table class="formtable" style="width: 100%;">
 				<tbody>
@@ -219,6 +232,18 @@
 					<td><select class="input" name="selementid2" id="selementid2"></select></td>
 				</tr>
 				<tr>
+					<td><label for="anchor2"><?php echo _('Anchor point'); ?></label></td>
+					<td>
+						<select class="input" name="anchor2" id="anchor2">
+							<option value="<?php echo MAP_LABEL_ALIGN_CENTER; ?>"><?php echo _('Center'); ?></option>
+							<option value="<?php echo MAP_LABEL_ALIGN_BOTTOM; ?>"><?php echo _('Bottom'); ?></option>
+							<option value="<?php echo MAP_LABEL_ALIGN_TOP; ?>"><?php echo _('Top'); ?></option>
+							<option value="<?php echo MAP_LABEL_ALIGN_LEFT; ?>"><?php echo _('Left'); ?></option>
+							<option value="<?php echo MAP_LABEL_ALIGN_RIGHT; ?>"><?php echo _('Right'); ?></option>
+						</select>
+					</td>
+				</tr>
+				<tr>
 					<td><label for="drawtype"><?php echo _('Type (OK)'); ?></label></td>
 					<td >
 						<select size="1" class="input" name="drawtype" id="drawtype">
@@ -314,6 +339,21 @@
 							<option value="<?php echo MAP_LABEL_LOC_RIGHT; ?>"><?php echo _('Right'); ?></option>
 							<option value="<?php echo MAP_LABEL_LOC_TOP; ?>"><?php echo _('Top'); ?></option>
 						</select>
+						</td>
+					</td>
+				</tr>
+				<tr>
+					<td>
+						<input type="checkbox" name="chkbox_label_Rotation" id="chkboxLabelRotation" class="checkbox" style="display: inline; ">
+						<label for="chkboxLabelRotation"><?php echo _('Label rotation'); ?></label>
+					</td>
+					<td><select id="massLabelRotation" class="input" name="label_rotation">
+							<option value="0">-</option>
+							<option value="90">-90</option>
+							<option value="180">180</option>
+							<option value="270">90</option>
+						</select>
+						</td>
 					</td>
 				</tr>
 				<tr>
diff -urN share-2.0.0/js/class.cmap.js share/js/class.cmap.js
--- share-2.0.0/js/class.cmap.js	2012-05-21 10:07:27.000000000 -0400
+++ share/js/class.cmap.js	2012-07-12 15:00:27.000000000 -0400
@@ -643,6 +643,8 @@
 					selementid2:	null,
 					linktriggers:	{},
 					drawtype:		0,
+					anchor1:		0,
+					anchor2:		0,
 					color:			'00CC00'
 				};
 
@@ -728,7 +730,8 @@
 					elementid: 0,
 					iconid_off: this.sysmap.iconList[0].imageid, // first imageid
 					label: locale['S_NEW_ELEMENT'],
-					label_location: this.sysmap.data.label_location, // set default map label location
+					label_location: this.sysmap.data.label_location%10, // set default map label location
+					label_rotation: Math.floor(this.sysmap.data.label_location/10), // set default map label rotation
 					x: 0,
 					y: 0,
 					urls: {},
@@ -792,7 +795,7 @@
 				var fieldName,
 					dataFelds = [
 						'elementtype', 'elementid', 'iconid_off', 'iconid_on', 'iconid_maintenance',
-						'iconid_disabled', 'label', 'label_location', 'x', 'y', 'elementsubtype',  'areatype', 'width',
+						'iconid_disabled', 'label', 'label_location', 'label_rotation', 'x', 'y', 'elementsubtype',  'areatype', 'width',
 						'height', 'viewtype', 'urls', 'elementName', 'use_iconmap'
 					],
 					fieldsUnsettable = ['iconid_off', 'iconid_on', 'iconid_maintenance', 'iconid_disabled'],
@@ -1634,8 +1637,13 @@
 					tmp = link.selementid1;
 					link.selementid1 = selement1.id;
 					link.selementid2 = tmp;
-				}
 
+					tmp = link.anchor1;
+					link.anchor1 = link.anchor2;
+					link.anchor2 = tmp;
+
+				}
+				
 				// populate list of elements to connect with
 				jQuery('#selementid2').empty();
 
diff -urN share-2.0.0/styles/themes/classic/jquery-ui.css share/styles/themes/classic/jquery-ui.css
--- share-2.0.0/styles/themes/classic/jquery-ui.css	2012-05-21 10:07:26.000000000 -0400
+++ share/styles/themes/classic/jquery-ui.css	2012-06-28 13:24:36.000000000 -0400
@@ -39,6 +39,22 @@
 .classic .ui-widget-header { border: 1px solid #4E6EA7; background: #4E6EA7 url(images/widget_header.gif) repeat-x top left; color: #ffffff; font-weight: bold; }
 .classic .ui-widget-header a { color: #ffffff; }
 
+/* This is required, otherwise, the css above overwrite the on/off/unknown defaults */
+.classic .ui-widget-content a.off:link      { color:#00AA00; }
+.classic .ui-widget-content a.off:visited   { color:#00AA00; }
+.classic .ui-widget-content a.off:hover     { color:#44CC44; }
+.classic .ui-widget-content a.off:active    { color:#00AA00; }
+
+.classic .ui-widget-content a.on:link       { color:#DC0000; }
+.classic .ui-widget-content a.on:visited    { color:#DC0000; }
+.classic .ui-widget-content a.on:hover      { color:#CC7777; }
+.classic .ui-widget-content a.on:active     { color:#DC0000; }
+
+.classic .ui-widget-content a.unknown:link       { color:#999999; }
+.classic .ui-widget-content a.unknown:visited    { color:#999999; }
+.classic .ui-widget-content a.unknown:hover      { color:#999; }
+.classic .ui-widget-content a.unknown:active     { color:#999999; }
+
 /* Interaction states
 ----------------------------------*/
 .classic .ui-state-default, .classic .ui-widget-content .ui-state-default, .classic .ui-widget-header .ui-state-default { border: 1px solid #9db2cd; background: #f5f8fa url(images/bg_h-hard_85.png) 50% 50% repeat-x; font-weight: bold; color: #5481ab; }
diff -urN share-2.0.0/styles/themes/darkblue/jquery-ui.css share/styles/themes/darkblue/jquery-ui.css
--- share-2.0.0/styles/themes/darkblue/jquery-ui.css	2012-05-21 10:07:26.000000000 -0400
+++ share/styles/themes/darkblue/jquery-ui.css	2012-06-28 10:42:20.000000000 -0400
@@ -65,6 +65,22 @@
 .darkblue .ui-widget-header { border: 1px solid #77b7da; background: #3c759b url(images/bg_i-soft_25.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
 .darkblue .ui-widget-header a { color: #ffffff; }
 
+/* This is required, otherwise, the css above overwrite the on/off/unknown defaults */
+.darkblue .ui-widget-content a.off:link      { color:#00AA00; }
+.darkblue .ui-widget-content a.off:visited   { color:#00AA00; }
+.darkblue .ui-widget-content a.off:hover     { color:#44CC44; }
+.darkblue .ui-widget-content a.off:active    { color:#00AA00; }
+
+.darkblue .ui-widget-content a.on:link       { color:#DC0000; }
+.darkblue .ui-widget-content a.on:visited    { color:#DC0000; }
+.darkblue .ui-widget-content a.on:hover      { color:#CC7777; }
+.darkblue .ui-widget-content a.on:active     { color:#DC0000; }
+
+.darkblue .ui-widget-content a.unknown:link       { color:#999999; }
+.darkblue .ui-widget-content a.unknown:visited    { color:#999999; }
+.darkblue .ui-widget-content a.unknown:hover      { color:#999; }
+.darkblue .ui-widget-content a.unknown:active     { color:#999999; }
+
 /* Interaction states
 ----------------------------------*/
 .darkblue .ui-state-default, .darkblue .ui-widget-content .ui-state-default, .darkblue .ui-widget-header .ui-state-default { border: 1px solid #77b7da; background: #000e19 url(images/bg_h-hard_25.png) 50% 50% repeat-x; font-weight: bold; color: #77b7da; }
diff -urN share-2.0.0/styles/themes/darkorange/jquery-ui.css share/styles/themes/darkorange/jquery-ui.css
--- share-2.0.0/styles/themes/darkorange/jquery-ui.css	2012-05-21 10:07:26.000000000 -0400
+++ share/styles/themes/darkorange/jquery-ui.css	2012-06-28 13:25:08.000000000 -0400
@@ -63,6 +63,22 @@
 .darkorange .ui-widget-header { border: 1px solid #444; background: #4f4f4f url(images/bg_h-hard_30.png) 50% 50% repeat-x; color: #dfdfdf; font-weight: bold; }
 .darkorange .ui-widget-header a { color: #dfdfdf; }
 
+/* This is required, otherwise, the css above overwrite the on/off/unknown defaults */
+.darkorange .ui-widget-content a.off:link      { color:#00AA00; }
+.darkorange .ui-widget-content a.off:visited   { color:#00AA00; }
+.darkorange .ui-widget-content a.off:hover     { color:#44CC44; }
+.darkorange .ui-widget-content a.off:active    { color:#00AA00; }
+
+.darkorange .ui-widget-content a.on:link       { color:#DC0000; }
+.darkorange .ui-widget-content a.on:visited    { color:#DC0000; }
+.darkorange .ui-widget-content a.on:hover      { color:#CC7777; }
+.darkorange .ui-widget-content a.on:active     { color:#DC0000; }
+
+.darkorange .ui-widget-content a.unknown:link       { color:#999999; }
+.darkorange .ui-widget-content a.unknown:visited    { color:#999999; }
+.darkorange .ui-widget-content a.unknown:hover      { color:#999; }
+.darkorange .ui-widget-content a.unknown:active     { color:#999999; }
+
 /* Interaction states
 ----------------------------------*/
 .darkorange .ui-state-default, .darkorange .ui-widget-content .ui-state-default, .darkorange .ui-widget-header .ui-state-default { border: 1px solid #dfdfdf; background: #2f2f2f url(images/bg_g_40_2f2f2f.png) 50% 50% repeat-x; font-weight: bold; color: #dfdfdf; }
diff -urN share-2.0.0/styles/themes/originalblue/jquery-ui.css share/styles/themes/originalblue/jquery-ui.css
--- share-2.0.0/styles/themes/originalblue/jquery-ui.css	2012-05-21 10:07:26.000000000 -0400
+++ share/styles/themes/originalblue/jquery-ui.css	2012-06-28 13:27:02.000000000 -0400
@@ -64,6 +64,22 @@
 .originalblue .ui-widget-header { border: 1px solid #7e9ab4; background: #779dc0 url(images/bg_h-hard_55.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
 .originalblue .ui-widget-header a { color: #ffffff; }
 
+/* This is required, otherwise, the css above overwrite the on/off/unknown defaults */
+.originalblue .ui-widget-content a.off:link      { color:#00AA00; }
+.originalblue .ui-widget-content a.off:visited   { color:#00AA00; }
+.originalblue .ui-widget-content a.off:hover     { color:#44CC44; }
+.originalblue .ui-widget-content a.off:active    { color:#00AA00; }
+
+.originalblue .ui-widget-content a.on:link       { color:#DC0000; }
+.originalblue .ui-widget-content a.on:visited    { color:#DC0000; }
+.originalblue .ui-widget-content a.on:hover      { color:#CC7777; }
+.originalblue .ui-widget-content a.on:active     { color:#DC0000; }
+
+.originalblue .ui-widget-content a.unknown:link       { color:#999999; }
+.originalblue .ui-widget-content a.unknown:visited    { color:#999999; }
+.originalblue .ui-widget-content a.unknown:hover      { color:#999; }
+.originalblue .ui-widget-content a.unknown:active     { color:#999999; }
+
 /* Interaction states
 ----------------------------------*/
 .originalblue .ui-state-default, .originalblue .ui-widget-content .ui-state-default, .originalblue .ui-widget-header .ui-state-default { border: 1px solid #9db2cd; background: #f5f8fa url(images/bg_h-hard_85.png) 50% 50% repeat-x; font-weight: bold; color: #5481ab; }
diff -urN share-2.0.0/sysmaps.php share/sysmaps.php
--- share-2.0.0/sysmaps.php	2012-05-21 10:07:35.000000000 -0400
+++ share/sysmaps.php	2012-07-12 16:55:51.000000000 -0400
@@ -65,8 +65,9 @@
 		'label_string_trigger'=>	array(T_ZBX_STR, O_OPT,	 NULL,	null,		'isset({save})'),
 		'label_string_map'=>		array(T_ZBX_STR, O_OPT,	 NULL,	null,		'isset({save})'),
 		'label_string_image'=>		array(T_ZBX_STR, O_OPT,	 NULL,	null,		'isset({save})'),
-		'label_type'=>		array(T_ZBX_INT, O_OPT,	 NULL,	BETWEEN(MAP_LABEL_TYPE_LABEL,MAP_LABEL_TYPE_CUSTOM),		'isset({save})'),
+		'label_type'=>		array(T_ZBX_INT, O_OPT,	 NULL,	BETWEEN(MAP_LABEL_TYPE_LABEL,MAP_LABEL_TYPE_COLORED),		'isset({save})'),
 		'label_location'=>	array(T_ZBX_INT, O_OPT,	 NULL,	BETWEEN(0,3),		'isset({save})'),
+		'font_size'=>	array(T_ZBX_INT, O_OPT,	 NULL,	BETWEEN(MAP_LABEL_SIZE_MIN,MAP_LABEL_SIZE_MAX),		'isset({save})'),
 		'urls'=>			array(T_ZBX_STR, O_OPT,	 NULL,	null,		null),
 // Actions
 		'save'=>			array(T_ZBX_STR, O_OPT, P_SYS|P_ACT,	NULL,	NULL),
@@ -138,6 +139,7 @@
 			'label_string_image' => get_request('label_string_image',''),
 			'label_type' => $_REQUEST['label_type'],
 			'label_location' => $_REQUEST['label_location'],
+			'font_size' => $_REQUEST['font_size'],
 			'show_unack' => get_request('show_unack', 0),
 			'urls' => get_request('urls', array())
 		);
@@ -241,6 +243,7 @@
 			$sysmap['label_string_image'] = get_request('label_string_image', '');
 			$sysmap['label_type'] = get_request('label_type', 0);
 			$sysmap['label_location'] = get_request('label_location', 0);
+			$sysmap['font_size'] = get_request('font_size', MAP_LABEL_SIZE_DEFAULT);
 			$sysmap['highlight'] = get_request('highlight', 0);
 			$sysmap['markelements'] = get_request('markelements', 0);
 			$sysmap['expandproblem'] = get_request('expandproblem', 0);
