Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97206206
PhabricatorCalendarImportSearchEngine.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
Fri, Jan 3, 10:38
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 5, 10:38 (2 d)
Engine
blob
Format
Raw Data
Handle
23354186
Attached To
rPH Phabricator
PhabricatorCalendarImportSearchEngine.php
View Options
<?php
final
class
PhabricatorCalendarImportSearchEngine
extends
PhabricatorApplicationSearchEngine
{
public
function
getResultTypeDescription
()
{
return
pht
(
'Calendar Imports'
);
}
public
function
getApplicationClassName
()
{
return
'PhabricatorCalendarApplication'
;
}
public
function
canUseInPanelContext
()
{
return
false
;
}
public
function
newQuery
()
{
return
new
PhabricatorCalendarImportQuery
();
}
protected
function
buildCustomSearchFields
()
{
return
array
();
}
protected
function
buildQueryFromParameters
(
array
$map
)
{
$query
=
$this
->
newQuery
();
return
$query
;
}
protected
function
getURI
(
$path
)
{
return
'/calendar/import/'
.
$path
;
}
protected
function
getBuiltinQueryNames
()
{
$names
=
array
(
'all'
=>
pht
(
'All Imports'
),
);
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
$imports
,
PhabricatorSavedQuery
$query
,
array
$handles
)
{
assert_instances_of
(
$imports
,
'PhabricatorCalendarImport'
);
$viewer
=
$this
->
requireViewer
();
$list
=
new
PHUIObjectItemListView
();
foreach
(
$imports
as
$import
)
{
$item
=
id
(
new
PHUIObjectItemView
())
->
setViewer
(
$viewer
)
->
setObjectName
(
pht
(
'Import %d'
,
$import
->
getID
()))
->
setHeader
(
$import
->
getDisplayName
())
->
setHref
(
$import
->
getURI
());
if
(
$import
->
getIsDisabled
())
{
$item
->
setDisabled
(
true
);
}
$list
->
addItem
(
$item
);
}
$result
=
new
PhabricatorApplicationSearchResultView
();
$result
->
setObjectList
(
$list
);
$result
->
setNoDataString
(
pht
(
'No imports found.'
));
return
$result
;
}
}
Event Timeline
Log In to Comment