1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 01:32:42 +01:00
phorge-phorge/src/view/layout/PhabricatorWorkboardView.php
Chad Little 7aea37c443 PHUIIconView
Summary: Adds a base class for displaying images and icons.

Test Plan: Tested giving and taking tokens, viewed action headers, uiexamples for icons, workboards.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5736
2013-04-19 17:44:20 -07:00

70 lines
1.6 KiB
PHP

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