1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-02 19:52:44 +01:00
phorge-phorge/src/applications/pholio/controller/PholioInlineDeleteController.php
Lauri-Henrik Jalonen b180c3a009 Show editor
Summary: Show editor when user clicks edit button for inline comment.

Test Plan: Verified that editor is shown.

Reviewers: epriestley

CC: aran, Korvin

Maniphest Tasks: T2446

Differential Revision: https://secure.phabricator.com/D5030
2013-02-22 06:45:51 -08:00

34 lines
717 B
PHP

<?php
/**
* @group pholio
*/
final class PholioInlineDeleteController 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())->loadOneWhere(
'id = %d AND authorphid = %s AND transactionphid IS NULL',
$this->id,
$user->getPHID());
if ($inline_comment == null) {
return new Aphront404Response();
} else {
$inline_comment->delete();
return id(new AphrontAjaxResponse())
->setContent(array('success' => true));
}
}
}