Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / view / phui / PHUICurtainObjectRefListView.php
blobd42a34452fd8878626f515519fc8aa2a49155947
1 <?php
3 final class PHUICurtainObjectRefListView
4 extends AphrontTagView {
6 private $refs = array();
7 private $emptyMessage;
8 private $tail = array();
10 protected function getTagAttributes() {
11 return array(
12 'class' => 'phui-curtain-object-ref-list-view',
16 public function setEmptyMessage($empty_message) {
17 $this->emptyMessage = $empty_message;
18 return $this;
21 protected function getTagContent() {
22 $refs = $this->refs;
24 if (!$refs && ($this->emptyMessage !== null)) {
25 $view = phutil_tag(
26 'div',
27 array(
28 'class' => 'phui-curtain-object-ref-list-view-empty',
30 $this->emptyMessage);
31 } else {
32 $view = $refs;
35 $tail = null;
36 if ($this->tail) {
37 $tail = phutil_tag(
38 'div',
39 array(
40 'class' => 'phui-curtain-object-ref-list-view-tail',
42 $this->tail);
45 return array(
46 $view,
47 $tail,
51 public function newObjectRefView() {
52 $ref_view = id(new PHUICurtainObjectRefView())
53 ->setViewer($this->getViewer());
55 $this->refs[] = $ref_view;
57 return $ref_view;
60 public function newTailLink() {
61 $link = new PHUILinkView();
63 $this->tail[] = $link;
65 return $link;