Update Config Application UI
Summary: Switches over to new property UI boxes, splits core and apps into separate pages. Move Versions into "All Settings". I think there is some docs I likely need to update here as well. Test Plan: Click on each item in the sidebar, see new headers. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D16429
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<?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 Configuration');
|
||||
|
||||
$apps = id(new PHUIObjectBoxView())
|
||||
->setHeaderText($title)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setObjectList($apps_list);
|
||||
|
||||
$crumbs = $this
|
||||
->buildApplicationCrumbs()
|
||||
->addTextCrumb(pht('Configuration'), $this->getApplicationURI())
|
||||
->addTextCrumb(pht('Applications'));
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn(array(
|
||||
$apps,
|
||||
));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
private function buildConfigOptionsList(array $groups, $type) {
|
||||
assert_instances_of($groups, 'PhabricatorApplicationConfigOptions');
|
||||
|
||||
$list = new PHUIObjectItemListView();
|
||||
$groups = msort($groups, 'getName');
|
||||
foreach ($groups as $group) {
|
||||
if ($group->getGroup() == $type) {
|
||||
$item = id(new PHUIObjectItemView())
|
||||
->setHeader($group->getName())
|
||||
->setHref('/config/group/'.$group->getKey().'/')
|
||||
->addAttribute($group->getDescription())
|
||||
->setImageIcon($group->getIcon());
|
||||
$list->addItem($item);
|
||||
}
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user