Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/view/PHUIDiffInlineCommentEditView.php
<?php | <?php | ||||
final class PHUIDiffInlineCommentEditView | final class PHUIDiffInlineCommentEditView | ||||
extends PHUIDiffInlineCommentView { | extends PHUIDiffInlineCommentView { | ||||
private $inputs = array(); | private $inputs = array(); | ||||
private $uri; | private $uri; | ||||
private $title; | private $title; | ||||
private $onRight; | private $onRight; | ||||
private $number; | private $number; | ||||
private $length; | private $length; | ||||
private $renderer; | private $renderer; | ||||
private $isNewFile; | private $isNewFile; | ||||
private $replyToCommentPHID; | |||||
private $changesetID; | |||||
public function setIsNewFile($is_new_file) { | public function setIsNewFile($is_new_file) { | ||||
$this->isNewFile = $is_new_file; | $this->isNewFile = $is_new_file; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getIsNewFile() { | public function getIsNewFile() { | ||||
return $this->isNewFile; | return $this->isNewFile; | ||||
Show All 22 Lines | public function setSubmitURI($uri) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setTitle($title) { | public function setTitle($title) { | ||||
$this->title = $title; | $this->title = $title; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setReplyToCommentPHID($reply_to_phid) { | |||||
$this->replyToCommentPHID = $reply_to_phid; | |||||
return $this; | |||||
} | |||||
public function getReplyToCommentPHID() { | |||||
return $this->replyToCommentPHID; | |||||
} | |||||
public function setChangesetID($changeset_id) { | |||||
$this->changesetID = $changeset_id; | |||||
return $this; | |||||
} | |||||
public function getChangesetID() { | |||||
return $this->changesetID; | |||||
} | |||||
public function setOnRight($on_right) { | public function setOnRight($on_right) { | ||||
$this->onRight = $on_right; | $this->onRight = $on_right; | ||||
$this->addHiddenInput('on_right', $on_right); | |||||
return $this; | return $this; | ||||
} | } | ||||
public function setNumber($number) { | public function setNumber($number) { | ||||
$this->number = $number; | $this->number = $number; | ||||
return $this; | return $this; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | if ($this->renderer == '1up') { | ||||
); | ); | ||||
} | } | ||||
$row = phutil_tag('tr', array('class' => 'inline-comment-splint'), $cells); | $row = phutil_tag('tr', array('class' => 'inline-comment-splint'), $cells); | ||||
return phutil_tag('table', array(), $row); | return phutil_tag('table', array(), $row); | ||||
} | } | ||||
private function renderInputs() { | private function renderInputs() { | ||||
$inputs = $this->inputs; | |||||
$out = array(); | $out = array(); | ||||
foreach ($this->inputs as $input) { | |||||
$inputs[] = array('on_right', (bool)$this->getIsOnRight()); | |||||
$inputs[] = array('replyToCommentPHID', $this->getReplyToCommentPHID()); | |||||
$inputs[] = array('renderer', $this->getRenderer()); | |||||
$inputs[] = array('changesetID', $this->getChangesetID()); | |||||
foreach ($inputs as $input) { | |||||
list($name, $value) = $input; | list($name, $value) = $input; | ||||
$out[] = phutil_tag( | $out[] = phutil_tag( | ||||
'input', | 'input', | ||||
array( | array( | ||||
'type' => 'hidden', | 'type' => 'hidden', | ||||
'name' => $name, | 'name' => $name, | ||||
'value' => $value, | 'value' => $value, | ||||
)); | )); | ||||
Show All 38 Lines | $edit = phutil_tag( | ||||
)); | )); | ||||
return javelin_tag( | return javelin_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'differential-inline-comment-edit', | 'class' => 'differential-inline-comment-edit', | ||||
'sigil' => 'differential-inline-comment', | 'sigil' => 'differential-inline-comment', | ||||
'meta' => array( | 'meta' => array( | ||||
'changesetID' => $this->getChangesetID(), | |||||
'on_right' => $this->getIsOnRight(), | 'on_right' => $this->getIsOnRight(), | ||||
'isNewFile' => (bool)$this->getIsNewFile(), | 'isNewFile' => (bool)$this->getIsNewFile(), | ||||
'number' => $this->number, | 'number' => $this->number, | ||||
'length' => $this->length, | 'length' => $this->length, | ||||
'replyToCommentPHID' => $this->getReplyToCommentPHID(), | |||||
), | ), | ||||
), | ), | ||||
array( | array( | ||||
$title, | $title, | ||||
$body, | $body, | ||||
$edit, | $edit, | ||||
)); | )); | ||||
} | } | ||||
} | } |