Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/view/ConpherenceDurableColumnView.php
| <?php | <?php | ||||
| final class ConpherenceDurableColumnView extends AphrontTagView { | final class ConpherenceDurableColumnView extends AphrontTagView { | ||||
| private $conpherences; | private $conpherences = array(); | ||||
| private $draft; | |||||
| private $selectedConpherence; | private $selectedConpherence; | ||||
| private $transactions; | private $transactions; | ||||
| private $visible; | private $visible; | ||||
| public function setConpherences(array $conpherences) { | public function setConpherences(array $conpherences) { | ||||
| assert_instances_of($conpherences, 'ConpherenceThread'); | assert_instances_of($conpherences, 'ConpherenceThread'); | ||||
| $this->conpherences = $conpherences; | $this->conpherences = $conpherences; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getConpherences() { | public function getConpherences() { | ||||
| return $this->conpherences; | return $this->conpherences; | ||||
| } | } | ||||
| public function setDraft(PhabricatorDraft $draft) { | |||||
| $this->draft = $draft; | |||||
| return $this; | |||||
| } | |||||
| public function getDraft() { | |||||
| return $this->draft; | |||||
| } | |||||
| public function setSelectedConpherence( | public function setSelectedConpherence( | ||||
| ConpherenceThread $conpherence = null) { | ConpherenceThread $conpherence = null) { | ||||
| $this->selectedConpherence = $conpherence; | $this->selectedConpherence = $conpherence; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getSelectedConpherence() { | public function getSelectedConpherence() { | ||||
| return $this->selectedConpherence; | return $this->selectedConpherence; | ||||
| ▲ Show 20 Lines • Show All 310 Lines • ▼ Show 20 Lines | final class ConpherenceDurableColumnView extends AphrontTagView { | ||||
| } | } | ||||
| private function buildTextInput() { | private function buildTextInput() { | ||||
| $conpherence = $this->getSelectedConpherence(); | $conpherence = $this->getSelectedConpherence(); | ||||
| if (!$conpherence) { | if (!$conpherence) { | ||||
| return null; | return null; | ||||
| } | } | ||||
| $draft = $this->getDraft(); | |||||
| $draft_value = null; | |||||
| if ($draft) { | |||||
| $draft_value = $draft->getDraft(); | |||||
| } | |||||
| $textarea = javelin_tag( | $textarea = javelin_tag( | ||||
| 'textarea', | 'textarea', | ||||
| array( | array( | ||||
| 'name' => 'text', | 'name' => 'text', | ||||
| 'class' => 'conpherence-durable-column-textarea', | 'class' => 'conpherence-durable-column-textarea', | ||||
| 'sigil' => 'conpherence-durable-column-textarea', | 'sigil' => 'conpherence-durable-column-textarea', | ||||
| 'placeholder' => pht('Send a message...'), | 'placeholder' => pht('Send a message...'), | ||||
| )); | ), | ||||
| $draft_value); | |||||
| $id = $conpherence->getID(); | $id = $conpherence->getID(); | ||||
| return phabricator_form( | return phabricator_form( | ||||
| $this->getUser(), | $this->getUser(), | ||||
| array( | array( | ||||
| 'method' => 'POST', | 'method' => 'POST', | ||||
| 'action' => '/conpherence/update/'.$id.'/', | 'action' => '/conpherence/update/'.$id.'/', | ||||
| 'sigil' => 'conpherence-message-form', | 'sigil' => 'conpherence-message-form', | ||||
| ), | ), | ||||
| Show All 31 Lines | |||||