revision = $revision; return $this; } public function setActions(array $actions) { $this->actions = $actions; return $this; } public function setActionURI($uri) { $this->actionURI = $uri; } public function setUser(PhabricatorUser $user) { $this->user = $user; } public function render() { require_celerity_resource('differential-revision-add-comment-css'); $revision = $this->revision; $actions = array(); foreach ($this->actions as $action) { $actions[$action] = DifferentialAction::getActionVerb($action); } $form = new AphrontFormView(); $form ->setUser($this->user) ->setAction($this->actionURI) ->addHiddenInput('revision_id', $revision->getID()) ->appendChild( id(new AphrontFormSelectControl()) ->setLabel('Action') ->setName('action') ->setID('comment-action') ->setOptions($actions)) ->appendChild( id(new AphrontFormTextAreaControl()) ->setName('comment') ->setID('comment-content') ->setLabel('Comment')) ->appendChild( id(new AphrontFormSubmitControl()) ->setValue('Comment')); $rev_id = $revision->getID(); Javelin::initBehavior( 'differential-feedback-preview', array( 'uri' => '/differential/comment/preview/'.$rev_id.'/', 'preview' => 'comment-preview', 'action' => 'comment-action', 'content' => 'comment-content', 'inlineuri' => '/differential/comment/inline/preview/'.$rev_id.'/', 'inline' => 'inline-comment-preview', )); return '
Add Comment
'. $form->render(). '