Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97216308
PhabricatorHomeController.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
Fri, Jan 3, 13:01
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 5, 13:01 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23356613
Attached To
rPH Phabricator
PhabricatorHomeController.php
View Options
<?php
abstract
class
PhabricatorHomeController
extends
PhabricatorController
{
public
function
buildNav
()
{
$user
=
$this
->
getRequest
()->
getUser
();
$nav
=
new
AphrontSideNavFilterView
();
$nav
->
setBaseURI
(
new
PhutilURI
(
'/'
));
$applications
=
id
(
new
PhabricatorApplicationQuery
())
->
setViewer
(
$user
)
->
withInstalled
(
true
)
->
withUnlisted
(
false
)
->
withLaunchable
(
true
)
->
execute
();
$pinned
=
$user
->
getUserSetting
(
PhabricatorPinnedApplicationsSetting
::
SETTINGKEY
);
// Force "Applications" to appear at the bottom.
$meta_app
=
'PhabricatorApplicationsApplication'
;
$pinned
=
array_fuse
(
$pinned
);
unset
(
$pinned
[
$meta_app
]);
$pinned
[
$meta_app
]
=
$meta_app
;
$applications
[
$meta_app
]
=
PhabricatorApplication
::
getByClass
(
$meta_app
);
$tiles
=
array
();
$home_app
=
new
PhabricatorHomeApplication
();
$tiles
[]
=
id
(
new
PhabricatorApplicationLaunchView
())
->
setApplication
(
$home_app
)
->
addClass
(
'phabricator-application-launch-phone-only'
)
->
setUser
(
$user
);
foreach
(
$pinned
as
$pinned_application
)
{
if
(
empty
(
$applications
[
$pinned_application
]))
{
continue
;
}
$application
=
$applications
[
$pinned_application
];
$tile
=
id
(
new
PhabricatorApplicationLaunchView
())
->
setApplication
(
$application
)
->
setUser
(
$user
);
$tiles
[]
=
$tile
;
}
$nav
->
addCustomBlock
(
phutil_tag
(
'div'
,
array
(
'class'
=>
'application-tile-group'
,
),
$tiles
));
$nav
->
addFilter
(
''
,
pht
(
'Customize Menu...'
),
'/settings/panel/home/'
);
$nav
->
addClass
(
'phabricator-side-menu-home'
);
$nav
->
selectFilter
(
null
);
return
$nav
;
}
}
Event Timeline
Log In to Comment