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; | private $exiled; | ||||
private $exileNote = false; | |||||
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) { | public function setExiled($is_exiled, $note = false) { | ||||
$this->exiled = $is_exiled; | $this->exiled = $is_exiled; | ||||
$this->exileNote = $note; | |||||
return $this; | 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) { | ||||
Show All 31 Lines | if ($epoch !== null) { | ||||
'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) { | if ($this->exiled) { | ||||
if ($this->exileNote !== false) { | |||||
$exile_note = $this->exileNote; | |||||
} else { | |||||
$exile_note = pht('No View Permission'); | |||||
} | |||||
$exiled_view = array( | $exiled_view = array( | ||||
id(new PHUIIconView())->setIcon('fa-eye-slash red'), | id(new PHUIIconView())->setIcon('fa-eye-slash red'), | ||||
' ', | ' ', | ||||
pht('No View Permission'), | $exile_note, | ||||
); | ); | ||||
$exiled_cells = array(); | $exiled_cells = array(); | ||||
$exiled_cells[] = phutil_tag( | $exiled_cells[] = phutil_tag( | ||||
'td', | 'td', | ||||
array( | array( | ||||
'class' => 'phui-curtain-object-ref-view-exiled-cell', | 'class' => 'phui-curtain-object-ref-view-exiled-cell', | ||||
), | ), | ||||
▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines |