Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91213685
DiffusionRepositoryListController.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
Sat, Nov 9, 01:08
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Nov 11, 01:08 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22221699
Attached To
rPH Phabricator
DiffusionRepositoryListController.php
View Options
<?php
final
class
DiffusionRepositoryListController
extends
DiffusionController
{
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
PhabricatorRepositorySearchEngine
())
->
setNavigation
(
$this
->
buildSideNavView
());
return
$this
->
delegateToController
(
$controller
);
}
public
function
buildSideNavView
(
$for_app
=
false
)
{
$viewer
=
$this
->
getRequest
()->
getUser
();
$nav
=
new
AphrontSideNavFilterView
();
$nav
->
setBaseURI
(
new
PhutilURI
(
$this
->
getApplicationURI
()));
id
(
new
PhabricatorRepositorySearchEngine
())
->
setViewer
(
$viewer
)
->
addNavigationItems
(
$nav
->
getMenu
());
$nav
->
selectFilter
(
null
);
return
$nav
;
}
public
function
buildApplicationCrumbs
()
{
$crumbs
=
parent
::
buildApplicationCrumbs
();
$can_create
=
$this
->
hasApplicationCapability
(
DiffusionCapabilityCreateRepositories
::
CAPABILITY
);
$crumbs
->
addAction
(
id
(
new
PHUIListItemView
())
->
setName
(
pht
(
'New Repository'
))
->
setHref
(
$this
->
getApplicationURI
(
'new/'
))
->
setDisabled
(!
$can_create
)
->
setIcon
(
'fa-plus-square'
));
return
$crumbs
;
}
}
Event Timeline
Log In to Comment