1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-16 03:42:41 +01:00
phorge-phorge/src/applications/feed/controller/PhabricatorFeedDetailController.php
epriestley 46d9bebc84 Remove all device = true from page construction
Summary: Fixes T5446. Depends on D9687.

Test Plan: Mostly regexp'd this. Lint doesn't complain.

Reviewers: chad

Reviewed By: chad

Subscribers: epriestley, hach-que

Maniphest Tasks: T5446

Differential Revision: https://secure.phabricator.com/D9690
2014-06-23 15:18:14 -07:00

50 lines
1.1 KiB
PHP

<?php
final class PhabricatorFeedDetailController extends PhabricatorFeedController {
private $id;
public function willProcessRequest(array $data) {
$this->id = $data['id'];
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$story = id(new PhabricatorFeedQuery())
->setViewer($user)
->withChronologicalKeys(array($this->id))
->executeOne();
if (!$story) {
return new Aphront404Response();
}
if ($request->getStr('text')) {
$text = $story->renderText();
return id(new AphrontPlainTextResponse())->setContent($text);
}
$feed = array($story);
$builder = new PhabricatorFeedBuilder($feed);
$builder->setUser($user);
$feed_view = $builder->buildView();
$title = pht('Story');
$feed_view = phutil_tag_div('phabricator-feed-frame', $feed_view);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($title);
return $this->buildApplicationPage(
array(
$crumbs,
$feed_view,
),
array(
'title' => $title,
));
}
}