Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2896135
DrydockBlueprintListController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
DrydockBlueprintListController.php
View Options
<?php
final
class
DrydockBlueprintListController
extends
DrydockBlueprintController
implements
PhabricatorApplicationSearchResultsControllerInterface
{
private
$queryKey
;
public
function
shouldAllowPublic
(
)
{
return
true
;
}
public
function
willProcessRequest
(
array
$data
)
{
$this
->
queryKey
=
idx
(
$data
,
'queryKey'
)
;
}
public
function
processRequest
(
)
{
$request
=
$this
->
getRequest
(
)
;
$controller
=
id
(
new
PhabricatorApplicationSearchController
(
$request
)
)
->
setQueryKey
(
$this
->
queryKey
)
->
setSearchEngine
(
new
DrydockBlueprintSearchEngine
(
)
)
->
setNavigation
(
$this
->
buildSideNavView
(
)
)
;
return
$this
->
delegateToController
(
$controller
)
;
}
public
function
renderResultsList
(
array
$blueprints
,
PhabricatorSavedQuery
$query
)
{
assert_instances_of
(
$blueprints
,
'DrydockBlueprint'
)
;
$viewer
=
$this
->
getRequest
(
)
->
getUser
(
)
;
$view
=
new
PHUIObjectItemListView
(
)
;
foreach
(
$blueprints
as
$blueprint
)
{
$item
=
id
(
new
PHUIObjectItemView
(
)
)
->
setHeader
(
$blueprint
->
getClassName
(
)
)
->
setHref
(
$this
->
getApplicationURI
(
'/blueprint/'
.
$blueprint
->
getID
(
)
)
)
->
setObjectName
(
pht
(
'Blueprint %d'
,
$blueprint
->
getID
(
)
)
)
;
if
(
$blueprint
->
getImplementation
(
)
->
isEnabled
(
)
)
{
$item
->
addAttribute
(
pht
(
'Enabled'
)
)
;
$item
->
setBarColor
(
'green'
)
;
}
else
{
$item
->
addAttribute
(
pht
(
'Disabled'
)
)
;
$item
->
setBarColor
(
'red'
)
;
}
$item
->
addAttribute
(
$blueprint
->
getImplementation
(
)
->
getDescription
(
)
)
;
$view
->
addItem
(
$item
)
;
}
return
$view
;
}
public
function
buildApplicationCrumbs
(
)
{
$crumbs
=
parent
::
buildApplicationCrumbs
(
)
;
$crumbs
->
addAction
(
id
(
new
PHUIListItemView
(
)
)
->
setName
(
pht
(
'New Blueprint'
)
)
->
setHref
(
$this
->
getApplicationURI
(
'/blueprint/create/'
)
)
->
setIcon
(
'create'
)
)
;
return
$crumbs
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 22:36 (6 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1129464
Default Alt Text
DrydockBlueprintListController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment