Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIObjectItemView.php
Show All 20 Lines | final class PHUIObjectItemView extends AphrontTagView { | ||||
private $imageURI; | private $imageURI; | ||||
private $state; | private $state; | ||||
private $fontIcon; | private $fontIcon; | ||||
private $imageIcon; | private $imageIcon; | ||||
private $titleText; | private $titleText; | ||||
private $badge; | private $badge; | ||||
private $countdownNum; | private $countdownNum; | ||||
private $countdownNoun; | private $countdownNoun; | ||||
private $launchButton; | |||||
const AGE_FRESH = 'fresh'; | const AGE_FRESH = 'fresh'; | ||||
const AGE_STALE = 'stale'; | const AGE_STALE = 'stale'; | ||||
const AGE_OLD = 'old'; | const AGE_OLD = 'old'; | ||||
const STATE_SUCCESS = 'green'; | const STATE_SUCCESS = 'green'; | ||||
const STATE_FAIL = 'red'; | const STATE_FAIL = 'red'; | ||||
const STATE_WARN = 'yellow'; | const STATE_WARN = 'yellow'; | ||||
▲ Show 20 Lines • Show All 218 Lines • ▼ Show 20 Lines | final class PHUIObjectItemView extends AphrontTagView { | ||||
public function addAttribute($attribute) { | public function addAttribute($attribute) { | ||||
if (!empty($attribute)) { | if (!empty($attribute)) { | ||||
$this->attributes[] = $attribute; | $this->attributes[] = $attribute; | ||||
} | } | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setLaunchButton(PHUIButtonView $button) { | |||||
$button->setSize(PHUIButtonView::SMALL); | |||||
$this->launchButton = $button; | |||||
return $this; | |||||
} | |||||
protected function getTagName() { | protected function getTagName() { | ||||
return 'li'; | return 'li'; | ||||
} | } | ||||
protected function getTagAttributes() { | protected function getTagAttributes() { | ||||
$item_classes = array(); | $item_classes = array(); | ||||
$item_classes[] = 'phui-object-item'; | $item_classes[] = 'phui-object-item'; | ||||
▲ Show 20 Lines • Show All 376 Lines • ▼ Show 20 Lines | if ($icons || $bylines) { | ||||
'class' => 'phui-object-item-col2', | 'class' => 'phui-object-item-col2', | ||||
), | ), | ||||
array( | array( | ||||
$icons, | $icons, | ||||
$bylines, | $bylines, | ||||
)); | )); | ||||
} | } | ||||
if ($this->launchButton) { | |||||
$column2 = phutil_tag( | |||||
'div', | |||||
array( | |||||
'class' => 'phui-object-item-col2 phui-object-item-launch-button', | |||||
), | |||||
array( | |||||
$this->launchButton, | |||||
)); | |||||
} | |||||
$table = phutil_tag( | $table = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'phui-object-item-table', | 'class' => 'phui-object-item-table', | ||||
), | ), | ||||
phutil_tag_div( | phutil_tag_div( | ||||
'phui-object-item-table-row', | 'phui-object-item-table-row', | ||||
array( | array( | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |