Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91978951
PonderCommentListView.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
Sat, Nov 16, 08:19
Size
2 KB
Mime Type
text/x-php
Expires
Mon, Nov 18, 08:19 (2 d)
Engine
blob
Format
Raw Data
Handle
22357928
Attached To
rPH Phabricator
PonderCommentListView.php
View Options
<?php
final
class
PonderCommentListView
extends
AphrontView
{
private
$handles
;
private
$comments
;
private
$target
;
private
$actionURI
;
private
$questionID
;
public
function
setHandles
(
array
$handles
)
{
assert_instances_of
(
$handles
,
'PhabricatorObjectHandle'
);
$this
->
handles
=
$handles
;
return
$this
;
}
public
function
setComments
(
array
$comments
)
{
assert_instances_of
(
$comments
,
'PonderComment'
);
$this
->
comments
=
$comments
;
return
$this
;
}
public
function
setQuestionID
(
$id
)
{
$this
->
questionID
=
$id
;
return
$this
;
}
public
function
setActionURI
(
$uri
)
{
$this
->
actionURI
=
$uri
;
return
$this
;
}
public
function
setTarget
(
$target
)
{
$this
->
target
=
$target
;
return
$this
;
}
public
function
render
()
{
require_celerity_resource
(
'phabricator-remarkup-css'
);
require_celerity_resource
(
'ponder-comment-table-css'
);
$user
=
$this
->
user
;
$handles
=
$this
->
handles
;
$comments
=
$this
->
comments
;
$comment_markup
=
array
();
foreach
(
$comments
as
$comment
)
{
$handle
=
$handles
[
$comment
->
getAuthorPHID
()];
$body
=
PhabricatorMarkupEngine
::
renderOneObject
(
$comment
,
$comment
->
getMarkupField
(),
$this
->
user
);
$comment_anchor
=
''
;
$comment_markup
[]
=
hsprintf
(
'<tr>'
.
'<th><a name="comment-%s" /></th>'
.
'<td>'
.
'<div class="phabricator-remarkup ponder-comment-markup">'
.
'%s —%s <span class="ponder-datestamp">%s</span>'
.
'</div>'
.
'</td>'
.
'</tr>'
,
$comment
->
getID
(),
$body
,
$handle
->
renderLink
(),
phabricator_datetime
(
$comment
->
getDateCreated
(),
$user
));
}
$addview
=
id
(
new
PonderAddCommentView
)
->
setTarget
(
$this
->
target
)
->
setUser
(
$user
)
->
setQuestionID
(
$this
->
questionID
)
->
setActionURI
(
$this
->
actionURI
);
$comment_markup
[]
=
hsprintf
(
'<tr><th> </th><td>%s</td></tr>'
,
$addview
->
render
());
$comment_markup
=
phutil_tag
(
'table'
,
array
(
'class'
=>
'ponder-comments'
,
),
$comment_markup
);
return
$comment_markup
;
}
}
Event Timeline
Log In to Comment