Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93832498
AphrontFormSubmitControl.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
Sun, Dec 1, 21:04
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Dec 3, 21:04 (2 d)
Engine
blob
Format
Raw Data
Handle
22712099
Attached To
rPH Phabricator
AphrontFormSubmitControl.php
View Options
<?php
final
class
AphrontFormSubmitControl
extends
AphrontFormControl
{
private
$buttons
=
array
();
public
function
addCancelButton
(
$href
,
$label
=
null
)
{
if
(!
$label
)
{
$label
=
pht
(
'Cancel'
);
}
$button
=
id
(
new
PHUIButtonView
())
->
setTag
(
'a'
)
->
setHref
(
$href
)
->
setText
(
$label
)
->
setColor
(
PHUIButtonView
::
GREY
);
$this
->
addButton
(
$button
);
return
$this
;
}
public
function
addButton
(
PHUIButtonView
$button
)
{
$this
->
buttons
[]
=
$button
;
return
$this
;
}
protected
function
getCustomControlClass
()
{
return
'aphront-form-control-submit'
;
}
protected
function
renderInput
()
{
$submit_button
=
null
;
if
(
$this
->
getValue
())
{
$submit_button
=
phutil_tag
(
'button'
,
array
(
'type'
=>
'submit'
,
'name'
=>
'__submit__'
,
'disabled'
=>
$this
->
getDisabled
()
?
'disabled'
:
null
,
),
$this
->
getValue
());
}
return
array
(
$submit_button
,
$this
->
buttons
,
);
}
}
Event Timeline
Log In to Comment