2013-03-30 17:51:35 +01:00
|
|
|
<?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;
|
|
|
|
}
|
|
|
|
|
2013-03-30 22:46:02 +01:00
|
|
|
public function setFooterAction(PhabricatorMenuItemView $footer_action) {
|
2013-03-30 17:51:35 +01:00
|
|
|
$this->footerAction = $footer_action;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function render() {
|
|
|
|
require_celerity_resource('phabricator-workpanel-view-css');
|
|
|
|
|
|
|
|
$footer = '';
|
|
|
|
if ($this->footerAction) {
|
2013-03-30 22:46:02 +01:00
|
|
|
$footer_tag = $this->footerAction;
|
|
|
|
$footer = phutil_tag(
|
|
|
|
'div',
|
2013-03-30 17:51:35 +01:00
|
|
|
array(
|
2013-03-30 22:46:02 +01:00
|
|
|
'class' => 'phabricator-workpanel-footer-action mst ps'
|
2013-03-30 17:51:35 +01:00
|
|
|
),
|
2013-03-30 22:46:02 +01:00
|
|
|
$footer_tag);
|
2013-03-30 17:51:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$header = phutil_tag(
|
|
|
|
'div',
|
|
|
|
array(
|
|
|
|
'class' => 'phabricator-workpanel-header'
|
|
|
|
),
|
|
|
|
$this->header);
|
|
|
|
|
|
|
|
$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);
|
|
|
|
}
|
|
|
|
}
|