public function reduceProxyResponse() { if ($this->transactionView) { $view = $this->transactionView; } else { if ($this->getTransactions()) { $view = head($this->getTransactions())->getApplicationTransactionViewObject(); } else { $view = new PhabricatorApplicationTransactionView(); } } $view->setUser($this->getViewer())->setTransactions($this->getTransactions())->setIsPreview($this->isPreview); if ($this->isPreview) { $xactions = mpull($view->buildEvents(), 'render'); } else { $xactions = mpull($view->buildEvents(), 'render', 'getTransactionPHID'); } // Force whatever the underlying views built to render into HTML for // the Javascript. foreach ($xactions as $key => $xaction) { $xactions[$key] = hsprintf('%s', $xaction); } $content = array('xactions' => $xactions, 'spacer' => PHUITimelineView::renderSpacer()); return $this->getProxy()->setContent($content); }
public function reduceProxyResponse() { if ($this->transactionView) { $view = $this->transactionView; } else { if ($this->getTransactions()) { $view = head($this->getTransactions())->getApplicationTransactionViewObject(); } else { $view = new PhabricatorApplicationTransactionView(); } } $view->setUser($this->getViewer())->setTransactions($this->getTransactions())->setIsPreview($this->isPreview); if ($this->isPreview) { $xactions = mpull($view->buildEvents(), 'render'); } else { $xactions = mpull($view->buildEvents(), 'render', 'getTransactionPHID'); } $content = array('xactions' => $xactions, 'spacer' => PHUITimelineView::renderSpacer()); return $this->getProxy()->setContent($content); }
public function buildPHUITimelineView($with_hiding = true) { if (!$this->getObjectPHID()) { throw new PhutilInvalidStateException('setObjectPHID'); } $view = new PHUITimelineView(); $view->setShouldTerminate($this->shouldTerminate); $view->setQuoteTargetID($this->getQuoteTargetID()); $view->setQuoteRef($this->getQuoteRef()); $events = $this->buildEvents($with_hiding); foreach ($events as $event) { $view->addEvent($event); } if ($this->getPager()) { $view->setPager($this->getPager()); } if ($this->getRenderData()) { $view->setRenderData($this->getRenderData()); } return $view; }
public function render() { if (!$this->getObjectPHID()) { throw new Exception('Call setObjectPHID() before render()!'); } $view = new PHUITimelineView(); $view->setShouldTerminate($this->shouldTerminate); $events = $this->buildEvents($with_hiding = true); foreach ($events as $event) { $view->addEvent($event); } if ($this->getShowEditActions()) { Javelin::initBehavior('phabricator-transaction-list'); } return $view->render(); }