Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIObjectItemView.php
Show All 10 Lines | final class PHUIObjectItemView extends AphrontTagView { | ||||
private $barColor; | private $barColor; | ||||
private $object; | private $object; | ||||
private $effect; | private $effect; | ||||
private $statusIcon; | private $statusIcon; | ||||
private $handleIcons = array(); | private $handleIcons = array(); | ||||
private $bylines = array(); | private $bylines = array(); | ||||
private $grippable; | private $grippable; | ||||
private $actions = array(); | private $actions = array(); | ||||
private $actionItems = array(); | |||||
private $headIcons = array(); | private $headIcons = array(); | ||||
private $disabled; | private $disabled; | ||||
private $imageURI; | private $imageURI; | ||||
private $imageHref; | private $imageHref; | ||||
private $imageIcon; | private $imageIcon; | ||||
private $titleText; | private $titleText; | ||||
private $badge; | private $badge; | ||||
private $countdownNum; | private $countdownNum; | ||||
private $countdownNoun; | private $countdownNoun; | ||||
private $sideColumn; | private $sideColumn; | ||||
private $coverImage; | private $coverImage; | ||||
private $description; | private $description; | ||||
private $clickable; | private $clickable; | ||||
private $mapViews = array(); | private $mapViews = array(); | ||||
private $menu; | |||||
private $selectableName; | private $selectableName; | ||||
private $selectableValue; | private $selectableValue; | ||||
private $isSelected; | private $isSelected; | ||||
private $isForbidden; | private $isForbidden; | ||||
public function setDisabled($disabled) { | public function setDisabled($disabled) { | ||||
$this->disabled = $disabled; | $this->disabled = $disabled; | ||||
▲ Show 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | public function addIcon($icon, $label = null, $attributes = array()) { | ||||
$this->icons[] = array( | $this->icons[] = array( | ||||
'icon' => $icon, | 'icon' => $icon, | ||||
'label' => $label, | 'label' => $label, | ||||
'attributes' => $attributes, | 'attributes' => $attributes, | ||||
); | ); | ||||
return $this; | return $this; | ||||
} | } | ||||
public function newAction() { | public function newMenuItem() { | ||||
$action = new PhabricatorActionView(); | if (!$this->menu) { | ||||
$this->actionItems[] = $action; | $this->menu = new FuelMenuView(); | ||||
return $action; | } | ||||
return $this->menu->newItem(); | |||||
} | } | ||||
public function newMapView() { | public function newMapView() { | ||||
$list = id(new FuelMapView()) | $list = id(new FuelMapView()) | ||||
->addClass('fuel-map-property-list'); | ->addClass('fuel-map-property-list'); | ||||
$this->mapViews[] = $list; | $this->mapViews[] = $list; | ||||
return $list; | return $list; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 529 Lines • ▼ Show 20 Lines | if ($this->sideColumn) { | ||||
array( | array( | ||||
'class' => 'phui-oi-col2 phui-oi-side-column', | 'class' => 'phui-oi-col2 phui-oi-side-column', | ||||
), | ), | ||||
array( | array( | ||||
$this->sideColumn, | $this->sideColumn, | ||||
)); | )); | ||||
} | } | ||||
$column4 = null; | |||||
if ($this->actionItems) { | |||||
$action_list = id(new PhabricatorActionListView()) | |||||
->setViewer($viewer); | |||||
foreach ($this->actionItems as $action_item) { | |||||
$action_list->addAction($action_item); | |||||
} | |||||
$column4 = phutil_tag( | |||||
'div', | |||||
array( | |||||
'class' => 'phui-oi-col2 phui-oi-action-list', | |||||
), | |||||
$action_list); | |||||
} | |||||
$table = phutil_tag( | $table = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'phui-oi-table', | 'class' => 'phui-oi-table', | ||||
), | ), | ||||
phutil_tag_div( | phutil_tag_div( | ||||
'phui-oi-table-row', | 'phui-oi-table-row', | ||||
array( | array( | ||||
$column0, | $column0, | ||||
$column1, | $column1, | ||||
$column2, | $column2, | ||||
$column3, | $column3, | ||||
$column4, | |||||
))); | ))); | ||||
$box = phutil_tag( | $box = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'phui-oi-content-box', | 'class' => 'phui-oi-content-box', | ||||
), | ), | ||||
array( | array( | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | $frame = phutil_tag( | ||||
array( | array( | ||||
'class' => 'phui-oi-frame', | 'class' => 'phui-oi-frame', | ||||
), | ), | ||||
array( | array( | ||||
$frame_cover, | $frame_cover, | ||||
$frame_content, | $frame_content, | ||||
)); | )); | ||||
return $frame; | $grid_view = id(new FuelGridView()) | ||||
->addClass('fuel-grid-tablet'); | |||||
$grid_row = $grid_view->newRow(); | |||||
$grid_row->newCell() | |||||
->setContent($frame); | |||||
if ($this->menu) { | |||||
$menu = $this->menu; | |||||
$grid_row->newCell() | |||||
->addClass('phui-oi-menu') | |||||
->setContent($menu); | |||||
} | |||||
return $grid_view; | |||||
} | } | ||||
private function renderStatusIcon($icon, $label) { | private function renderStatusIcon($icon, $label) { | ||||
Javelin::initBehavior('phabricator-tooltips'); | Javelin::initBehavior('phabricator-tooltips'); | ||||
$icon = id(new PHUIIconView()) | $icon = id(new PHUIIconView()) | ||||
->setIcon($icon); | ->setIcon($icon); | ||||
Show All 30 Lines |