1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-26 23:40:57 +01:00
phorge-phorge/src/view/layout/PHUICurtainView.php
epriestley eb1a0799ae Convert Maniphest to curtain view
Summary: Moves Maniphest over, and allows application to provide ad-hoc panels more easily.

Test Plan: {F1160591}

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D15417
2016-03-06 10:32:18 -08:00

63 lines
1.3 KiB
PHP

<?php
final class PHUICurtainView extends AphrontTagView {
private $actionList;
private $panels = array();
public function addAction(PhabricatorActionView $action) {
$this->getActionList()->addAction($action);
return $this;
}
public function addPanel(PHUICurtainPanelView $curtain_panel) {
$this->panels[] = $curtain_panel;
return $this;
}
public function newPanel() {
$panel = new PHUICurtainPanelView();
$this->addPanel($panel);
// By default, application panels go at the bottom of the curtain, below
// extension panels.
$panel->setOrder(100000);
return $panel;
}
public function setActionList(PhabricatorActionListView $action_list) {
$this->actionList = $action_list;
return $this;
}
public function getActionList() {
return $this->actionList;
}
protected function canAppendChild() {
return false;
}
protected function getTagContent() {
$action_list = $this->actionList;
require_celerity_resource('phui-curtain-view-css');
$panels = $this->renderPanels();
return id(new PHUIObjectBoxView())
->appendChild($action_list)
->appendChild($panels)
->addClass('phui-two-column-properties');
}
private function renderPanels() {
$panels = $this->panels;
$panels = msortv($panels, 'getOrderVector');
return $panels;
}
}