2013-07-13 02:04:02 +02:00
|
|
|
<?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();
|
|
|
|
}
|
|
|
|
|
2014-04-18 00:57:18 +02:00
|
|
|
if ($request->getStr('text')) {
|
|
|
|
$text = $story->renderText();
|
|
|
|
return id(new AphrontPlainTextResponse())->setContent($text);
|
|
|
|
}
|
|
|
|
|
2013-07-13 02:04:02 +02:00
|
|
|
$feed = array($story);
|
|
|
|
$builder = new PhabricatorFeedBuilder($feed);
|
|
|
|
$builder->setUser($user);
|
|
|
|
$feed_view = $builder->buildView();
|
|
|
|
|
|
|
|
$title = pht('Story');
|
|
|
|
|
2013-11-11 18:23:23 +01:00
|
|
|
$feed_view = phutil_tag_div('phabricator-feed-frame', $feed_view);
|
2013-07-13 02:04:02 +02:00
|
|
|
|
|
|
|
$crumbs = $this->buildApplicationCrumbs();
|
2013-12-19 02:47:34 +01:00
|
|
|
$crumbs->addTextCrumb($title);
|
2013-07-13 02:04:02 +02:00
|
|
|
|
|
|
|
return $this->buildApplicationPage(
|
|
|
|
array(
|
|
|
|
$crumbs,
|
|
|
|
$feed_view,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => $title,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|