Changeset View
Changeset View
Standalone View
Standalone View
src/applications/ponder/view/PonderAnswerView.php
<?php | <?php | ||||
final class PonderAnswerView extends AphrontTagView { | final class PonderAnswerView extends AphrontTagView { | ||||
private $answer; | private $answer; | ||||
private $transactions; | private $transactions; | ||||
private $engine; | private $timeline; | ||||
private $handle; | private $handle; | ||||
public function setAnswer($answer) { | public function setAnswer($answer) { | ||||
$this->answer = $answer; | $this->answer = $answer; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setTransactions($transactions) { | public function setTransactions($transactions) { | ||||
$this->transactions = $transactions; | $this->transactions = $transactions; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setMarkupEngine(PhabricatorMarkupEngine $engine) { | public function setTimeline($timeline) { | ||||
$this->engine = $engine; | $this->timeline = $timeline; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setHandle($handle) { | public function setHandle($handle) { | ||||
$this->handle = $handle; | $this->handle = $handle; | ||||
return $this; | return $this; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | protected function getTagContent() { | ||||
$footer->addAction($helpful); | $footer->addAction($helpful); | ||||
$answer_view = id(new PHUIObjectBoxView()) | $answer_view = id(new PHUIObjectBoxView()) | ||||
->setHeader($header) | ->setHeader($header) | ||||
->appendChild($anchor) | ->appendChild($anchor) | ||||
->appendChild($content) | ->appendChild($content) | ||||
->appendChild($footer); | ->appendChild($footer); | ||||
$transaction_view = id(new PhabricatorApplicationTransactionView()) | |||||
->setUser($viewer) | |||||
->setObjectPHID($answer->getPHID()) | |||||
->setTransactions($this->transactions) | |||||
->setMarkupEngine($this->engine); | |||||
$comment_view = id(new PhabricatorApplicationTransactionCommentView()) | $comment_view = id(new PhabricatorApplicationTransactionCommentView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
->setObjectPHID($answer->getPHID()) | ->setObjectPHID($answer->getPHID()) | ||||
->setShowPreview(false) | ->setShowPreview(false) | ||||
->setHeaderText(pht('Answer Comment')) | ->setHeaderText(pht('Answer Comment')) | ||||
->setAction("/ponder/answer/comment/{$id}/") | ->setAction("/ponder/answer/comment/{$id}/") | ||||
->setSubmitButtonName(pht('Comment')); | ->setSubmitButtonName(pht('Comment')); | ||||
$hidden_view = phutil_tag( | $hidden_view = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'id' => $content_id, | 'id' => $content_id, | ||||
'style' => 'display: none;', | 'style' => 'display: none;', | ||||
), | ), | ||||
array( | array( | ||||
$transaction_view, | $this->timeline, | ||||
$comment_view, | $comment_view, | ||||
)); | )); | ||||
return array( | return array( | ||||
$answer_view, | $answer_view, | ||||
$hidden_view, | $hidden_view, | ||||
); | ); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |