mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-14 10:52:41 +01:00
42 lines
930 B
PHP
42 lines
930 B
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
* @group legalpad
|
||
|
*/
|
||
|
abstract class LegalpadController extends PhabricatorController {
|
||
|
|
||
|
public function buildSideNav($for_app = false) {
|
||
|
$user = $this->getRequest()->getUser();
|
||
|
|
||
|
$nav = new AphrontSideNavFilterView();
|
||
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
||
|
|
||
|
if ($for_app) {
|
||
|
$nav->addFilter('create/', pht('Create Document'));
|
||
|
}
|
||
|
|
||
|
id(new LegalpadDocumentSearchEngine())
|
||
|
->setViewer($user)
|
||
|
->addNavigationItems($nav->getMenu());
|
||
|
|
||
|
return $nav;
|
||
|
}
|
||
|
|
||
|
public function buildApplicationCrumbs() {
|
||
|
$crumbs = parent::buildApplicationCrumbs();
|
||
|
|
||
|
$crumbs->addAction(
|
||
|
id(new PHUIListItemView())
|
||
|
->setName(pht('Create Document'))
|
||
|
->setHref($this->getApplicationURI('create/'))
|
||
|
->setIcon('create'));
|
||
|
|
||
|
return $crumbs;
|
||
|
}
|
||
|
|
||
|
public function buildApplicationMenu() {
|
||
|
return $this->buildSideNav(true)->getMenu();
|
||
|
}
|
||
|
|
||
|
}
|