Differential D14664 Diff 35487 src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
| Show First 20 Lines • Show All 221 Lines • ▼ Show 20 Lines | if ($edit_types) { | ||||
| $options = array(); | $options = array(); | ||||
| $options['+'] = pht('Add Action...'); | $options['+'] = pht('Add Action...'); | ||||
| foreach ($action_map as $key => $item) { | foreach ($action_map as $key => $item) { | ||||
| $options[$key] = $item['label']; | $options[$key] = $item['label']; | ||||
| } | } | ||||
| $action_id = celerity_generate_unique_node_id(); | $action_id = celerity_generate_unique_node_id(); | ||||
| $input_id = celerity_generate_unique_node_id(); | $input_id = celerity_generate_unique_node_id(); | ||||
| $place_id = celerity_generate_unique_node_id(); | |||||
| $form->appendChild( | $form->appendChild( | ||||
| phutil_tag( | phutil_tag( | ||||
| 'input', | 'input', | ||||
| array( | array( | ||||
| 'type' => 'hidden', | 'type' => 'hidden', | ||||
| 'name' => 'editengine.actions', | 'name' => 'editengine.actions', | ||||
| 'id' => $input_id, | 'id' => $input_id, | ||||
| ))); | ))); | ||||
| $form->appendChild( | $form->appendChild( | ||||
| id(new AphrontFormSelectControl()) | id(new AphrontFormSelectControl()) | ||||
| ->setLabel(pht('Actions')) | ->setLabel(pht('Actions')) | ||||
| ->setID($action_id) | ->setID($action_id) | ||||
| ->setOptions($options)); | ->setOptions($options)); | ||||
| // This is an empty placeholder node so we know where to insert the | |||||
| // new actions. | |||||
| $form->appendChild( | |||||
| phutil_tag( | |||||
| 'div', | |||||
| array( | |||||
| 'id' => $place_id, | |||||
| ))); | |||||
| Javelin::initBehavior( | Javelin::initBehavior( | ||||
| 'comment-actions', | 'comment-actions', | ||||
| array( | array( | ||||
| 'actionID' => $action_id, | 'actionID' => $action_id, | ||||
| 'inputID' => $input_id, | 'inputID' => $input_id, | ||||
| 'formID' => $this->getFormID(), | 'formID' => $this->getFormID(), | ||||
| 'placeID' => $place_id, | |||||
| 'actions' => $action_map, | 'actions' => $action_map, | ||||
| )); | )); | ||||
| } | } | ||||
| $form | $form | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new PhabricatorRemarkupControl()) | id(new PhabricatorRemarkupControl()) | ||||
| ->setID($this->getCommentID()) | ->setID($this->getCommentID()) | ||||
| ▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines | |||||