2011-07-05 17:35:18 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
abstract class PhabricatorFeedController extends PhabricatorController {
|
|
|
|
|
|
|
|
public function buildStandardPageResponse($view, array $data) {
|
|
|
|
$page = $this->buildStandardPageView();
|
|
|
|
|
|
|
|
$page->setApplicationName('Feed');
|
|
|
|
$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() {
|
|
|
|
$nav = new AphrontSideNavFilterView();
|
|
|
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
|
|
|
|
|
|
|
$nav->addLabel('Feed');
|
|
|
|
$nav->addFilter('all', 'All Activity');
|
|
|
|
$nav->addFilter('projects', 'My Projects');
|
|
|
|
|
|
|
|
return $nav;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function buildApplicationMenu() {
|
|
|
|
return $this->buildSideNavView()->getMenu();
|
|
|
|
}
|
|
|
|
|
2011-07-05 17:35:18 +02:00
|
|
|
}
|