Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82605399
PhabricatorInlineCommentPreviewController.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, Sep 12, 09:28
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Sep 14, 09:28 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20717504
Attached To
rPH Phabricator
PhabricatorInlineCommentPreviewController.php
View Options
<?php
abstract
class
PhabricatorInlineCommentPreviewController
extends
PhabricatorController
{
abstract
protected
function
loadInlineComments
();
abstract
protected
function
loadObjectOwnerPHID
();
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$viewer
=
$request
->
getUser
();
$inlines
=
$this
->
loadInlineComments
();
assert_instances_of
(
$inlines
,
'PhabricatorInlineCommentInterface'
);
$engine
=
new
PhabricatorMarkupEngine
();
$engine
->
setViewer
(
$viewer
);
foreach
(
$inlines
as
$inline
)
{
$engine
->
addObject
(
$inline
,
PhabricatorInlineCommentInterface
::
MARKUP_FIELD_BODY
);
}
$engine
->
process
();
$phids
=
array
(
$viewer
->
getPHID
());
$handles
=
$this
->
loadViewerHandles
(
$phids
);
$object_owner_phid
=
$this
->
loadObjectOwnerPHID
();
$views
=
array
();
foreach
(
$inlines
as
$inline
)
{
$view
=
id
(
new
PHUIDiffInlineCommentDetailView
())
->
setUser
(
$viewer
)
->
setInlineComment
(
$inline
)
->
setMarkupEngine
(
$engine
)
->
setHandles
(
$handles
)
->
setEditable
(
false
)
->
setPreview
(
true
)
->
setCanMarkDone
(
false
)
->
setObjectOwnerPHID
(
$object_owner_phid
);
$views
[]
=
$view
->
render
();
}
$views
=
phutil_implode_html
(
"
\n
"
,
$views
);
return
id
(
new
AphrontAjaxResponse
())
->
setContent
(
$views
);
}
}
Event Timeline
Log In to Comment