Commit a72ade94 authored by epriestley's avatar epriestley
Browse files

Carve out a separate "Modules/Extensions" section of Config

Summary:
Ref T13362. Config is currently doing a ton of stuff and fairly overwhelming. Separate out "Modules/Extensions" so it can live in its own section.

(This stuff is mostly useful for development and normal users rarely need to end up here.)

Test Plan: Visited seciton, clicked around. This is just a visual change.

Maniphest Tasks: T13362

Differential Revision: https://secure.phabricator.com/D20930
parent c42c5983
......@@ -63,7 +63,7 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
'purge/' => 'PhabricatorConfigPurgeCacheController',
),
'module/' => array(
'(?P<module>[^/]+)/' => 'PhabricatorConfigModuleController',
'(?:(?P<module>[^/]+)/)?' => 'PhabricatorConfigModuleController',
),
'cluster/' => array(
'databases/' => 'PhabricatorConfigClusterDatabasesController',
......
......@@ -42,13 +42,6 @@ abstract class PhabricatorConfigController extends PhabricatorController {
pht('Repository Servers'), null, 'fa-code');
$nav->addFilter('cluster/search/',
pht('Search Servers'), null, 'fa-search');
$nav->addLabel(pht('Modules'));
$modules = PhabricatorConfigModule::getAllModules();
foreach ($modules as $key => $module) {
$nav->addFilter('module/'.$key.'/',
$module->getModuleName(), null, 'fa-puzzle-piece');
}
return $nav;
}
......
......@@ -8,6 +8,11 @@ final class PhabricatorConfigModuleController
$key = $request->getURIData('module');
$all_modules = PhabricatorConfigModule::getAllModules();
if (!strlen($key)) {
$key = head_key($all_modules);
}
if (empty($all_modules[$key])) {
return new Aphront404Response();
}
......@@ -16,13 +21,27 @@ final class PhabricatorConfigModuleController
$content = $module->renderModuleStatus($request);
$title = $module->getModuleName();
$nav = $this->buildSideNavView();
$nav->selectFilter('module/'.$key.'/');
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$modules_uri = $this->getApplicationURI('module/');
$modules = PhabricatorConfigModule::getAllModules();
foreach ($modules as $module_key => $module) {
$nav->newLink($module_key)
->setName($module->getModuleName())
->setHref(urisprintf('%s%s/', $modules_uri, $module_key))
->setIcon('fa-puzzle-piece');
}
$nav->selectFilter($key);
$header = $this->buildHeaderView($title);
$view = $this->buildConfigBoxView($title, $content);
$crumbs = $this->buildApplicationCrumbs()
->addTextCrumb(pht('Extensions/Modules'), $modules_uri)
->addTextCrumb($title)
->setBorder(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment