inlineComment = $comment;
return $this;
}
public function setOnRight($on_right) {
$this->onRight = $on_right;
return $this;
}
public function setBuildScaffolding($scaffold) {
$this->buildScaffolding = $scaffold;
return $this;
}
public function setHandles(array $handles) {
$this->handles = $handles;
return $this;
}
public function setMarkupEngine(PhutilMarkupEngine $engine) {
$this->markupEngine = $engine;
return $this;
}
public function render() {
$inline = $this->inlineComment;
$start = $inline->getLineNumber();
$length = $inline->getLineLength();
if ($length) {
$end = $start + $length;
$line = 'Lines '.number_format($start).'-'.number_format($end);
} else {
$line = 'Line '.number_format($start);
}
$metadata = array(
'number' => $inline->getLineNumber(),
'length' => $inline->getLineLength(),
'on_right' => $this->onRight, // TODO
);
$sigil = 'differential-inline-comment';
$links = 'xxx';
$content = $inline->getContent();
$handles = $this->handles;
if ($links) {
$links =
'';
}
$content = $this->markupEngine->markupText($content);
$markup = javelin_render_tag(
'div',
array(
'class' => 'differential-inline-comment',
'sigil' => $sigil,
'meta' => $metadata,
),
'
'.
$content);
return $this->scaffoldMarkup($markup);
}
private function scaffoldMarkup($markup) {
if (!$this->buildScaffolding) {
return $markup;
}
if ($this->onRight) {
return
''.
''.
' | '.
' | '.
' | '.
''.$markup.' | '.
'
'.
'
';
} else {
return
''.
''.
' | '.
''.$markup.' | '.
' | '.
' | '.
'
'.
'
';
}
}
}