2014-01-29 05:18:01 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorHomeQuickCreateController
|
|
|
|
extends PhabricatorHomeController {
|
|
|
|
|
2015-10-12 21:01:02 +02:00
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
|
|
$viewer = $this->getViewer();
|
2014-01-29 05:18:01 +01:00
|
|
|
|
2014-01-29 05:19:20 +01:00
|
|
|
$items = $this->getCurrentApplication()->loadAllQuickCreateItems($viewer);
|
2014-01-29 05:18:01 +01:00
|
|
|
|
|
|
|
$list = id(new PHUIObjectItemListView())
|
|
|
|
->setUser($viewer);
|
|
|
|
|
|
|
|
foreach ($items as $item) {
|
|
|
|
$list->addItem(
|
|
|
|
id(new PHUIObjectItemView())
|
|
|
|
->setHeader($item->getName())
|
|
|
|
->setWorkflow($item->getWorkflow())
|
|
|
|
->setHref($item->getHref()));
|
|
|
|
}
|
|
|
|
|
2016-04-05 22:32:06 +02:00
|
|
|
$title = pht('Quick Create');
|
|
|
|
|
2014-01-29 05:18:01 +01:00
|
|
|
$crumbs = $this->buildApplicationCrumbs();
|
|
|
|
$crumbs->addTextCrumb(pht('Quick Create'));
|
2016-04-05 22:32:06 +02:00
|
|
|
$crumbs->setBorder(true);
|
|
|
|
|
|
|
|
$box = id(new PHUIObjectBoxView())
|
|
|
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
|
|
|
->setObjectList($list);
|
|
|
|
|
|
|
|
$header = id(new PHUIHeaderView())
|
|
|
|
->setHeader($title)
|
|
|
|
->setHeaderIcon('fa-plus-square');
|
|
|
|
|
|
|
|
$view = id(new PHUITwoColumnView())
|
|
|
|
->setHeader($header)
|
|
|
|
->setFooter($box);
|
|
|
|
|
|
|
|
return $this->newPage()
|
|
|
|
->setTitle($title)
|
|
|
|
->setCrumbs($crumbs)
|
|
|
|
->appendChild($view);
|
2014-01-29 05:18:01 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|