[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class PonderAnswerHistoryController extends PonderController { 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 $viewer = $request->getUser(); 14 15 $answer = id(new PonderAnswerQuery()) 16 ->setViewer($viewer) 17 ->withIDs(array($this->id)) 18 ->executeOne(); 19 if (!$answer) { 20 return new Aphront404Response(); 21 } 22 23 $xactions = id(new PonderAnswerTransactionQuery()) 24 ->setViewer($viewer) 25 ->withObjectPHIDs(array($answer->getPHID())) 26 ->execute(); 27 28 $engine = id(new PhabricatorMarkupEngine()) 29 ->setViewer($viewer); 30 foreach ($xactions as $xaction) { 31 if ($xaction->getComment()) { 32 $engine->addObject( 33 $xaction->getComment(), 34 PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT); 35 } 36 } 37 $engine->process(); 38 39 $timeline = id(new PhabricatorApplicationTransactionView()) 40 ->setUser($viewer) 41 ->setObjectPHID($answer->getPHID()) 42 ->setTransactions($xactions) 43 ->setMarkupEngine($engine); 44 45 $qid = $answer->getQuestion()->getID(); 46 $aid = $answer->getID(); 47 48 $crumbs = $this->buildApplicationCrumbs(); 49 $crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}"); 50 $crumbs->addTextCrumb("A{$aid}", "/Q{$qid}#{$aid}"); 51 $crumbs->addTextCrumb(pht('History')); 52 53 return $this->buildApplicationPage( 54 array( 55 $crumbs, 56 $timeline, 57 ), 58 array( 59 'title' => pht('Answer History'), 60 )); 61 } 62 63 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |