1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-15 03:12:41 +01:00
phorge-phorge/src/view/layout/PhabricatorWorkpanelView.php
Chad Little f1bf27959f PHUIList, PHUIDocument updates
Summary:
This diff covers a bit of ground.

- PHUIDocumentExample has been added
- PHUIDocument has been extended with new features
- PhabricatorMenuView is now PHUIListView
- PhabricatorMenuItemView is now PHUIItemListView

Overall - I think I've gotten all the edges covered here. There is some derpi-ness that we can talk about, comments in the code. Responsive design is missing from the new features on PHUIDocument, will follow up later.

Test Plan: Tested mobile and desktop menus, old phriction layout, new document views, new lists, and object lists.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D6130
2013-06-05 08:41:43 -07:00

73 lines
1.6 KiB
PHP

<?php
final class PhabricatorWorkpanelView extends AphrontView {
private $cards = array();
private $header;
private $headerAction;
private $footerAction;
public function setCards(PhabricatorObjectItemListView $cards) {
$this->cards[] = $cards;
return $this;
}
public function setHeader($header) {
$this->header = $header;
return $this;
}
public function setHeaderAction($header_action) {
$this->headerAction = $header_action;
return $this;
}
public function setFooterAction(PHUIListItemView $footer_action) {
$this->footerAction = $footer_action;
return $this;
}
public function render() {
require_celerity_resource('phabricator-workpanel-view-css');
$footer = '';
if ($this->footerAction) {
$footer_tag = $this->footerAction;
$footer = phutil_tag(
'ul',
array(
'class' => 'phabricator-workpanel-footer-action mst ps'
),
$footer_tag);
}
$header = id(new PhabricatorActionHeaderView())
->setHeaderTitle($this->header)
->setHeaderColor(PhabricatorActionHeaderView::HEADER_GREY);
$body = phutil_tag(
'div',
array(
'class' => 'phabricator-workpanel-body'
),
$this->cards);
$view = phutil_tag(
'div',
array(
'class' => 'phabricator-workpanel-view-inner',
),
array(
$header,
$body,
$footer,
));
return phutil_tag(
'div',
array(
'class' => 'phabricator-workpanel-view'
),
$view);
}
}