Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79508968
PhabricatorPasteQueriesController.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, Aug 26, 20:12
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Aug 28, 20:12 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
20197060
Attached To
rPH Phabricator
PhabricatorPasteQueriesController.php
View Options
<?php
final
class
PhabricatorPasteQueriesController
extends
PhabricatorPasteController
{
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$nav
=
$this
->
buildSideNavView
();
$nav
->
selectFilter
(
'savedqueries'
);
$named_queries
=
id
(
new
PhabricatorNamedQueryQuery
())
->
setViewer
(
$user
)
->
withUserPHIDs
(
array
(
$user
->
getPHID
()))
->
withEngineClassNames
(
array
(
'PhabricatorPasteSearchEngine'
))
->
execute
();
$list
=
new
PhabricatorObjectItemListView
();
$list
->
setUser
(
$user
);
foreach
(
$named_queries
as
$named_query
)
{
$date_created
=
phabricator_datetime
(
$named_query
->
getDateCreated
(),
$user
);
$item
=
id
(
new
PhabricatorObjectItemView
())
->
setHeader
(
$named_query
->
getQueryName
())
->
setHref
(
'/paste/query/'
.
$named_query
->
getQueryKey
().
'/'
)
->
addIcon
(
'none'
,
$date_created
)
->
addAction
(
id
(
new
PhabricatorMenuItemView
())
->
setIcon
(
'edit'
)
->
setHref
(
'/search/edit/'
.
$named_query
->
getQueryKey
().
'/'
));
$list
->
addItem
(
$item
);
}
$list
->
setNoDataString
(
pht
(
"No results found for this query."
));
$nav
->
appendChild
(
array
(
$list
,
));
$crumbs
=
$this
->
buildApplicationCrumbs
(
$nav
)
->
addCrumb
(
id
(
new
PhabricatorCrumbView
())
->
setName
(
pht
(
"Saved Queries"
))
->
setHref
(
$this
->
getApplicationURI
(
'/savedqueries/'
)));
$nav
->
setCrumbs
(
$crumbs
);
return
$this
->
buildApplicationPage
(
$nav
,
array
(
'title'
=>
pht
(
"Saved Queries"
),
'device'
=>
true
,
'dust'
=>
true
,
));
}
}
Event Timeline
Log In to Comment