Differential D21548 Diff 51311 src/applications/transactions/view/PhabricatorApplicationTransactionView.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/view/PhabricatorApplicationTransactionView.php
<?php | <?php | ||||
/** | /** | ||||
* @concrete-extensible | * @concrete-extensible | ||||
*/ | */ | ||||
class PhabricatorApplicationTransactionView extends AphrontView { | class PhabricatorApplicationTransactionView extends AphrontView { | ||||
private $transactions; | private $transactions; | ||||
private $engine; | private $engine; | ||||
private $showEditActions = true; | private $showEditActions = true; | ||||
private $isPreview; | private $isPreview; | ||||
private $object; | |||||
private $objectPHID; | private $objectPHID; | ||||
private $shouldTerminate = false; | private $shouldTerminate = false; | ||||
private $quoteTargetID; | private $quoteTargetID; | ||||
private $quoteRef; | private $quoteRef; | ||||
private $pager; | private $pager; | ||||
private $renderAsFeed; | private $renderAsFeed; | ||||
private $hideCommentOptions = false; | private $hideCommentOptions = false; | ||||
private $viewData = array(); | private $viewData = array(); | ||||
Show All 16 Lines | public function setQuoteTargetID($quote_target_id) { | ||||
$this->quoteTargetID = $quote_target_id; | $this->quoteTargetID = $quote_target_id; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getQuoteTargetID() { | public function getQuoteTargetID() { | ||||
return $this->quoteTargetID; | return $this->quoteTargetID; | ||||
} | } | ||||
public function setObject( | |||||
PhabricatorApplicationTransactionInterface $object) { | |||||
$this->object = $object; | |||||
return $this; | |||||
} | |||||
private function getObject() { | |||||
return $this->object; | |||||
} | |||||
public function setObjectPHID($object_phid) { | public function setObjectPHID($object_phid) { | ||||
$this->objectPHID = $object_phid; | $this->objectPHID = $object_phid; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getObjectPHID() { | public function getObjectPHID() { | ||||
return $this->objectPHID; | return $this->objectPHID; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | class PhabricatorApplicationTransactionView extends AphrontView { | ||||
} | } | ||||
protected function getOrBuildEngine() { | protected function getOrBuildEngine() { | ||||
if (!$this->engine) { | if (!$this->engine) { | ||||
$field = PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT; | $field = PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT; | ||||
$engine = id(new PhabricatorMarkupEngine()) | $engine = id(new PhabricatorMarkupEngine()) | ||||
->setViewer($this->getViewer()); | ->setViewer($this->getViewer()); | ||||
$object = $this->getObject(); | |||||
if ($object) { | |||||
$engine->setContextObject($object); | |||||
} | |||||
foreach ($this->transactions as $xaction) { | foreach ($this->transactions as $xaction) { | ||||
if (!$xaction->hasComment()) { | if (!$xaction->hasComment()) { | ||||
continue; | continue; | ||||
} | } | ||||
$engine->addObject($xaction->getComment(), $field); | $engine->addObject($xaction->getComment(), $field); | ||||
} | } | ||||
$engine->process(); | $engine->process(); | ||||
▲ Show 20 Lines • Show All 300 Lines • Show Last 20 Lines |