@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 68 lines 1.3 kB view raw
1<?php 2 3final class PHUICurtainObjectRefListView 4 extends AphrontTagView { 5 6 private $refs = array(); 7 private $emptyMessage; 8 private $tail = array(); 9 10 protected function getTagAttributes() { 11 return array( 12 'class' => 'phui-curtain-object-ref-list-view', 13 ); 14 } 15 16 public function setEmptyMessage($empty_message) { 17 $this->emptyMessage = $empty_message; 18 return $this; 19 } 20 21 protected function getTagContent() { 22 $refs = $this->refs; 23 24 if (!$refs && ($this->emptyMessage !== null)) { 25 $view = phutil_tag( 26 'div', 27 array( 28 'class' => 'phui-curtain-object-ref-list-view-empty', 29 ), 30 $this->emptyMessage); 31 } else { 32 $view = $refs; 33 } 34 35 $tail = null; 36 if ($this->tail) { 37 $tail = phutil_tag( 38 'div', 39 array( 40 'class' => 'phui-curtain-object-ref-list-view-tail', 41 ), 42 $this->tail); 43 } 44 45 return array( 46 $view, 47 $tail, 48 ); 49 } 50 51 public function newObjectRefView() { 52 $ref_view = id(new PHUICurtainObjectRefView()) 53 ->setViewer($this->getViewer()); 54 55 $this->refs[] = $ref_view; 56 57 return $ref_view; 58 } 59 60 public function newTailLink() { 61 $link = new PHUILinkView(); 62 63 $this->tail[] = $link; 64 65 return $link; 66 } 67 68}