[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/feed/controller/ -> PhabricatorFeedDetailController.php (source)

   1  <?php
   2  
   3  final class PhabricatorFeedDetailController extends PhabricatorFeedController {
   4  
   5    private $id;
   6  
   7    public function willProcessRequest(array $data) {
   8      $this->id = $data['id'];
   9    }
  10  
  11    public function processRequest() {
  12      $request = $this->getRequest();
  13      $user = $request->getUser();
  14  
  15      $story = id(new PhabricatorFeedQuery())
  16        ->setViewer($user)
  17        ->withChronologicalKeys(array($this->id))
  18        ->executeOne();
  19      if (!$story) {
  20        return new Aphront404Response();
  21      }
  22  
  23      if ($request->getStr('text')) {
  24        $text = $story->renderText();
  25        return id(new AphrontPlainTextResponse())->setContent($text);
  26      }
  27  
  28      $feed = array($story);
  29      $builder = new PhabricatorFeedBuilder($feed);
  30      $builder->setUser($user);
  31      $feed_view = $builder->buildView();
  32  
  33      $title = pht('Story');
  34  
  35      $feed_view = phutil_tag_div('phabricator-feed-frame', $feed_view);
  36  
  37      $crumbs = $this->buildApplicationCrumbs();
  38      $crumbs->addTextCrumb($title);
  39  
  40      return $this->buildApplicationPage(
  41        array(
  42          $crumbs,
  43          $feed_view,
  44        ),
  45        array(
  46          'title' => $title,
  47        ));
  48    }
  49  
  50  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1