Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90344391
PholioInlineListController.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
Thu, Oct 31, 18:18
Size
939 B
Mime Type
text/x-php
Expires
Sat, Nov 2, 18:18 (2 d)
Engine
blob
Format
Raw Data
Handle
22057975
Attached To
rPH Phabricator
PholioInlineListController.php
View Options
<?php
final
class
PholioInlineListController
extends
PholioController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
();
$id
=
$request
->
getURIData
(
'id'
);
$image
=
id
(
new
PholioImageQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$id
))
->
executeOne
();
if
(!
$image
)
{
return
new
Aphront404Response
();
}
$inline_comments
=
id
(
new
PholioTransactionComment
())->
loadAllWhere
(
'imageid = %d AND (transactionphid IS NOT NULL
OR (authorphid = %s AND transactionphid IS NULL))'
,
$id
,
$viewer
->
getPHID
());
$author_phids
=
mpull
(
$inline_comments
,
'getAuthorPHID'
);
$authors
=
$this
->
loadViewerHandles
(
$author_phids
);
$inlines
=
array
();
foreach
(
$inline_comments
as
$inline_comment
)
{
$inlines
[]
=
$inline_comment
->
toDictionary
();
}
return
id
(
new
AphrontAjaxResponse
())->
setContent
(
$inlines
);
}
}
Event Timeline
Log In to Comment