Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2893571
PhabricatorDashboardPortalSearchEngine.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorDashboardPortalSearchEngine.php
View Options
<?php
final
class
PhabricatorDashboardPortalSearchEngine
extends
PhabricatorApplicationSearchEngine
{
public
function
getResultTypeDescription
(
)
{
return
pht
(
'Portals'
)
;
}
public
function
getApplicationClassName
(
)
{
return
PhabricatorDashboardApplication
::
class
;
}
public
function
newQuery
(
)
{
return
new
PhabricatorDashboardPortalQuery
(
)
;
}
protected
function
buildQueryFromParameters
(
array
$map
)
{
$query
=
$this
->
newQuery
(
)
;
return
$query
;
}
protected
function
buildCustomSearchFields
(
)
{
return
array
(
)
;
}
protected
function
getURI
(
$path
)
{
return
'/portal/'
.
$path
;
}
protected
function
getBuiltinQueryNames
(
)
{
$names
=
array
(
)
;
$names
[
'all'
]
=
pht
(
'All Portals'
)
;
return
$names
;
}
public
function
buildSavedQueryFromBuiltin
(
$query_key
)
{
$query
=
$this
->
newSavedQuery
(
)
;
$query
->
setQueryKey
(
$query_key
)
;
$viewer
=
$this
->
requireViewer
(
)
;
switch
(
$query_key
)
{
case
'all'
:
return
$query
;
}
return
parent
::
buildSavedQueryFromBuiltin
(
$query_key
)
;
}
protected
function
renderResultList
(
array
$portals
,
PhabricatorSavedQuery
$query
,
array
$handles
)
{
assert_instances_of
(
$portals
,
'PhabricatorDashboardPortal'
)
;
$viewer
=
$this
->
requireViewer
(
)
;
$list
=
new
PHUIObjectItemListView
(
)
;
$list
->
setUser
(
$viewer
)
;
foreach
(
$portals
as
$portal
)
{
$item
=
id
(
new
PHUIObjectItemView
(
)
)
->
setObjectName
(
$portal
->
getObjectName
(
)
)
->
setHeader
(
$portal
->
getName
(
)
)
->
setHref
(
$portal
->
getURI
(
)
)
->
setObject
(
$portal
)
;
$list
->
addItem
(
$item
)
;
}
return
id
(
new
PhabricatorApplicationSearchResultView
(
)
)
->
setObjectList
(
$list
)
->
setNoDataString
(
pht
(
'No portals found.'
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 18:38 (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1127510
Default Alt Text
PhabricatorDashboardPortalSearchEngine.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment