Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIObjectItemListView.php
<?php | <?php | ||||
final class PHUIObjectItemListView extends AphrontTagView { | final class PHUIObjectItemListView extends AphrontTagView { | ||||
private $header; | private $header; | ||||
private $items; | private $items; | ||||
private $pager; | private $pager; | ||||
private $stackable; | private $stackable; | ||||
private $cards; | private $cards; | ||||
private $noDataString; | private $noDataString; | ||||
private $flush; | private $flush; | ||||
private $plain; | private $plain; | ||||
private $allowEmptyList; | |||||
public function setAllowEmptyList($allow_empty_list) { | |||||
$this->allowEmptyList = $allow_empty_list; | |||||
return $this; | |||||
} | |||||
public function getAllowEmptyList() { | |||||
return $this->allowEmptyList; | |||||
} | |||||
public function setFlush($flush) { | public function setFlush($flush) { | ||||
$this->flush = $flush; | $this->flush = $flush; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setPlain($plain) { | public function setPlain($plain) { | ||||
$this->plain = $plain; | $this->plain = $plain; | ||||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | if (strlen($this->header)) { | ||||
array( | array( | ||||
'class' => 'phui-object-item-list-header', | 'class' => 'phui-object-item-list-header', | ||||
), | ), | ||||
$this->header); | $this->header); | ||||
} | } | ||||
if ($this->items) { | if ($this->items) { | ||||
$items = $this->items; | $items = $this->items; | ||||
} else if ($this->allowEmptyList) { | |||||
$items = null; | |||||
} else { | } else { | ||||
$string = nonempty($this->noDataString, pht('No data.')); | $string = nonempty($this->noDataString, pht('No data.')); | ||||
$items = id(new AphrontErrorView()) | $items = id(new AphrontErrorView()) | ||||
->setSeverity(AphrontErrorView::SEVERITY_NODATA) | ->setSeverity(AphrontErrorView::SEVERITY_NODATA) | ||||
->appendChild($string); | ->appendChild($string); | ||||
} | } | ||||
$pager = null; | $pager = null; | ||||
Show All 13 Lines |