2013-03-15 12:28:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
abstract class ReleephController extends PhabricatorController {
|
|
|
|
|
2013-07-21 17:44:53 +02: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 17:16:24 +01:00
|
|
|
$nav->addFilter('project/create/', pht('Create Product'));
|
2013-07-21 17:44:53 +02:00
|
|
|
}
|
|
|
|
|
2014-03-29 17:16:24 +01:00
|
|
|
id(new ReleephProductSearchEngine())
|
2013-07-21 17:44:53 +02:00
|
|
|
->setViewer($user)
|
|
|
|
->addNavigationItems($nav->getMenu());
|
|
|
|
|
|
|
|
$nav->selectFilter(null);
|
|
|
|
|
|
|
|
return $nav;
|
|
|
|
}
|
|
|
|
|
2015-01-15 21:41:26 +01:00
|
|
|
public function buildApplicationMenu() {
|
2013-07-21 17:44:53 +02:00
|
|
|
return $this->buildSideNavView(true)->getMenu();
|
|
|
|
}
|
|
|
|
|
2014-04-13 01:53:51 +02: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 12:28:43 +01:00
|
|
|
}
|