Remove product literal strings in "pht()", part 6
[phabricator.git] / src / applications / drydock / controller / DrydockAuthorizationListController.php
blob164ca8e5ccca43edcdaa1458a94fef2e3e3149ab
1 <?php
3 final class DrydockAuthorizationListController
4 extends DrydockController {
6 private $blueprint;
8 public function setBlueprint(DrydockBlueprint $blueprint) {
9 $this->blueprint = $blueprint;
10 return $this;
13 public function getBlueprint() {
14 return $this->blueprint;
17 public function shouldAllowPublic() {
18 return true;
21 public function handleRequest(AphrontRequest $request) {
22 $viewer = $this->getViewer();
24 $engine = new DrydockAuthorizationSearchEngine();
26 $id = $request->getURIData('id');
28 $blueprint = id(new DrydockBlueprintQuery())
29 ->setViewer($viewer)
30 ->withIDs(array($id))
31 ->executeOne();
32 if (!$blueprint) {
33 return new Aphront404Response();
36 $this->setBlueprint($blueprint);
37 $engine->setBlueprint($blueprint);
39 $querykey = $request->getURIData('queryKey');
41 $controller = id(new PhabricatorApplicationSearchController())
42 ->setQueryKey($querykey)
43 ->setSearchEngine($engine)
44 ->setNavigation($this->buildSideNavView());
46 return $this->delegateToController($controller);
49 public function buildSideNavView() {
50 $nav = new AphrontSideNavFilterView();
51 $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
53 $engine = id(new DrydockAuthorizationSearchEngine())
54 ->setViewer($this->getViewer());
56 $engine->setBlueprint($this->getBlueprint());
57 $engine->addNavigationItems($nav->getMenu());
59 $nav->selectFilter(null);
61 return $nav;
64 protected function buildApplicationCrumbs() {
65 $crumbs = parent::buildApplicationCrumbs();
67 $blueprint = $this->getBlueprint();
68 if ($blueprint) {
69 $id = $blueprint->getID();
71 $crumbs->addTextCrumb(
72 pht('Blueprints'),
73 $this->getApplicationURI('blueprint/'));
75 $crumbs->addTextCrumb(
76 $blueprint->getBlueprintName(),
77 $this->getApplicationURI("blueprint/{$id}/"));
79 $crumbs->addTextCrumb(
80 pht('Authorizations'),
81 $this->getApplicationURI("blueprint/{$id}/authorizations/"));
84 return $crumbs;