2013-11-20 18:13:35 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
abstract class PassphraseController extends PhabricatorController {
|
|
|
|
|
|
|
|
public function buildSideNavView($for_app = false) {
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
|
|
|
|
|
|
|
if ($for_app) {
|
|
|
|
$nav->addFilter('create', pht('Create Credential'));
|
|
|
|
}
|
|
|
|
|
|
|
|
id(new PassphraseCredentialSearchEngine())
|
|
|
|
->setViewer($user)
|
|
|
|
->addNavigationItems($nav->getMenu());
|
|
|
|
|
|
|
|
$nav->selectFilter(null);
|
|
|
|
|
|
|
|
return $nav;
|
|
|
|
}
|
|
|
|
|
2015-01-06 21:34:58 +01:00
|
|
|
protected function buildApplicationMenu() {
|
2013-11-20 18:13:35 +01:00
|
|
|
return $this->buildSideNavView(true)->getMenu();
|
|
|
|
}
|
|
|
|
|
2015-01-06 21:34:58 +01:00
|
|
|
protected function buildApplicationCrumbs() {
|
2013-11-20 18:13:35 +01:00
|
|
|
$crumbs = parent::buildApplicationCrumbs();
|
|
|
|
|
|
|
|
$crumbs->addAction(
|
|
|
|
id(new PHUIListItemView())
|
|
|
|
->setName(pht('Create Credential'))
|
|
|
|
->setHref($this->getApplicationURI('create/'))
|
2014-05-12 19:08:32 +02:00
|
|
|
->setIcon('fa-plus-square'));
|
2013-11-20 18:13:35 +01:00
|
|
|
|
|
|
|
return $crumbs;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|