2013-12-03 01:09:07 +01:00
|
|
|
<?php
|
|
|
|
|
2014-05-08 19:08:37 +02:00
|
|
|
final class DrydockBlueprintListController extends DrydockBlueprintController {
|
2013-12-03 01:09:07 +01:00
|
|
|
|
2013-12-26 21:30:04 +01:00
|
|
|
private $queryKey;
|
2013-12-03 01:09:07 +01:00
|
|
|
|
2013-12-26 21:30:04 +01:00
|
|
|
public function shouldAllowPublic() {
|
|
|
|
return true;
|
|
|
|
}
|
2013-12-03 01:09:07 +01:00
|
|
|
|
2013-12-26 21:30:04 +01:00
|
|
|
public function willProcessRequest(array $data) {
|
|
|
|
$this->queryKey = idx($data, 'queryKey');
|
|
|
|
}
|
2013-12-03 01:09:07 +01:00
|
|
|
|
2013-12-26 21:30:04 +01:00
|
|
|
public function processRequest() {
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$controller = id(new PhabricatorApplicationSearchController($request))
|
|
|
|
->setQueryKey($this->queryKey)
|
|
|
|
->setSearchEngine(new DrydockBlueprintSearchEngine())
|
2013-12-26 21:30:36 +01:00
|
|
|
->setNavigation($this->buildSideNavView());
|
2013-12-03 01:09:07 +01:00
|
|
|
|
2013-12-26 21:30:04 +01:00
|
|
|
return $this->delegateToController($controller);
|
2013-12-03 01:09:07 +01:00
|
|
|
}
|
|
|
|
|
2013-12-27 22:15:12 +01:00
|
|
|
public function buildApplicationCrumbs() {
|
2014-01-09 21:19:45 +01:00
|
|
|
$can_create = $this->hasApplicationCapability(
|
|
|
|
DrydockCapabilityCreateBlueprints::CAPABILITY);
|
|
|
|
|
2013-12-27 22:15:12 +01:00
|
|
|
$crumbs = parent::buildApplicationCrumbs();
|
|
|
|
$crumbs->addAction(
|
|
|
|
id(new PHUIListItemView())
|
|
|
|
->setName(pht('New Blueprint'))
|
|
|
|
->setHref($this->getApplicationURI('/blueprint/create/'))
|
2014-01-09 21:19:45 +01:00
|
|
|
->setDisabled(!$can_create)
|
|
|
|
->setWorkflow(!$can_create)
|
2013-12-27 22:15:12 +01:00
|
|
|
->setIcon('create'));
|
|
|
|
return $crumbs;
|
|
|
|
}
|
|
|
|
|
2013-12-03 01:09:07 +01:00
|
|
|
}
|