Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F104803254
PHUIFormTimerControl.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
Wed, Mar 12, 12:57
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Mar 14, 12:57 (1 d, 17 h)
Engine
blob
Format
Raw Data
Handle
24856807
Attached To
rPH Phabricator
PHUIFormTimerControl.php
View Options
<?php
final
class
PHUIFormTimerControl
extends
AphrontFormControl
{
private
$icon
;
private
$updateURI
;
public
function
setIcon
(
PHUIIconView
$icon
)
{
$this
->
icon
=
$icon
;
return
$this
;
}
public
function
getIcon
()
{
return
$this
->
icon
;
}
public
function
setUpdateURI
(
$update_uri
)
{
$this
->
updateURI
=
$update_uri
;
return
$this
;
}
public
function
getUpdateURI
()
{
return
$this
->
updateURI
;
}
protected
function
getCustomControlClass
()
{
return
'phui-form-timer'
;
}
protected
function
renderInput
()
{
return
$this
->
newTimerView
();
}
public
function
newTimerView
()
{
$icon_cell
=
phutil_tag
(
'td'
,
array
(
'class'
=>
'phui-form-timer-icon'
,
),
$this
->
getIcon
());
$content_cell
=
phutil_tag
(
'td'
,
array
(
'class'
=>
'phui-form-timer-content'
,
),
$this
->
renderChildren
());
$row
=
phutil_tag
(
'tr'
,
array
(),
array
(
$icon_cell
,
$content_cell
));
$node_id
=
null
;
$update_uri
=
$this
->
getUpdateURI
();
if
(
$update_uri
)
{
$node_id
=
celerity_generate_unique_node_id
();
Javelin
::
initBehavior
(
'phui-timer-control'
,
array
(
'nodeID'
=>
$node_id
,
'uri'
=>
$update_uri
,
));
}
return
phutil_tag
(
'table'
,
array
(
'id'
=>
$node_id
),
$row
);
}
}
Event Timeline
Log In to Comment