Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F116796296
PhabricatorDirectoryController.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
Mon, Jun 9, 07:39
Size
2 KB
Mime Type
text/x-php
Expires
Wed, Jun 11, 07:39 (2 d)
Engine
blob
Format
Raw Data
Handle
26652599
Attached To
rPH Phabricator
PhabricatorDirectoryController.php
View Options
<?php
abstract
class
PhabricatorDirectoryController
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
=
PhabricatorApplication
::
getAllInstalledApplications
();
foreach
(
$applications
as
$key
=>
$application
)
{
if
(!
$application
->
shouldAppearInLaunchView
())
{
unset
(
$applications
[
$key
]);
}
}
$groups
=
PhabricatorApplication
::
getApplicationGroups
();
$applications
=
msort
(
$applications
,
'getApplicationOrder'
);
$applications
=
mgroup
(
$applications
,
'getApplicationGroup'
);
$applications
=
array_select_keys
(
$applications
,
array_keys
(
$groups
));
$view
=
array
();
foreach
(
$applications
as
$group
=>
$application_list
)
{
$status
=
array
();
foreach
(
$application_list
as
$key
=>
$application
)
{
$status
[
$key
]
=
$application
->
loadStatus
(
$user
);
}
$views
=
array
();
foreach
(
$application_list
as
$key
=>
$application
)
{
$views
[]
=
id
(
new
PhabricatorApplicationLaunchView
())
->
setApplication
(
$application
)
->
setApplicationStatus
(
idx
(
$status
,
$key
,
array
()))
->
setUser
(
$user
);
}
while
(
count
(
$views
)
%
4
)
{
$views
[]
=
id
(
new
PhabricatorApplicationLaunchView
());
}
$nav
->
addLabel
(
$groups
[
$group
]);
$nav
->
addCustomBlock
(
phutil_render_tag
(
'div'
,
array
(
'class'
=>
'application-tile-group'
,
),
id
(
new
AphrontNullView
())->
appendChild
(
$views
)->
render
()));
}
$nav
->
addClass
(
'phabricator-side-menu-home'
);
$nav
->
selectFilter
(
null
);
return
$nav
;
}
}
Event Timeline
Log In to Comment