2013-03-15 11:28:43 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
abstract class ReleephController extends PhabricatorController {
|
|
|
|
|
|
|
|
public function buildStandardPageResponse($view, array $data) {
|
|
|
|
$page = $this->buildStandardPageView();
|
|
|
|
|
2013-05-03 18:33:49 -07:00
|
|
|
$page->setApplicationName(pht('Releeph'));
|
2013-03-15 11:28:43 +00: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 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;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function buildApplicationMenu() {
|
|
|
|
return $this->buildSideNavView(true)->getMenu();
|
|
|
|
}
|
|
|
|
|
2013-03-15 11:28:43 +00:00
|
|
|
}
|