Changeset View
Changeset View
Standalone View
Standalone View
src/applications/ponder/view/PonderAddAnswerView.php
| Show All 11 Lines | final class PonderAddAnswerView extends AphrontView { | ||||
| } | } | ||||
| public function setActionURI($uri) { | public function setActionURI($uri) { | ||||
| $this->actionURI = $uri; | $this->actionURI = $uri; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function render() { | public function render() { | ||||
| $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); | |||||
| $question = $this->question; | $question = $this->question; | ||||
| $header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
| ->setHeader(pht('Add Answer')); | ->setHeader(pht('Add Answer')); | ||||
| $form = new AphrontFormView(); | $form = new AphrontFormView(); | ||||
| $form | $form | ||||
| ->setUser($this->user) | ->setUser($this->user) | ||||
| ->setAction($this->actionURI) | ->setAction($this->actionURI) | ||||
| ->setWorkflow(true) | ->setWorkflow(true) | ||||
| ->addHiddenInput('question_id', $question->getID()) | ->addHiddenInput('question_id', $question->getID()) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new PhabricatorRemarkupControl()) | id(new PhabricatorRemarkupControl()) | ||||
| ->setName('answer') | ->setName('answer') | ||||
| ->setLabel(pht('Answer')) | ->setLabel(pht('Answer')) | ||||
| ->setError(true) | ->setError(true) | ||||
| ->setID('answer-content') | ->setID('answer-content') | ||||
| ->setUser($this->user)) | ->setUser($this->user)) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
| ->setValue($is_serious ? | ->setValue(pht('Add Answer'))); | ||||
| pht('Add Answer') : | |||||
| pht('Bequeath Wisdom'))); | |||||
| return id(new PHUIObjectBoxView()) | return id(new PHUIObjectBoxView()) | ||||
| ->setHeader($header) | ->setHeader($header) | ||||
| ->appendChild($form); | ->appendChild($form); | ||||
| } | } | ||||
| } | } | ||||