userId = $userId; $this->l10n = $l10n; $this->configManager = $configManager; } /** * @brief set preference for file type association * * @NoAdminRequired * * @param string $EpubEnable * @param string $PdfEnable * @param string $CbxEnable */ public function setPreference(string $EpubEnable, string $PdfEnable, string $CbxEnable): JSONResponse { $this->configManager->setUserValue($this->userId, Application::APP_ID, 'epub_enable', $EpubEnable); $this->configManager->setUserValue($this->userId, Application::APP_ID, 'pdf_enable', $PdfEnable); $this->configManager->setUserValue($this->userId, Application::APP_ID, 'cbx_enable', $CbxEnable); $response = [ 'data' => ['message' => $this->l10n->t('Settings updated successfully.')], 'status' => 'success' ]; return new JSONResponse($response); } }