comment = $comment; return $this; } public function setHandles(array $handles) { $this->handles = $handles; return $this; } public function setMarkupEngine($markup_engine) { $this->markupEngine = $markup_engine; return $this; } public function render() { require_celerity_resource('phabricator-remarkup-css'); require_celerity_resource('differential-revision-comment-css'); $comment = $this->comment; $action = $comment->getAction(); $action_class = 'differential-comment-action-'.phutil_escape_html($action); $date = date('F jS, Y g:i:s A', $comment->getDateCreated()); $author = $comment->getAuthorPHID(); $author = $this->handles[$author]->renderLink(); $verb = DifferentialAction::getActionPastTenseVerb($comment->getAction()); $verb = phutil_escape_html($verb); $content = $comment->getContent(); if (strlen(rtrim($content))) { $title = "{$author} {$verb} this revision:"; $content = '
'. $this->markupEngine->markupText($content). '
'; } else { $title = null; $content = '
'. "

{$author} {$verb} this revision.

". '
'; } return '
'. '
'. '
'.$date.'
'. '
'.$title.'
'. '
'. '
'. '
'. '
'. $content. '
'. '
'. '
'. '
'; } }