Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F73434273
PhabricatorProjectListController.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, Jul 21, 07:15
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jul 23, 07:15 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
19202048
Attached To
rPH Phabricator
PhabricatorProjectListController.php
View Options
<?php
final
class
PhabricatorProjectListController
extends
PhabricatorProjectController
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
PhabricatorProjectSearchEngine
())
->
setNavigation
(
$this
->
buildSideNavView
());
return
$this
->
delegateToController
(
$controller
);
}
public
function
renderResultsList
(
array
$projects
,
PhabricatorSavedQuery
$query
)
{
assert_instances_of
(
$projects
,
'PhabricatorProject'
);
$viewer
=
$this
->
getRequest
()->
getUser
();
$list
=
new
PhabricatorObjectItemListView
();
$list
->
setUser
(
$viewer
);
foreach
(
$projects
as
$project
)
{
$id
=
$project
->
getID
();
$item
=
id
(
new
PhabricatorObjectItemView
())
->
setHeader
(
$project
->
getName
())
->
setHref
(
$this
->
getApplicationURI
(
"view/{$id}/"
));
if
(
$project
->
getStatus
()
==
PhabricatorProjectStatus
::
STATUS_ARCHIVED
)
{
$item
->
addIcon
(
'delete-grey'
,
pht
(
'Archived'
));
$item
->
setDisabled
(
true
);
}
$list
->
addItem
(
$item
);
}
return
$list
;
}
}
Event Timeline
Log In to Comment