Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/view/phui/PHUIPinboardView.php
12249 views
1
<?php
2
3
final class PHUIPinboardView extends AphrontView {
4
5
private $items = array();
6
private $noDataString;
7
8
public function setNoDataString($no_data_string) {
9
$this->noDataString = $no_data_string;
10
return $this;
11
}
12
13
public function addItem(PHUIPinboardItemView $item) {
14
$this->items[] = $item;
15
return $this;
16
}
17
18
public function render() {
19
require_celerity_resource('phui-pinboard-view-css');
20
21
if (!$this->items) {
22
$string = nonempty($this->noDataString, pht('No data.'));
23
return id(new PHUIInfoView())
24
->setSeverity(PHUIInfoView::SEVERITY_NODATA)
25
->appendChild($string)
26
->render();
27
}
28
29
return phutil_tag(
30
'ul',
31
array(
32
'class' => 'phui-pinboard-view',
33
),
34
$this->items);
35
}
36
37
}
38
39