2011-07-05 17:35:18 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
abstract class PhabricatorFeedController extends PhabricatorController {
|
|
|
|
|
|
|
|
public function buildStandardPageResponse($view, array $data) {
|
|
|
|
$page = $this->buildStandardPageView();
|
|
|
|
|
2013-04-13 18:09:42 +02:00
|
|
|
$page->setApplicationName(pht('Feed'));
|
2011-07-05 17:35:18 +02:00
|
|
|
$page->setBaseURI('/feed/');
|
|
|
|
$page->setTitle(idx($data, 'title'));
|
|
|
|
$page->setGlyph("\xE2\x88\x9E");
|
|
|
|
$page->appendChild($view);
|
|
|
|
|
|
|
|
$response = new AphrontWebpageResponse();
|
2011-07-10 03:03:59 +02:00
|
|
|
|
|
|
|
if (!empty($data['public'])) {
|
|
|
|
$page->setFrameable(true);
|
|
|
|
$page->setShowChrome(false);
|
|
|
|
$response->setFrameable(true);
|
|
|
|
}
|
|
|
|
|
2011-07-05 17:35:18 +02:00
|
|
|
return $response->setContent($page->render());
|
|
|
|
}
|
|
|
|
|
2013-01-11 01:06:29 +01:00
|
|
|
protected function buildSideNavView() {
|
2013-08-05 23:10:41 +02:00
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
2013-01-11 01:06:29 +01:00
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
|
|
|
|
2013-08-05 23:10:41 +02:00
|
|
|
id(new PhabricatorFeedSearchEngine())
|
|
|
|
->setViewer($user)
|
|
|
|
->addNavigationItems($nav->getMenu());
|
|
|
|
|
|
|
|
$nav->selectFilter(null);
|
2013-01-11 01:06:29 +01:00
|
|
|
|
|
|
|
return $nav;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function buildApplicationMenu() {
|
|
|
|
return $this->buildSideNavView()->getMenu();
|
|
|
|
}
|
|
|
|
|
2011-07-05 17:35:18 +02:00
|
|
|
}
|