Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F118764461
PhabricatorSelectEditField.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, Jun 22, 02:18
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jun 24, 02:18 (2 d)
Engine
blob
Format
Raw Data
Handle
26926354
Attached To
rPH Phabricator
PhabricatorSelectEditField.php
View Options
<?php
final
class
PhabricatorSelectEditField
extends
PhabricatorEditField
{
private
$options
;
private
$commentActionDefaultValue
;
public
function
setOptions
(
array
$options
)
{
$this
->
options
=
$options
;
return
$this
;
}
public
function
getOptions
()
{
if
(
$this
->
options
===
null
)
{
throw
new
PhutilInvalidStateException
(
'setOptions'
);
}
return
$this
->
options
;
}
public
function
setCommentActionDefaultValue
(
$default
)
{
$this
->
commentActionDefaultValue
=
$default
;
return
$this
;
}
public
function
getCommentActionDefaultValue
()
{
return
$this
->
commentActionDefaultValue
;
}
protected
function
newControl
()
{
return
id
(
new
AphrontFormSelectControl
())
->
setOptions
(
$this
->
getOptions
());
}
protected
function
newHTTPParameterType
()
{
return
new
AphrontSelectHTTPParameterType
();
}
public
function
getCommentEditTypes
()
{
$label
=
$this
->
getCommentActionLabel
();
if
(
$label
===
null
)
{
return
array
();
}
$default_value
=
$this
->
getCommentActionDefaultValue
();
if
(
$default_value
===
null
)
{
$default_value
=
$this
->
getValue
();
}
$edit
=
$this
->
getEditType
()
->
setLabel
(
$label
)
->
setPHUIXControlType
(
'select'
)
->
setPHUIXControlSpecification
(
array
(
'options'
=>
$this
->
getOptions
(),
'order'
=>
array_keys
(
$this
->
getOptions
()),
'value'
=>
$default_value
,
));
return
array
(
$edit
);
}
}
Event Timeline
Log In to Comment