@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
1<?php
2
3final class PHUICurtainView extends AphrontTagView {
4
5 private $actionList;
6 private $panels = array();
7
8 public function addAction(PhabricatorActionView $action) {
9 $this->getActionList()->addAction($action);
10 return $this;
11 }
12
13 public function addPanel(PHUICurtainPanelView $curtain_panel) {
14 $this->panels[] = $curtain_panel;
15 return $this;
16 }
17
18 public function newPanel() {
19 $panel = new PHUICurtainPanelView();
20 $this->addPanel($panel);
21
22 // By default, application panels go at the top of the curtain, above
23 // extension panels.
24 $panel->setOrder(1000);
25
26 return $panel;
27 }
28
29 public function setActionList(PhabricatorActionListView $action_list) {
30 $this->actionList = $action_list;
31 return $this;
32 }
33
34 public function getActionList() {
35 return $this->actionList;
36 }
37
38 protected function canAppendChild() {
39 return false;
40 }
41
42 protected function getTagContent() {
43 $action_list = $this->actionList;
44
45 require_celerity_resource('phui-curtain-view-css');
46
47 $panels = $this->renderPanels();
48
49 $box = id(new PHUIObjectBoxView())
50 ->appendChild($action_list)
51 ->appendChild($panels)
52 ->addClass('phui-two-column-properties');
53
54 // We want to hide this UI on mobile if there are no child panels
55 if (!$panels) {
56 $box->addClass('curtain-no-panels');
57 }
58
59 return $box;
60 }
61
62 private function renderPanels() {
63 $panels = $this->panels;
64 $panels = msortv($panels, 'getOrderVector');
65
66 return $panels;
67 }
68
69
70}