Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F114441379
DivinerAtomListController.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
Sun, May 25, 22:17
Size
1 KB
Mime Type
text/x-php
Expires
Tue, May 27, 22:17 (2 d)
Engine
blob
Format
Raw Data
Handle
26379064
Attached To
rPH Phabricator
DivinerAtomListController.php
View Options
<?php
final
class
DivinerAtomListController
extends
DivinerController
implements
PhabricatorApplicationSearchResultsControllerInterface
{
private
$key
;
public
function
shouldAllowPublic
()
{
return
true
;
}
public
function
willProcessRequest
(
array
$data
)
{
$this
->
key
=
idx
(
$data
,
'key'
,
'all'
);
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$controller
=
id
(
new
PhabricatorApplicationSearchController
(
$request
))
->
setQueryKey
(
$this
->
key
)
->
setSearchEngine
(
new
DivinerAtomSearchEngine
())
->
setNavigation
(
$this
->
buildSideNavView
());
return
$this
->
delegateToController
(
$controller
);
}
public
function
renderResultsList
(
array
$symbols
,
PhabricatorSavedQuery
$query
)
{
assert_instances_of
(
$symbols
,
'DivinerLiveSymbol'
);
$request
=
$this
->
getRequest
();
$viewer
=
$request
->
getUser
();
$list
=
id
(
new
PHUIObjectItemListView
())
->
setUser
(
$viewer
);
foreach
(
$symbols
as
$symbol
)
{
$type
=
$symbol
->
getType
();
$type_name
=
DivinerAtom
::
getAtomTypeNameString
(
$type
);
$item
=
id
(
new
PHUIObjectItemView
())
->
setHeader
(
$symbol
->
getTitle
())
->
setHref
(
$symbol
->
getURI
())
->
addAttribute
(
$symbol
->
getSummary
())
->
addIcon
(
'none'
,
$type_name
);
$list
->
addItem
(
$item
);
}
return
$list
;
}
}
Event Timeline
Log In to Comment