Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUICurtainObjectRefView.php
| <?php | <?php | ||||
| final class PHUICurtainObjectRefView | final class PHUICurtainObjectRefView | ||||
| extends AphrontTagView { | extends AphrontTagView { | ||||
| private $handle; | private $handle; | ||||
| private $epoch; | private $epoch; | ||||
| private $highlighted; | private $highlighted; | ||||
| private $exiled; | |||||
| public function setHandle(PhabricatorObjectHandle $handle) { | public function setHandle(PhabricatorObjectHandle $handle) { | ||||
| $this->handle = $handle; | $this->handle = $handle; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setEpoch($epoch) { | public function setEpoch($epoch) { | ||||
| $this->epoch = $epoch; | $this->epoch = $epoch; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setHighlighted($highlighted) { | public function setHighlighted($highlighted) { | ||||
| $this->highlighted = $highlighted; | $this->highlighted = $highlighted; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setExiled($is_exiled) { | |||||
| $this->exiled = $is_exiled; | |||||
| return $this; | |||||
| } | |||||
| protected function getTagAttributes() { | protected function getTagAttributes() { | ||||
| $classes = array(); | $classes = array(); | ||||
| $classes[] = 'phui-curtain-object-ref-view'; | $classes[] = 'phui-curtain-object-ref-view'; | ||||
| if ($this->highlighted) { | if ($this->highlighted) { | ||||
| $classes[] = 'phui-curtain-object-ref-view-highlighted'; | $classes[] = 'phui-curtain-object-ref-view-highlighted'; | ||||
| } | } | ||||
| if ($this->exiled) { | |||||
| $classes[] = 'phui-curtain-object-ref-view-exiled'; | |||||
| } | |||||
| $classes = implode(' ', $classes); | $classes = implode(' ', $classes); | ||||
| return array( | return array( | ||||
| 'class' => $classes, | 'class' => $classes, | ||||
| ); | ); | ||||
| } | } | ||||
| protected function getTagContent() { | protected function getTagContent() { | ||||
| Show All 15 Lines | if ($epoch !== null) { | ||||
| array( | array( | ||||
| 'class' => 'phui-curtain-object-ref-view-epoch-cell', | 'class' => 'phui-curtain-object-ref-view-epoch-cell', | ||||
| ), | ), | ||||
| $epoch_view); | $epoch_view); | ||||
| $more_rows[] = phutil_tag('tr', array(), $epoch_cells); | $more_rows[] = phutil_tag('tr', array(), $epoch_cells); | ||||
| } | } | ||||
| if ($this->exiled) { | |||||
| $exiled_view = array( | |||||
| id(new PHUIIconView())->setIcon('fa-eye-slash red'), | |||||
| ' ', | |||||
| pht('No View Permission'), | |||||
| ); | |||||
| $exiled_cells = array(); | |||||
| $exiled_cells[] = phutil_tag( | |||||
| 'td', | |||||
| array( | |||||
| 'class' => 'phui-curtain-object-ref-view-exiled-cell', | |||||
| ), | |||||
| $exiled_view); | |||||
| $more_rows[] = phutil_tag('tr', array(), $exiled_cells); | |||||
| } | |||||
| $header_cells = array(); | $header_cells = array(); | ||||
| $image_view = $this->newImage(); | $image_view = $this->newImage(); | ||||
| if ($more_rows) { | if ($more_rows) { | ||||
| $row_count = 1 + count($more_rows); | $row_count = 1 + count($more_rows); | ||||
| } else { | } else { | ||||
| $row_count = null; | $row_count = null; | ||||
| ▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines | |||||