Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F959196
PhabricatorHomeController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
PhabricatorHomeController.php
View Options
<?php
abstract
class
PhabricatorHomeController
extends
PhabricatorController
{
public
function
buildStandardPageResponse
(
$view
,
array
$data
)
{
$page
=
$this
->
buildStandardPageView
();
$page
->
setBaseURI
(
'/'
);
$page
->
setTitle
(
idx
(
$data
,
'title'
));
$page
->
setGlyph
(
"
\x
E2
\x
9A
\x
92"
);
$page
->
appendChild
(
$view
);
$response
=
new
AphrontWebpageResponse
();
return
$response
->
setContent
(
$page
->
render
());
}
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
->
loadPreferences
()->
getPinnedApplications
(
$applications
,
$user
);
// 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
)
->
setApplicationStatus
(
$home_app
->
loadStatus
(
$user
))
->
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
)
->
setApplicationStatus
(
$application
->
loadStatus
(
$user
))
->
setUser
(
$user
);
$tiles
[]
=
$tile
;
}
$nav
->
addCustomBlock
(
phutil_tag
(
'div'
,
array
(
'class'
=>
'application-tile-group'
,
),
$tiles
));
$nav
->
addFilter
(
''
,
pht
(
'Customize Applications...'
),
'/settings/panel/home/'
);
$nav
->
addClass
(
'phabricator-side-menu-home'
);
$nav
->
selectFilter
(
null
);
return
$nav
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jun 17, 9:42 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
222722
Default Alt Text
PhabricatorHomeController.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment