2013-03-15 11:28:43 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
abstract class ReleephController extends PhabricatorController {
|
|
|
|
|
2013-07-21 08:44:53 -07:00
|
|
|
public function buildSideNavView($for_app = false) {
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
|
|
|
|
|
|
|
if ($for_app) {
|
2014-03-29 09:16:24 -07:00
|
|
|
$nav->addFilter('project/create/', pht('Create Product'));
|
2013-07-21 08:44:53 -07:00
|
|
|
}
|
|
|
|
|
2014-03-29 09:16:24 -07:00
|
|
|
id(new ReleephProductSearchEngine())
|
2013-07-21 08:44:53 -07:00
|
|
|
->setViewer($user)
|
|
|
|
->addNavigationItems($nav->getMenu());
|
|
|
|
|
|
|
|
$nav->selectFilter(null);
|
|
|
|
|
|
|
|
return $nav;
|
|
|
|
}
|
|
|
|
|
2015-01-16 07:41:26 +11:00
|
|
|
public function buildApplicationMenu() {
|
2013-07-21 08:44:53 -07:00
|
|
|
return $this->buildSideNavView(true)->getMenu();
|
|
|
|
}
|
|
|
|
|
2014-04-12 16:53:51 -07:00
|
|
|
|
|
|
|
protected function getProductViewURI(ReleephProject $product) {
|
|
|
|
return $this->getApplicationURI('project/'.$product->getID().'/');
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getBranchViewURI(ReleephBranch $branch) {
|
|
|
|
return $this->getApplicationURI('branch/'.$branch->getID().'/');
|
|
|
|
}
|
|
|
|
|
2013-03-15 11:28:43 +00:00
|
|
|
}
|