Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F105883130
PhabricatorConfigApplicationController.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
Thu, Mar 20, 13:08
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Mar 22, 13:08 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25054215
Attached To
rPH Phabricator
PhabricatorConfigApplicationController.php
View Options
<?php
final
class
PhabricatorConfigApplicationController
extends
PhabricatorConfigController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
();
$nav
=
$this
->
buildSideNavView
();
$nav
->
selectFilter
(
'application/'
);
$groups
=
PhabricatorApplicationConfigOptions
::
loadAll
();
$apps_list
=
$this
->
buildConfigOptionsList
(
$groups
,
'apps'
);
$title
=
pht
(
'Application Settings'
);
$header
=
id
(
new
PHUIHeaderView
())
->
setHeader
(
$title
)
->
setProfileHeader
(
true
);
$crumbs
=
$this
->
buildApplicationCrumbs
()
->
addTextCrumb
(
pht
(
'Applications'
))
->
setBorder
(
true
);
$content
=
id
(
new
PhabricatorConfigPageView
())
->
setHeader
(
$header
)
->
setContent
(
$apps_list
);
return
$this
->
newPage
()
->
setTitle
(
$title
)
->
setCrumbs
(
$crumbs
)
->
setNavigation
(
$nav
)
->
appendChild
(
$content
)
->
addFrameClass
(
'white-background'
);
}
private
function
buildConfigOptionsList
(
array
$groups
,
$type
)
{
assert_instances_of
(
$groups
,
'PhabricatorApplicationConfigOptions'
);
$list
=
new
PHUIObjectItemListView
();
$list
->
setBig
(
true
);
$groups
=
msort
(
$groups
,
'getName'
);
foreach
(
$groups
as
$group
)
{
if
(
$group
->
getGroup
()
==
$type
)
{
$icon
=
id
(
new
PHUIIconView
())
->
setIcon
(
$group
->
getIcon
())
->
setBackground
(
'bg-violet'
);
$item
=
id
(
new
PHUIObjectItemView
())
->
setHeader
(
$group
->
getName
())
->
setHref
(
'/config/group/'
.
$group
->
getKey
().
'/'
)
->
addAttribute
(
$group
->
getDescription
())
->
setImageIcon
(
$icon
);
$list
->
addItem
(
$item
);
}
}
return
$list
;
}
}
Event Timeline
Log In to Comment