1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 00:02:41 +01:00
phorge-phorge/src/applications/drydock/controller/DrydockBlueprintListController.php

41 lines
1.1 KiB
PHP
Raw Normal View History

<?php
final class DrydockBlueprintListController extends DrydockBlueprintController {
private $queryKey;
public function shouldAllowPublic() {
return true;
}
public function willProcessRequest(array $data) {
$this->queryKey = idx($data, 'queryKey');
}
public function processRequest() {
$request = $this->getRequest();
$controller = id(new PhabricatorApplicationSearchController($request))
->setQueryKey($this->queryKey)
->setSearchEngine(new DrydockBlueprintSearchEngine())
->setNavigation($this->buildSideNavView());
return $this->delegateToController($controller);
}
public function buildApplicationCrumbs() {
$can_create = $this->hasApplicationCapability(
DrydockCapabilityCreateBlueprints::CAPABILITY);
$crumbs = parent::buildApplicationCrumbs();
$crumbs->addAction(
id(new PHUIListItemView())
->setName(pht('New Blueprint'))
->setHref($this->getApplicationURI('/blueprint/create/'))
->setDisabled(!$can_create)
->setWorkflow(!$can_create)
->setIcon('create'));
return $crumbs;
}
}