Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93095250
PhabricatorDashboardPanelSearchApplicationCustomField.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, Nov 26, 04:32
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 28, 04:32 (2 d)
Engine
blob
Format
Raw Data
Handle
22572718
Attached To
rPH Phabricator
PhabricatorDashboardPanelSearchApplicationCustomField.php
View Options
<?php
final
class
PhabricatorDashboardPanelSearchApplicationCustomField
extends
PhabricatorStandardCustomField
{
public
function
getFieldType
()
{
return
'search.application'
;
}
public
function
shouldAppearInApplicationSearch
()
{
return
false
;
}
public
function
renderEditControl
(
array
$handles
)
{
$engines
=
id
(
new
PhutilSymbolLoader
())
->
setAncestorClass
(
'PhabricatorApplicationSearchEngine'
)
->
loadObjects
();
$options
=
array
();
$value
=
$this
->
getFieldValue
();
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
->
getFieldControlID
())
->
setLabel
(
$this
->
getFieldName
())
->
setCaption
(
$this
->
getCaption
())
->
setName
(
$this
->
getFieldKey
())
->
setValue
(
$this
->
getFieldValue
())
->
setOptions
(
$options
);
}
}
Event Timeline
Log In to Comment