Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/view/PHUIDiffInlineCommentEditView.php
| Show All 16 Lines | public function render() { | ||||
| $content = phabricator_form( | $content = phabricator_form( | ||||
| $viewer, | $viewer, | ||||
| array( | array( | ||||
| 'action' => $inline->getControllerURI(), | 'action' => $inline->getControllerURI(), | ||||
| 'method' => 'POST', | 'method' => 'POST', | ||||
| 'sigil' => 'inline-edit-form', | 'sigil' => 'inline-edit-form', | ||||
| ), | ), | ||||
| array( | array( | ||||
| $this->renderInputs(), | |||||
| $this->renderBody(), | $this->renderBody(), | ||||
| )); | )); | ||||
| return $content; | return $content; | ||||
| } | } | ||||
| private function renderInputs() { | |||||
| $inputs = array(); | |||||
| $inline = $this->getInlineComment(); | |||||
| $inputs[] = array('op', 'edit'); | |||||
| $inputs[] = array('id', $inline->getID()); | |||||
| $inputs[] = array('on_right', $this->getIsOnRight()); | |||||
| $inputs[] = array('renderer', $this->getRenderer()); | |||||
| $out = array(); | |||||
| foreach ($inputs as $input) { | |||||
| list($name, $value) = $input; | |||||
| $out[] = phutil_tag( | |||||
| 'input', | |||||
| array( | |||||
| 'type' => 'hidden', | |||||
| 'name' => $name, | |||||
| 'value' => $value, | |||||
| )); | |||||
| } | |||||
| return $out; | |||||
| } | |||||
| private function renderBody() { | private function renderBody() { | ||||
| $buttons = array(); | $buttons = array(); | ||||
| $buttons[] = id(new PHUIButtonView()) | $buttons[] = id(new PHUIButtonView()) | ||||
| ->setText(pht('Save Draft')); | ->setText(pht('Save Draft')); | ||||
| $buttons[] = id(new PHUIButtonView()) | $buttons[] = id(new PHUIButtonView()) | ||||
| ->setText(pht('Cancel')) | ->setText(pht('Cancel')) | ||||
| ▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines | |||||