summaryrefslogtreecommitdiffstats
path: root/settings/Controller/AdminSettingsController.php
diff options
context:
space:
mode:
Diffstat (limited to 'settings/Controller/AdminSettingsController.php')
-rw-r--r--settings/Controller/AdminSettingsController.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/settings/Controller/AdminSettingsController.php b/settings/Controller/AdminSettingsController.php
index 68707addfe4..b6a6e74705f 100644
--- a/settings/Controller/AdminSettingsController.php
+++ b/settings/Controller/AdminSettingsController.php
@@ -83,6 +83,10 @@ class AdminSettingsController extends Controller {
}
private function getSettings($section) {
+ if($section === 'additional') {
+ return $this->getLegacyForms();
+ }
+
$settings = $this->settingsManager->getAdminSettings($section);
$html = '';
foreach ($settings as $prioritizedSettings) {
@@ -95,6 +99,33 @@ class AdminSettingsController extends Controller {
return ['content' => $html];
}
+ private function getLegacyForms() {
+ $forms = \OC_App::getForms('admin');
+
+ $forms = array_map(function ($form) {
+ if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) {
+ $sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]);
+ $sectionName = str_replace('</h2>', '', $sectionName);
+ $anchor = strtolower($sectionName);
+ $anchor = str_replace(' ', '-', $anchor);
+
+ return array(
+ 'anchor' => $anchor,
+ 'section-name' => $sectionName,
+ 'form' => $form
+ );
+ }
+ return array(
+ 'form' => $form
+ );
+ }, $forms);
+
+ $out = new \OCP\Template('settings', 'admin/additional');
+ $out->assign('forms', $forms);
+
+ return ['content' => $out->fetchPage()];
+ }
+
private function getNavigationParameters() {
$a = 'anchor';
$name = 'section-name';