navigationManager = $navigationManager; $this->settingsManager = $settingsManager; $this->userSession = $userSession; $this->subAdmin = $subAdmin; $this->groupManager = $groupManager; $this->declarativeSettingsManager = $declarativeSettingsManager; $this->initialState = $initialState; } /** * @NoSubAdminRequired */ #[NoAdminRequired] #[NoCSRFRequired] public function index(string $section): TemplateResponse { return $this->getIndexResponse('personal', $section); } /** * @param string $section * @return array */ protected function getSettings($section) { $settings = $this->settingsManager->getPersonalSettings($section); $formatted = $this->formatSettings($settings); if ($section === 'additional') { $formatted['content'] .= $this->getLegacyForms(); } return $formatted; } /** * @return bool|string */ private function getLegacyForms() { $forms = \OC_App::getForms('personal'); $forms = array_map(function ($form) { if (preg_match('%([^>]*)>.*?)%i', $form, $regs)) { $sectionName = str_replace('', '', $regs[0]); $sectionName = str_replace('', '', $sectionName); $anchor = strtolower($sectionName); $anchor = str_replace(' ', '-', $anchor); return [ 'anchor' => $anchor, 'section-name' => $sectionName, 'form' => $form ]; } return [ 'form' => $form ]; }, $forms); $out = new Template('settings', 'settings/additional'); $out->assign('forms', $forms); return $out->fetchPage(); } }