@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3abstract class PassphraseController extends PhabricatorController {
4
5 public function buildSideNavView($for_app = false) {
6 $user = $this->getRequest()->getUser();
7
8 $nav = new AphrontSideNavFilterView();
9 $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
10
11 if ($for_app) {
12 $nav->addFilter('create', pht('Create Credential'));
13 }
14
15 id(new PassphraseCredentialSearchEngine())
16 ->setViewer($user)
17 ->addNavigationItems($nav->getMenu());
18
19 $nav->selectFilter(null);
20
21 return $nav;
22 }
23
24 public function buildApplicationMenu() {
25 return $this->buildSideNavView(true)->getMenu();
26 }
27
28 protected function buildApplicationCrumbs() {
29 $crumbs = parent::buildApplicationCrumbs();
30
31 $crumbs->addAction(
32 id(new PHUIListItemView())
33 ->setName(pht('Create Credential'))
34 ->setHref($this->getApplicationURI('create/'))
35 ->setIcon('fa-plus-square'));
36
37 return $crumbs;
38 }
39
40}