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 $propertyLists = array(); | |||||
| 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() { | |||||
| $action = new PhabricatorActionView(); | |||||
| $this->actionItems[] = $action; | |||||
| return $action; | |||||
| } | |||||
| public function newPropertyList() { | |||||
| $list = new PHUIPropertyListView(); | |||||
| $this->propertyLists[] = $list; | |||||
| return $list; | |||||
| } | |||||
| /** | /** | ||||
| * This method has been deprecated, use @{method:setImageIcon} instead. | * This method has been deprecated, use @{method:setImageIcon} instead. | ||||
| * | * | ||||
| * @deprecated | * @deprecated | ||||
| */ | */ | ||||
| public function setIcon($icon) { | public function setIcon($icon) { | ||||
| phlog( | phlog( | ||||
| pht('Deprecated call to setIcon(), use setImageIcon() instead.')); | pht('Deprecated call to setIcon(), use setImageIcon() instead.')); | ||||
| ▲ Show 20 Lines • Show All 370 Lines • ▼ Show 20 Lines | if ($this->getGrippable() !== null) { | ||||
| $grippable = phutil_tag( | $grippable = phutil_tag( | ||||
| 'div', | 'div', | ||||
| array( | array( | ||||
| 'class' => 'phui-oi-grip', | 'class' => 'phui-oi-grip', | ||||
| ), | ), | ||||
| ''); | ''); | ||||
| } | } | ||||
| $property_lists = null; | |||||
| if ($this->propertyLists) { | |||||
| $property_lists[] = phutil_tag( | |||||
| 'div', | |||||
| array(), | |||||
| $this->propertyLists); | |||||
| } | |||||
| $content = phutil_tag( | $content = phutil_tag( | ||||
| 'div', | 'div', | ||||
| array( | array( | ||||
| 'class' => implode(' ', $content_classes), | 'class' => implode(' ', $content_classes), | ||||
| ), | ), | ||||
| array( | array( | ||||
| $subhead, | $subhead, | ||||
| $attrs, | $attrs, | ||||
| $property_lists, | |||||
| $this->renderChildren(), | $this->renderChildren(), | ||||
| )); | )); | ||||
| $image = null; | $image = null; | ||||
| if ($this->getImageURI()) { | if ($this->getImageURI()) { | ||||
| $image = phutil_tag( | $image = phutil_tag( | ||||
| 'div', | 'div', | ||||
| array( | array( | ||||
| ▲ Show 20 Lines • Show All 111 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 97 Lines • Show Last 20 Lines | |||||