Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1028859
PonderFooterView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PonderFooterView.php
View Options
<?php
final
class
PonderFooterView
extends
AphrontTagView
{
private
$contentID
;
private
$count
;
private
$actions
=
array
();
public
function
setContentID
(
$content_id
)
{
$this
->
contentID
=
$content_id
;
return
$this
;
}
public
function
setCount
(
$count
)
{
$this
->
count
=
$count
;
return
$this
;
}
public
function
addAction
(
$action
)
{
$this
->
actions
[]
=
$action
;
return
$this
;
}
protected
function
getTagAttributes
()
{
return
array
(
'class'
=>
'ponder-footer-view'
,
);
}
protected
function
getTagContent
()
{
Javelin
::
initBehavior
(
'phabricator-reveal-content'
);
$hide_action_id
=
celerity_generate_unique_node_id
();
$show_action_id
=
celerity_generate_unique_node_id
();
$content_id
=
$this
->
contentID
;
if
(
$this
->
count
==
0
)
{
$text
=
pht
(
'Add a Comment'
);
}
else
{
$text
=
pht
(
'Show %s Comments'
,
new
PhutilNumber
(
$this
->
count
));
}
$actions
=
array
();
$hide_action
=
javelin_tag
(
'a'
,
array
(
'sigil'
=>
'reveal-content'
,
'class'
=>
'ponder-footer-action'
,
'id'
=>
$hide_action_id
,
'href'
=>
'#'
,
'meta'
=>
array
(
'showIDs'
=>
array
(
$content_id
,
$show_action_id
),
'hideIDs'
=>
array
(
$hide_action_id
),
),
),
$text
);
$show_action
=
javelin_tag
(
'a'
,
array
(
'sigil'
=>
'reveal-content'
,
'style'
=>
'display: none;'
,
'class'
=>
'ponder-footer-action'
,
'id'
=>
$show_action_id
,
'href'
=>
'#'
,
'meta'
=>
array
(
'showIDs'
=>
array
(
$hide_action_id
),
'hideIDs'
=>
array
(
$content_id
,
$show_action_id
),
),
),
pht
(
'Hide Comments'
));
$actions
[]
=
$hide_action
;
$actions
[]
=
$show_action
;
return
array
(
$actions
,
$this
->
actions
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Jun 20, 9:21 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
250612
Default Alt Text
PonderFooterView.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment