Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2307113
PholioInlineController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PholioInlineController.php
View Options
<?php
/**
* @group pholio
*/
final
class
PholioInlineController
extends
PholioController
{
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
id
=
$data
[
'id'
];
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$inline_comments
=
id
(
new
PholioTransactionComment
())->
loadAllWhere
(
'imageid = %d AND transactionphid IS NOT NULL'
,
$this
->
id
);
$inline_comments
=
array_merge
(
$inline_comments
,
id
(
new
PholioTransactionComment
())->
loadAllWhere
(
'imageid = %d AND authorphid = %s AND transactionphid IS NULL'
,
$this
->
id
,
$user
->
getPHID
()));
$inlines
=
array
();
foreach
(
$inline_comments
as
$inline_comment
)
{
$author
=
id
(
new
PhabricatorUser
())->
loadOneWhere
(
'phid = %s'
,
$inline_comment
->
getAuthorPHID
());
$inlines
[]
=
array
(
'phid'
=>
$inline_comment
->
getPHID
(),
'userphid'
=>
$author
->
getPHID
(),
'username'
=>
$author
->
getUserName
(),
'canEdit'
=>
(
$inline_comment
->
getEditPolicy
(
PhabricatorPolicyCapability
::
CAN_EDIT
)
==
$user
->
getPHID
())
?
true
:
false
,
'transactionphid'
=>
$inline_comment
->
getTransactionPHID
(),
'imageID'
=>
$inline_comment
->
getImageID
(),
'x'
=>
$inline_comment
->
getX
(),
'y'
=>
$inline_comment
->
getY
(),
'width'
=>
$inline_comment
->
getWidth
(),
'height'
=>
$inline_comment
->
getHeight
(),
'content'
=>
$inline_comment
->
getContent
());
}
return
id
(
new
AphrontAjaxResponse
())->
setContent
(
$inlines
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Sep 16, 2:31 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
441510
Default Alt Text
PholioInlineController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment