Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F64118307
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
Fri, May 24, 17:26
Size
1 KB
Mime Type
text/x-php
Expires
Sun, May 26, 17:26 (2 d)
Engine
blob
Format
Raw Data
Handle
17858105
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