Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F111844521
PholioInlineController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, May 5, 11:10
Size
1 KB
Mime Type
text/x-php
Expires
Wed, May 7, 11:10 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25978879
Attached To
rPH Phabricator
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
OR (authorphid = %s AND transactionphid IS NULL))'
,
$this
->
id
,
$user
->
getPHID
());
$author_phids
=
mpull
(
$inline_comments
,
'getAuthorPHID'
);
$authors
=
id
(
new
PhabricatorObjectHandleData
(
$author_phids
))
->
loadHandles
();
$inlines
=
array
();
foreach
(
$inline_comments
as
$inline_comment
)
{
$inline_view
=
id
(
new
PholioInlineCommentView
())
->
setHandle
(
$authors
[
$inline_comment
->
getAuthorPHID
()])
->
setInlineComment
(
$inline_comment
);
if
(
$inline_comment
->
getEditPolicy
(
PhabricatorPolicyCapability
::
CAN_EDIT
)
==
$user
->
getPHID
()
&&
$inline_comment
->
getTransactionPHID
()
===
null
)
{
$inline_view
->
setEditable
(
true
);
}
$inlines
[]
=
array
(
'id'
=>
$inline_comment
->
getID
(),
'phid'
=>
$inline_comment
->
getPHID
(),
'transactionphid'
=>
$inline_comment
->
getTransactionPHID
(),
'x'
=>
$inline_comment
->
getX
(),
'y'
=>
$inline_comment
->
getY
(),
'width'
=>
$inline_comment
->
getWidth
(),
'height'
=>
$inline_comment
->
getHeight
(),
'contentHTML'
=>
$inline_view
->
render
());
}
return
id
(
new
AphrontAjaxResponse
())->
setContent
(
$inlines
);
}
}
Event Timeline
Log In to Comment