Path: blob/master/src/view/phui/PHUIStatusItemView.php
12249 views
<?php12final class PHUIStatusItemView extends AphrontTagView {34private $icon;5private $iconLabel;6private $iconColor;7private $target;8private $note;9private $highlighted;10private $isExiled;1112const ICON_ACCEPT = 'fa-check-circle';13const ICON_REJECT = 'fa-times-circle';14const ICON_LEFT = 'fa-chevron-circle-left';15const ICON_RIGHT = 'fa-chevron-circle-right';16const ICON_UP = 'fa-chevron-circle-up';17const ICON_DOWN = 'fa-chevron-circle-down';18const ICON_QUESTION = 'fa-question-circle';19const ICON_WARNING = 'fa-exclamation-circle';20const ICON_INFO = 'fa-info-circle';21const ICON_ADD = 'fa-plus-circle';22const ICON_MINUS = 'fa-minus-circle';23const ICON_OPEN = 'fa-circle-o';24const ICON_CLOCK = 'fa-clock-o';25const ICON_STAR = 'fa-star';2627public function setIcon($icon, $color = null, $label = null) {28$this->icon = $icon;29$this->iconLabel = $label;30$this->iconColor = $color;31return $this;32}3334public function setTarget($target) {35$this->target = $target;36return $this;37}3839public function setNote($note) {40$this->note = $note;41return $this;42}4344public function setHighlighted($highlighted) {45$this->highlighted = $highlighted;46return $this;47}4849public function setIsExiled($is_exiled) {50$this->isExiled = $is_exiled;51return $this;52}5354protected function canAppendChild() {55return false;56}5758protected function getTagName() {59return 'tr';60}6162protected function getTagAttributes() {63$classes = array();64if ($this->highlighted) {65$classes[] = 'phui-status-item-highlighted';66}6768if ($this->isExiled) {69$classes[] = 'phui-status-item-exiled';70}7172return array(73'class' => $classes,74);75}7677protected function getTagContent() {7879$icon = null;80if ($this->icon) {81$icon = id(new PHUIIconView())82->setIcon($this->icon.' '.$this->iconColor);8384if ($this->iconLabel) {85Javelin::initBehavior('phabricator-tooltips');86$icon->addSigil('has-tooltip');87$icon->setMetadata(88array(89'tip' => $this->iconLabel,90'size' => 240,91));92}93}9495$target_cell = phutil_tag(96'td',97array(98'class' => 'phui-status-item-target',99),100array(101$icon,102$this->target,103));104105$note_cell = phutil_tag(106'td',107array(108'class' => 'phui-status-item-note',109),110$this->note);111112return array(113$target_cell,114$note_cell,115);116}117}118119120