mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-28 01:32:42 +01:00
e7f8e79742
Summary: Ref T6822. Test Plan: Visual inspection. These methods are only called from within `PhabricatorController` subclasses. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6822 Differential Revision: https://secure.phabricator.com/D11241
52 lines
1.3 KiB
PHP
52 lines
1.3 KiB
PHP
<?php
|
|
|
|
final class AlmanacServiceListController
|
|
extends AlmanacServiceController {
|
|
|
|
public function shouldAllowPublic() {
|
|
return true;
|
|
}
|
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
$controller = id(new PhabricatorApplicationSearchController())
|
|
->setQueryKey($request->getURIData('queryKey'))
|
|
->setSearchEngine(new AlmanacServiceSearchEngine())
|
|
->setNavigation($this->buildSideNavView());
|
|
|
|
return $this->delegateToController($controller);
|
|
}
|
|
|
|
protected function buildApplicationCrumbs() {
|
|
$crumbs = parent::buildApplicationCrumbs();
|
|
|
|
$can_create = $this->hasApplicationCapability(
|
|
AlmanacCreateServicesCapability::CAPABILITY);
|
|
|
|
$crumbs->addAction(
|
|
id(new PHUIListItemView())
|
|
->setName(pht('Create Service'))
|
|
->setHref($this->getApplicationURI('service/edit/'))
|
|
->setIcon('fa-plus-square')
|
|
->setDisabled(!$can_create)
|
|
->setWorkflow(!$can_create));
|
|
|
|
return $crumbs;
|
|
}
|
|
|
|
public function buildSideNavView() {
|
|
$viewer = $this->getViewer();
|
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
|
|
|
id(new AlmanacServiceSearchEngine())
|
|
->setViewer($viewer)
|
|
->addNavigationItems($nav->getMenu());
|
|
|
|
$nav->selectFilter(null);
|
|
|
|
return $nav;
|
|
}
|
|
|
|
|
|
}
|