Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F539525
PhabricatorDashboardQueryPanelApplicationEditField.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
PhabricatorDashboardQueryPanelApplicationEditField.php
View Options
<?php
final
class
PhabricatorDashboardQueryPanelApplicationEditField
extends
PhabricatorEditField
{
private
$controlID
;
protected
function
newControl
()
{
$engines
=
id
(
new
PhutilClassMapQuery
())
->
setAncestorClass
(
'PhabricatorApplicationSearchEngine'
)
->
setFilterMethod
(
'canUseInPanelContext'
)
->
execute
();
$all_apps
=
id
(
new
PhabricatorApplicationQuery
())
->
setViewer
(
$this
->
getViewer
())
->
withUnlisted
(
false
)
->
withInstalled
(
true
)
->
execute
();
foreach
(
$engines
as
$index
=>
$engine
)
{
if
(!
isset
(
$all_apps
[
$engine
->
getApplicationClassName
()]))
{
unset
(
$engines
[
$index
]);
continue
;
}
}
$options
=
array
();
$value
=
$this
->
getValueForControl
();
if
(
strlen
(
$value
)
&&
empty
(
$engines
[
$value
]))
{
$options
[
$value
]
=
$value
;
}
$engines
=
msort
(
$engines
,
'getResultTypeDescription'
);
foreach
(
$engines
as
$class_name
=>
$engine
)
{
$options
[
$class_name
]
=
$engine
->
getResultTypeDescription
();
}
return
id
(
new
AphrontFormSelectControl
())
->
setID
(
$this
->
getControlID
())
->
setOptions
(
$options
);
}
protected
function
newHTTPParameterType
()
{
return
new
AphrontSelectHTTPParameterType
();
}
public
function
getControlID
()
{
if
(!
$this
->
controlID
)
{
$this
->
controlID
=
celerity_generate_unique_node_id
();
}
return
$this
->
controlID
;
}
protected
function
newConduitParameterType
()
{
return
new
ConduitStringParameterType
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 9:12 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
103906
Default Alt Text
PhabricatorDashboardQueryPanelApplicationEditField.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment