href = $href; return $this; } public function setIcon($icon) { $this->icon = $icon; return $this; } public function setColor($color) { $this->color = $color; return $this; } public function setSize($size) { $this->size = $size; return $this; } public function setState($state) { $this->state = $state; return $this; } protected function getTagName() { $tag = 'span'; if ($this->href) { $tag = 'a'; } return $tag; } protected function getTagAttributes() { require_celerity_resource('phui-icon-view-css'); $classes = array(); $classes[] = 'phui-icon-circle'; if ($this->color) { $classes[] = 'hover-'.$this->color; } else { $classes[] = 'hover-sky'; } if ($this->size) { $classes[] = $this->size; } if ($this->state) { $classes[] = 'phui-icon-circle-state'; } return array( 'href' => $this->href, 'class' => $classes, ); } protected function getTagContent() { $state = null; if ($this->state) { $state = id(new PHUIIconView()) ->setIcon($this->state.' '.$this->color) ->addClass('phui-icon-circle-state-icon'); } return id(new PHUIIconView()) ->setIcon($this->icon) ->addClass('phui-icon-circle-icon') ->appendChild($state); } public static function getStateMap() { return array( self::STATE_FAIL => pht('Failure'), self::STATE_INFO => pht('Information'), self::STATE_STOP => pht('Stop'), self::STATE_START => pht('Start'), self::STATE_PAUSE => pht('Pause'), self::STATE_SUCCESS => pht('Success'), self::STATE_WARNING => pht('Warning'), self::STATE_PLUS => pht('Plus'), self::STATE_MINUS => pht('Minus'), self::STATE_UNKNOWN => pht('Unknown'), ); } }