Page MenuHomec4science

PholioInlineViewController.php
No OneTemporary

File Metadata

Created
Mon, Dec 23, 01:59

PholioInlineViewController.php

<?php
/**
* @group pholio
*/
final class PholioInlineViewController extends PholioController {
private $id;
public function willProcessRequest(array $data) {
$this->id = $data['id'];
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$inline_comment = id(new PholioTransactionComment())->load($this->id);
$handle = PhabricatorObjectHandleData::loadOneHandle(
$inline_comment->getAuthorPHID(),
$user);
$inline_view = id(new PholioInlineCommentView())
->setHandle($handle)
->setInlineComment($inline_comment);
if ($inline_comment->getEditPolicy(PhabricatorPolicyCapability::CAN_EDIT)
== $user->getPHID() && $inline_comment->getTransactionPHID() === null) {
$inline_view->setEditable(true);
}
return id(new AphrontAjaxResponse())->setContent(
$inline_comment->toDictionary() + array(
'contentHTML' => $inline_view->render(),
));
}
}

Event Timeline