Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F104502486
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
Sun, Mar 9, 23:48
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Mar 11, 23:48 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24799176
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
=
$this
->
loadViewerHandles
(
$author_phids
);
$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
[]
=
$inline_comment
->
toDictionary
()
+
array
(
'contentHTML'
=>
$inline_view
->
render
(),
);
}
return
id
(
new
AphrontAjaxResponse
())->
setContent
(
$inlines
);
}
}
Event Timeline
Log In to Comment