Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F32567792
PhabricatorInlineCommentPreviewController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
1 KB
Subscribers
None
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
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 14, 8:17 PM (1 d, 4 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
2e/30/367133659dd1bd74bc5f950a0b03
Attached To
rPHAB Phabricator
Event Timeline
Log In to Comment