Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121987646
PholioInlineCommentView.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
Tue, Jul 15, 05:17
Size
2 KB
Mime Type
text/x-php
Expires
Thu, Jul 17, 05:17 (2 d)
Engine
blob
Format
Raw Data
Handle
27421379
Attached To
rPH Phabricator
PholioInlineCommentView.php
View Options
<?php
final
class
PholioInlineCommentView
extends
AphrontView
{
private
$inlineComment
;
private
$handle
;
private
$editable
;
public
function
setInlineComment
(
PholioTransactionComment
$inline_comment
)
{
if
(
$inline_comment
->
getImageID
()
===
null
)
{
throw
new
Exception
(
"Comment provided is not inline comment"
);
}
$this
->
inlineComment
=
$inline_comment
;
return
$this
;
}
public
function
setHandle
(
PhabricatorObjectHandle
$handle
)
{
$this
->
handle
=
$handle
;
return
$this
;
}
public
function
setEditable
(
$editable
)
{
$this
->
editable
=
$editable
;
return
$this
;
}
public
function
render
()
{
if
(!
$this
->
inlineComment
)
{
throw
new
Exception
(
"Call setInlineComment() before render()!"
);
}
$actions
=
null
;
if
(
$this
->
editable
)
{
$edit_action
=
javelin_tag
(
'a'
,
array
(
'href'
=>
'/pholio/inline/edit/'
.
$this
->
inlineComment
->
getID
(),
'sigil'
=>
'inline-edit'
,
'meta'
=>
array
(
'phid'
=>
$this
->
inlineComment
->
getPHID
(),
'id'
=>
$this
->
inlineComment
->
getID
()
)
),
pht
(
'Edit'
));
$delete_action
=
javelin_tag
(
'a'
,
array
(
'href'
=>
'/pholio/inline/delete/'
.
$this
->
inlineComment
->
getID
(),
'sigil'
=>
'inline-delete'
,
'meta'
=>
array
(
'phid'
=>
$this
->
inlineComment
->
getPHID
(),
'id'
=>
$this
->
inlineComment
->
getID
()
)
),
pht
(
'Delete'
));
$actions
=
phutil_tag
(
'span'
,
array
(
'class'
=>
'pholio-inline-head-links'
),
array
(
$edit_action
,
$delete_action
));
}
$comment_header
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'pholio-inline-comment-header'
),
array
(
$this
->
handle
->
getName
(),
$actions
));
$comment_body
=
phutil_tag
(
'div'
,
array
(
),
$this
->
inlineComment
->
getContent
());
$comment_block
=
javelin_tag
(
'div'
,
array
(
'id'
=>
$this
->
inlineComment
->
getPHID
().
"_comment"
,
'class'
=>
'pholio-inline-comment'
,
'sigil'
=>
'inline_comment'
,
'meta'
=>
array
(
'phid'
=>
$this
->
inlineComment
->
getPHID
()
)
),
array
(
$comment_header
,
$comment_body
));
return
$this
->
renderSingleView
(
$comment_block
);
}
}
Event Timeline
Log In to Comment