Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F114969532
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
Thu, May 29, 02:16
Size
1 KB
Mime Type
text/x-php
Expires
Sat, May 31, 02:16 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
26440433
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