2013-03-15 12:28:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
abstract class ReleephController extends PhabricatorController {
|
|
|
|
|
|
|
|
public function buildStandardPageResponse($view, array $data) {
|
|
|
|
$page = $this->buildStandardPageView();
|
|
|
|
|
2013-05-04 03:33:49 +02:00
|
|
|
$page->setApplicationName(pht('Releeph'));
|
2013-03-15 12:28:43 +01:00
|
|
|
$page->setBaseURI('/releeph/');
|
|
|
|
$page->setTitle(idx($data, 'title'));
|
|
|
|
$page->setGlyph("\xD3\x82");
|
|
|
|
$page->appendChild($view);
|
|
|
|
|
|
|
|
$response = new AphrontWebpageResponse();
|
|
|
|
return $response->setContent($page->render());
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|