Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/controller/ConpherenceViewController.php
| Show First 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | private function renderFormContent($latest_transaction_id) { | ||||
| $conpherence = $this->getConpherence(); | $conpherence = $this->getConpherence(); | ||||
| $user = $this->getRequest()->getUser(); | $user = $this->getRequest()->getUser(); | ||||
| $draft = PhabricatorDraft::newFromUserAndKey( | $draft = PhabricatorDraft::newFromUserAndKey( | ||||
| $user, | $user, | ||||
| $conpherence->getPHID()); | $conpherence->getPHID()); | ||||
| $update_uri = $this->getApplicationURI('update/'.$conpherence->getID().'/'); | $update_uri = $this->getApplicationURI('update/'.$conpherence->getID().'/'); | ||||
| $this->initBehavior('conpherence-pontificate'); | $this->initBehavior('conpherence-pontificate'); | ||||
| $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); | |||||
| $form = | $form = | ||||
| id(new AphrontFormView()) | id(new AphrontFormView()) | ||||
| ->setAction($update_uri) | ->setAction($update_uri) | ||||
| ->addSigil('conpherence-pontificate') | ->addSigil('conpherence-pontificate') | ||||
| ->setWorkflow(true) | ->setWorkflow(true) | ||||
| ->setUser($user) | ->setUser($user) | ||||
| ->addHiddenInput('action', 'message') | ->addHiddenInput('action', 'message') | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new PhabricatorRemarkupControl()) | id(new PhabricatorRemarkupControl()) | ||||
| ->setUser($user) | ->setUser($user) | ||||
| ->setName('text') | ->setName('text') | ||||
| ->setValue($draft->getDraft())) | ->setValue($draft->getDraft())) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
| ->setValue( | ->setValue(pht('Send Message'))) | ||||
| $is_serious | |||||
| ? pht('Send') | |||||
| : pht('Pontificate'))) | |||||
| ->appendChild( | ->appendChild( | ||||
| javelin_tag( | javelin_tag( | ||||
| 'input', | 'input', | ||||
| array( | array( | ||||
| 'type' => 'hidden', | 'type' => 'hidden', | ||||
| 'name' => 'latest_transaction_id', | 'name' => 'latest_transaction_id', | ||||
| 'value' => $latest_transaction_id, | 'value' => $latest_transaction_id, | ||||
| 'sigil' => 'latest-transaction-id' | 'sigil' => 'latest-transaction-id' | ||||
| ), | ), | ||||
| '')) | '')) | ||||
| ->render(); | ->render(); | ||||
| return $form; | return $form; | ||||
| } | } | ||||
| } | } | ||||