Commits

Christoffer Niska committed fe1a10e

minor improvement to labels and badges

Comments (0)

Files changed (2)

widgets/TbBadge.php

 	{
 		$classes = array('badge');
 
-		$validTypes = array(self::TYPE_SUCCESS, self::TYPE_WARNING, self::TYPE_IMPORTANT, self::TYPE_INFO, self::TYPE_INVERSE);
-
-		if (in_array($this->type, $validTypes))
+		if (in_array($this->type, array(self::TYPE_SUCCESS, self::TYPE_WARNING, self::TYPE_IMPORTANT, self::TYPE_INFO, self::TYPE_INVERSE)))
 			$classes[] = 'badge-'.$this->type;
 
 		$classes = implode(' ', $classes);

widgets/TbLabel.php

 	{
 		$classes = array('label');
 
-		$validTypes = array(self::TYPE_SUCCESS, self::TYPE_WARNING,
-				self::TYPE_IMPORTANT, self::TYPE_INFO, self::TYPE_INVERSE);
-
-		if (in_array($this->type, $validTypes))
+		if (in_array($this->type, array(self::TYPE_SUCCESS, self::TYPE_WARNING, self::TYPE_IMPORTANT, self::TYPE_INFO, self::TYPE_INVERSE)))
 			$classes[] = 'label-'.$this->type;
 
 		$classes = implode(' ', $classes);