Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103767877
PhabricatorCountdownRemarkupRule.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, Mar 4, 15:35
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Mar 6, 15:35 (2 d)
Engine
blob
Format
Raw Data
Handle
24661401
Attached To
rPH Phabricator
PhabricatorCountdownRemarkupRule.php
View Options
<?php
/**
* @group countdown
*/
final
class
PhabricatorCountdownRemarkupRule
extends
PhabricatorRemarkupRuleObject
{
protected
function
getObjectNamePrefix
()
{
return
'C'
;
}
protected
function
loadObjects
(
array
$ids
)
{
$viewer
=
$this
->
getEngine
()->
getConfig
(
'viewer'
);
return
id
(
new
CountdownQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
$ids
)
->
execute
();
}
protected
function
renderObjectEmbed
(
$object
,
$handle
,
$options
)
{
require_celerity_resource
(
'javelin-behavior-countdown-timer'
);
$prefix
=
'phabricator-timer-'
;
$counter
=
phutil_tag
(
'span'
,
array
(
'id'
=>
$object
->
getPHID
(),
),
array
(
javelin_tag
(
'span'
,
array
(
'sigil'
=>
$prefix
.
'days'
),
''
),
'd'
,
javelin_tag
(
'span'
,
array
(
'sigil'
=>
$prefix
.
'hours'
),
''
),
'h'
,
javelin_tag
(
'span'
,
array
(
'sigil'
=>
$prefix
.
'minutes'
),
''
),
'm'
,
javelin_tag
(
'span'
,
array
(
'sigil'
=>
$prefix
.
'seconds'
),
''
),
's'
,
));
Javelin
::
initBehavior
(
'countdown-timer'
,
array
(
'timestamp'
=>
$object
->
getEpoch
(),
'container'
=>
$object
->
getPHID
(),
));
return
$counter
;
}
}
Event Timeline
Log In to Comment