Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91532530
PhabricatorEditEngineSearchEngine.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
Mon, Nov 11, 23:39
Size
2 KB
Mime Type
text/x-php
Expires
Wed, Nov 13, 23:39 (2 d)
Engine
blob
Format
Raw Data
Handle
22279304
Attached To
rPH Phabricator
PhabricatorEditEngineSearchEngine.php
View Options
<?php
final
class
PhabricatorEditEngineSearchEngine
extends
PhabricatorApplicationSearchEngine
{
public
function
getResultTypeDescription
()
{
return
pht
(
'Edit Engines'
);
}
public
function
getApplicationClassName
()
{
return
'PhabricatorTransactionsApplication'
;
}
public
function
newQuery
()
{
return
id
(
new
PhabricatorEditEngineQuery
());
}
public
function
canUseInPanelContext
()
{
return
false
;
}
protected
function
buildQueryFromParameters
(
array
$map
)
{
$query
=
$this
->
newQuery
();
return
$query
;
}
protected
function
buildCustomSearchFields
()
{
return
array
();
}
protected
function
getDefaultFieldOrder
()
{
return
array
();
}
protected
function
getURI
(
$path
)
{
return
'/transactions/editengine/'
.
$path
;
}
protected
function
getBuiltinQueryNames
()
{
$names
=
array
(
'all'
=>
pht
(
'All Edit Engines'
),
);
return
$names
;
}
public
function
buildSavedQueryFromBuiltin
(
$query_key
)
{
$query
=
$this
->
newSavedQuery
();
$query
->
setQueryKey
(
$query_key
);
switch
(
$query_key
)
{
case
'all'
:
return
$query
;
}
return
parent
::
buildSavedQueryFromBuiltin
(
$query_key
);
}
protected
function
renderResultList
(
array
$engines
,
PhabricatorSavedQuery
$query
,
array
$handles
)
{
assert_instances_of
(
$engines
,
'PhabricatorEditEngine'
);
$viewer
=
$this
->
requireViewer
();
$list
=
id
(
new
PHUIObjectItemListView
())
->
setUser
(
$viewer
);
foreach
(
$engines
as
$engine
)
{
if
(!
$engine
->
isEngineConfigurable
())
{
continue
;
}
$engine_key
=
$engine
->
getEngineKey
();
$query_uri
=
"/transactions/editengine/{$engine_key}/"
;
$application
=
$engine
->
getApplication
();
$app_icon
=
$application
->
getIcon
();
$item
=
id
(
new
PHUIObjectItemView
())
->
setHeader
(
$engine
->
getSummaryHeader
())
->
setHref
(
$query_uri
)
->
setStatusIcon
(
$app_icon
)
->
addAttribute
(
$engine
->
getSummaryText
());
$list
->
addItem
(
$item
);
}
return
id
(
new
PhabricatorApplicationSearchResultView
())
->
setObjectList
(
$list
);
}
}
Event Timeline
Log In to Comment