Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93197111
PhabricatorAuthProviderConfigSearchEngine.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, 23:01
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 28, 23:01 (2 d)
Engine
blob
Format
Raw Data
Handle
22593844
Attached To
rPH Phabricator
PhabricatorAuthProviderConfigSearchEngine.php
View Options
<?php
final
class
PhabricatorAuthProviderConfigSearchEngine
extends
PhabricatorApplicationSearchEngine
{
public
function
buildSavedQueryFromRequest
(
AphrontRequest
$request
)
{
$saved
=
new
PhabricatorSavedQuery
();
$saved
->
setParameter
(
'status'
,
$request
->
getStr
(
'status'
));
return
$saved
;
}
public
function
buildQueryFromSavedQuery
(
PhabricatorSavedQuery
$saved
)
{
$query
=
new
PhabricatorAuthProviderConfigQuery
();
$status
=
$saved
->
getParameter
(
'status'
);
$options
=
PhabricatorAuthProviderConfigQuery
::
getStatusOptions
();
if
(
empty
(
$options
[
$status
]))
{
$status
=
head_key
(
$options
);
}
$query
->
withStatus
(
$status
);
return
$query
;
}
public
function
buildSearchForm
(
AphrontFormView
$form
,
PhabricatorSavedQuery
$saved_query
)
{
$status
=
$saved_query
->
getParameter
(
'status'
);
$form
->
appendChild
(
id
(
new
AphrontFormSelectControl
())
->
setName
(
'status'
)
->
setLabel
(
pht
(
'Status'
))
->
setOptions
(
PhabricatorAuthProviderConfigQuery
::
getStatusOptions
())
->
setValue
(
$status
));
}
protected
function
getURI
(
$path
)
{
return
'/auth/'
.
$path
;
}
public
function
getBuiltinQueryNames
()
{
$names
=
array
(
'all'
=>
pht
(
'All'
),
);
return
$names
;
}
public
function
buildSavedQueryFromBuiltin
(
$query_key
)
{
$query
=
$this
->
newSavedQuery
();
$query
->
setQueryKey
(
$query_key
);
switch
(
$query_key
)
{
case
'all'
:
return
$query
->
setParameter
(
'status'
,
PhabricatorAuthProviderConfigQuery
::
STATUS_ALL
);
}
return
parent
::
buildSavedQueryFromBuiltin
(
$query_key
);
}
}
Event Timeline
Log In to Comment