mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-16 11:52:40 +01:00
e7f8e79742
Summary: Ref T6822. Test Plan: Visual inspection. These methods are only called from within `PhabricatorController` subclasses. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6822 Differential Revision: https://secure.phabricator.com/D11241
50 lines
1.3 KiB
PHP
50 lines
1.3 KiB
PHP
<?php
|
|
|
|
abstract class ReleephController extends PhabricatorController {
|
|
|
|
public function buildStandardPageResponse($view, array $data) {
|
|
$page = $this->buildStandardPageView();
|
|
|
|
$page->setApplicationName(pht('Releeph'));
|
|
$page->setBaseURI('/releeph/');
|
|
$page->setTitle(idx($data, 'title'));
|
|
$page->setGlyph("\xD3\x82");
|
|
$page->appendChild($view);
|
|
|
|
$response = new AphrontWebpageResponse();
|
|
return $response->setContent($page->render());
|
|
}
|
|
|
|
public function buildSideNavView($for_app = false) {
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
|
|
|
if ($for_app) {
|
|
$nav->addFilter('project/create/', pht('Create Product'));
|
|
}
|
|
|
|
id(new ReleephProductSearchEngine())
|
|
->setViewer($user)
|
|
->addNavigationItems($nav->getMenu());
|
|
|
|
$nav->selectFilter(null);
|
|
|
|
return $nav;
|
|
}
|
|
|
|
protected function buildApplicationMenu() {
|
|
return $this->buildSideNavView(true)->getMenu();
|
|
}
|
|
|
|
|
|
protected function getProductViewURI(ReleephProject $product) {
|
|
return $this->getApplicationURI('project/'.$product->getID().'/');
|
|
}
|
|
|
|
protected function getBranchViewURI(ReleephBranch $branch) {
|
|
return $this->getApplicationURI('branch/'.$branch->getID().'/');
|
|
}
|
|
|
|
}
|