1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 18:52:42 +01:00
phorge-phorge/src/view/phui/PHUIWorkboardView.php
epriestley 284465f638 Make Workboard and Workpanel views extend AphrontTagView
Summary: Ref T1344. I need to put sigils on these for drag-and-drop.

Test Plan: Renders the same. Put sigils on 'em.

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Maniphest Tasks: T1344

Differential Revision: https://secure.phabricator.com/D7940
2014-01-13 12:23:39 -08:00

82 lines
1.8 KiB
PHP

<?php
final class PHUIWorkboardView extends AphrontTagView {
private $panels = array();
private $fluidLayout = false;
private $fluidishLayout = false;
private $actions = array();
public function addPanel(PHUIWorkpanelView $panel) {
$this->panels[] = $panel;
return $this;
}
public function setFluidLayout($layout) {
$this->fluidLayout = $layout;
return $this;
}
public function setFluidishLayout($layout) {
$this->fluidishLayout = $layout;
return $this;
}
public function addAction(PHUIIconView $action) {
$this->actions[] = $action;
return $this;
}
public function getTagAttributes() {
return array(
'class' => 'phui-workboard-view',
);
}
public function getTagContent() {
require_celerity_resource('phui-workboard-view-css');
$action_list = null;
if (!empty($this->actions)) {
$items = array();
foreach ($this->actions as $action) {
$items[] = phutil_tag(
'li',
array(
'class' => 'phui-workboard-action-item'
),
$action);
}
$action_list = phutil_tag(
'ul',
array(
'class' => 'phui-workboard-action-list'
),
$items);
}
$view = new AphrontMultiColumnView();
$view->setGutter(AphrontMultiColumnView::GUTTER_MEDIUM);
if ($this->fluidLayout) {
$view->setFluidLayout($this->fluidLayout);
}
if ($this->fluidishLayout) {
$view->setFluidishLayout($this->fluidishLayout);
}
foreach ($this->panels as $panel) {
$view->addColumn($panel);
}
$board = phutil_tag(
'div',
array(
'class' => 'phui-workboard-view-shadow'
),
$view);
return array(
$action_list,
$board,
);
}
}