Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/view/DifferentialRevisionListView.php
| <?php | <?php | ||||
| /** | /** | ||||
| * Render a table of Differential revisions. | * Render a table of Differential revisions. | ||||
| */ | */ | ||||
| final class DifferentialRevisionListView extends AphrontView { | final class DifferentialRevisionListView extends AphrontView { | ||||
| private $revisions; | private $revisions; | ||||
| private $handles; | private $handles; | ||||
| private $header; | private $header; | ||||
| private $noDataString; | private $noDataString; | ||||
| private $noBox; | private $noBox; | ||||
| private $background = null; | private $background = null; | ||||
| private $unlandedDependencies = array(); | private $unlandedDependencies = array(); | ||||
| private $customFieldLists = array(); | |||||
| public function setUnlandedDependencies(array $unlanded_dependencies) { | public function setUnlandedDependencies(array $unlanded_dependencies) { | ||||
| $this->unlandedDependencies = $unlanded_dependencies; | $this->unlandedDependencies = $unlanded_dependencies; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getUnlandedDependencies() { | public function getUnlandedDependencies() { | ||||
| return $this->unlandedDependencies; | return $this->unlandedDependencies; | ||||
| Show All 38 Lines | final class DifferentialRevisionListView extends AphrontView { | ||||
| } | } | ||||
| public function setHandles(array $handles) { | public function setHandles(array $handles) { | ||||
| assert_instances_of($handles, 'PhabricatorObjectHandle'); | assert_instances_of($handles, 'PhabricatorObjectHandle'); | ||||
| $this->handles = $handles; | $this->handles = $handles; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setCustomFieldLists(array $lists) { | |||||
| $this->customFieldLists = $lists; | |||||
| return $this; | |||||
| } | |||||
| public function render() { | public function render() { | ||||
| $viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
| $this->initBehavior('phabricator-tooltips', array()); | $this->initBehavior('phabricator-tooltips', array()); | ||||
| $this->requireResource('aphront-tooltip-css'); | $this->requireResource('aphront-tooltip-css'); | ||||
| $list = new PHUIObjectItemListView(); | $list = new PHUIObjectItemListView(); | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | foreach ($this->revisions as $revision) { | ||||
| if ($revision->isClosed()) { | if ($revision->isClosed()) { | ||||
| $item->setDisabled(true); | $item->setDisabled(true); | ||||
| } | } | ||||
| $item->setStatusIcon( | $item->setStatusIcon( | ||||
| $revision->getStatusIcon(), | $revision->getStatusIcon(), | ||||
| $revision->getStatusDisplayName()); | $revision->getStatusDisplayName()); | ||||
| $field_list = idx($this->customFieldLists, $revision->getPHID()); | |||||
| if ($field_list) { | |||||
| $field_list | |||||
| ->appendFieldsToListItem($revision, $this->getViewer(), $item); | |||||
| } | |||||
| $list->addItem($item); | $list->addItem($item); | ||||
| } | } | ||||
| $list->setNoDataString($this->noDataString); | $list->setNoDataString($this->noDataString); | ||||
| if ($this->header && !$this->noBox) { | if ($this->header && !$this->noBox) { | ||||
| $list->setFlush(true); | $list->setFlush(true); | ||||
| Show All 17 Lines | |||||