Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92658633
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
Fri, Nov 22, 11:54
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 11:54 (2 d)
Engine
blob
Format
Raw Data
Handle
22480697
Attached To
rPH Phabricator
PhabricatorInlineCommentPreviewController.php
View Options
<?php
abstract
class
PhabricatorInlineCommentPreviewController
extends
PhabricatorController
{
abstract
protected
function
loadInlineComments
();
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$inlines
=
$this
->
loadInlineComments
();
assert_instances_of
(
$inlines
,
'PhabricatorInlineCommentInterface'
);
$engine
=
new
PhabricatorMarkupEngine
();
$engine
->
setViewer
(
$user
);
foreach
(
$inlines
as
$inline
)
{
$engine
->
addObject
(
$inline
,
PhabricatorInlineCommentInterface
::
MARKUP_FIELD_BODY
);
}
$engine
->
process
();
$phids
=
array
(
$user
->
getPHID
());
$handles
=
$this
->
loadViewerHandles
(
$phids
);
$views
=
array
();
foreach
(
$inlines
as
$inline
)
{
$view
=
new
DifferentialInlineCommentView
();
$view
->
setInlineComment
(
$inline
);
$view
->
setMarkupEngine
(
$engine
);
$view
->
setHandles
(
$handles
);
$view
->
setEditable
(
false
);
$view
->
setPreview
(
true
);
$views
[]
=
$view
->
render
();
}
$views
=
phutil_implode_html
(
"
\n
"
,
$views
);
return
id
(
new
AphrontAjaxResponse
())
->
setContent
(
$views
);
}
}
Event Timeline
Log In to Comment