Remove product literal strings in "pht()", part 6
[phabricator.git] / src / applications / drydock / controller / DrydockResourceController.php
blob120d6d7cb08477c6d4c1f0edfc67873622c00e48
1 <?php
3 abstract class DrydockResourceController
4 extends DrydockController {
6 private $blueprint;
8 public function setBlueprint($blueprint) {
9 $this->blueprint = $blueprint;
10 return $this;
13 public function getBlueprint() {
14 return $this->blueprint;
17 public function buildSideNavView() {
18 $nav = new AphrontSideNavFilterView();
19 $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
21 $engine = id(new DrydockResourceSearchEngine())
22 ->setViewer($this->getViewer());
24 if ($this->getBlueprint()) {
25 $engine->setBlueprint($this->getBlueprint());
28 $engine->addNavigationItems($nav->getMenu());
30 $nav->selectFilter(null);
32 return $nav;
35 protected function buildApplicationCrumbs() {
36 $crumbs = parent::buildApplicationCrumbs();
38 $blueprint = $this->getBlueprint();
39 if ($blueprint) {
40 $id = $blueprint->getID();
41 $crumbs->addTextCrumb(
42 pht('Blueprints'),
43 $this->getApplicationURI('blueprint/'));
45 $crumbs->addTextCrumb(
46 $blueprint->getBlueprintName(),
47 $this->getApplicationURI("blueprint/{$id}/"));
49 $crumbs->addTextCrumb(
50 pht('Resources'),
51 $this->getApplicationURI("blueprint/{$id}/resources/"));
52 } else {
53 $crumbs->addTextCrumb(
54 pht('Resources'),
55 $this->getApplicationURI('resource/'));
57 return $crumbs;