Restore highlighting when jumping to transactions using URI anchors
[phabricator/blender.git] / src / view / layout / PHUICurtainView.php
blob4bd5b974768d5486da039aaab818754a01ad2b5f
1 <?php
3 final class PHUICurtainView extends AphrontTagView {
5 private $actionList;
6 private $panels = array();
8 public function addAction(PhabricatorActionView $action) {
9 $this->getActionList()->addAction($action);
10 return $this;
13 public function addPanel(PHUICurtainPanelView $curtain_panel) {
14 $this->panels[] = $curtain_panel;
15 return $this;
18 public function newPanel() {
19 $panel = new PHUICurtainPanelView();
20 $this->addPanel($panel);
22 // By default, application panels go at the top of the curtain, above
23 // extension panels.
24 $panel->setOrder(1000);
26 return $panel;
29 public function setActionList(PhabricatorActionListView $action_list) {
30 $this->actionList = $action_list;
31 return $this;
34 public function getActionList() {
35 return $this->actionList;
38 protected function canAppendChild() {
39 return false;
42 protected function getTagContent() {
43 $action_list = $this->actionList;
45 require_celerity_resource('phui-curtain-view-css');
47 $panels = $this->renderPanels();
49 $box = id(new PHUIObjectBoxView())
50 ->appendChild($action_list)
51 ->appendChild($panels)
52 ->addClass('phui-two-column-properties');
54 // We want to hide this UI on mobile if there are no child panels
55 if (!$panels) {
56 $box->addClass('curtain-no-panels');
59 return $box;
62 private function renderPanels() {
63 $panels = $this->panels;
64 $panels = msortv($panels, 'getOrderVector');
66 return $panels;