Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98323456
PhabricatorSpacesListController.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, Jan 12, 02:03
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jan 14, 02:03 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23557923
Attached To
rPH Phabricator
PhabricatorSpacesListController.php
View Options
<?php
final
class
PhabricatorSpacesListController
extends
PhabricatorSpacesController
{
public
function
shouldAllowPublic
()
{
return
true
;
}
public
function
handleRequest
(
AphrontRequest
$request
)
{
$request
=
$this
->
getRequest
();
$controller
=
id
(
new
PhabricatorApplicationSearchController
(
$request
))
->
setQueryKey
(
$request
->
getURIData
(
'queryKey'
))
->
setSearchEngine
(
new
PhabricatorSpacesNamespaceSearchEngine
())
->
setNavigation
(
$this
->
buildSideNavView
());
return
$this
->
delegateToController
(
$controller
);
}
public
function
buildSideNavView
(
$for_app
=
false
)
{
$user
=
$this
->
getRequest
()->
getUser
();
$nav
=
new
AphrontSideNavFilterView
();
$nav
->
setBaseURI
(
new
PhutilURI
(
$this
->
getApplicationURI
()));
id
(
new
PhabricatorSpacesNamespaceSearchEngine
())
->
setViewer
(
$user
)
->
addNavigationItems
(
$nav
->
getMenu
());
$nav
->
selectFilter
(
null
);
return
$nav
;
}
protected
function
buildApplicationCrumbs
()
{
$crumbs
=
parent
::
buildApplicationCrumbs
();
$can_create
=
$this
->
hasApplicationCapability
(
PhabricatorSpacesCapabilityCreateSpaces
::
CAPABILITY
);
$crumbs
->
addAction
(
id
(
new
PHUIListItemView
())
->
setName
(
pht
(
'Create Space'
))
->
setHref
(
$this
->
getApplicationURI
(
'create/'
))
->
setIcon
(
'fa-plus-square'
)
->
setDisabled
(!
$can_create
)
->
setWorkflow
(!
$can_create
));
return
$crumbs
;
}
}
Event Timeline
Log In to Comment