Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93021778
PhabricatorMailingListSearchEngine.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 25, 15:21
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Nov 27, 15:21 (2 d)
Engine
blob
Format
Raw Data
Handle
22559905
Attached To
rPH Phabricator
PhabricatorMailingListSearchEngine.php
View Options
<?php
final
class
PhabricatorMailingListSearchEngine
extends
PhabricatorApplicationSearchEngine
{
public
function
getApplicationClassName
()
{
return
'PhabricatorApplicationMailingLists'
;
}
public
function
buildSavedQueryFromRequest
(
AphrontRequest
$request
)
{
$saved
=
new
PhabricatorSavedQuery
();
return
$saved
;
}
public
function
buildQueryFromSavedQuery
(
PhabricatorSavedQuery
$saved
)
{
$query
=
id
(
new
PhabricatorMailingListQuery
());
return
$query
;
}
public
function
buildSearchForm
(
AphrontFormView
$form
,
PhabricatorSavedQuery
$saved_query
)
{
// This just makes it clear to the user that the lack of filters is
// intentional, not a bug.
$form
->
appendChild
(
id
(
new
AphrontFormMarkupControl
())
->
setValue
(
pht
(
'No query filters are available for mailing lists.'
)));
}
protected
function
getURI
(
$path
)
{
return
'/mailinglists/'
.
$path
;
}
public
function
getBuiltinQueryNames
()
{
$names
=
array
(
'all'
=>
pht
(
'All Lists'
),
);
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
$lists
,
PhabricatorSavedQuery
$query
,
array
$handles
)
{
assert_instances_of
(
$lists
,
'PhabricatorMetaMTAMailingList'
);
$view
=
id
(
new
PHUIObjectItemListView
());
foreach
(
$lists
as
$list
)
{
$item
=
new
PHUIObjectItemView
();
$item
->
setHeader
(
$list
->
getName
());
$item
->
setHref
(
$list
->
getURI
());
$item
->
addAttribute
(
$list
->
getEmail
());
$item
->
addAction
(
id
(
new
PHUIListItemView
())
->
setIcon
(
'fa-pencil'
)
->
setHref
(
$this
->
getApplicationURI
(
'/edit/'
.
$list
->
getID
().
'/'
)));
$view
->
addItem
(
$item
);
}
return
$view
;
}
}
Event Timeline
Log In to Comment