@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at recaptime-dev/main 37 lines 788 B view raw
1<?php 2 3final 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}