From 474a4dcf530f7aa2859e0ef939d04a1cad2a64a4 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Sun, 18 Jun 2023 00:55:37 +0200 Subject: [PATCH] fix settings --- lib/Controller/PageController.php | 6 ++---- lib/Hooks.php | 6 +++--- lib/Settings/Personal.php | 6 +++--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 8293bfb..99e6bdd 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -65,8 +65,6 @@ class PageController extends Controller { /** * @PublicPage * @NoCSRFRequired - * - * @return TemplateResponse */ public function showReader(): TemplateResponse { $templates = [ @@ -124,8 +122,8 @@ class PageController extends Controller { * (this should be abstracted away in OC/NC IMnsHO) * * @param string $path path-fragment from url - * @return array - * @throws NotFoundException + * + * @throws NotFoundException|InvalidPathException */ private function getFileInfo(string $path): array { $count = 0; diff --git a/lib/Hooks.php b/lib/Hooks.php index b124ae6..4000c3f 100644 --- a/lib/Hooks.php +++ b/lib/Hooks.php @@ -55,9 +55,9 @@ class Hooks { /** @var array $array */ $array = ($isJson) ? json_decode((string) $settings['array']['oc_appconfig'], true) : $settings['array']['oc_appconfig']; $array['filesReader'] = [ - 'enableEpub' => Server::get(IConfig::class)->getUserValue($user->getUID(), Application::APP_ID, 'epub_enable', 'true'), - 'enablePdf' => Server::get(IConfig::class)->getUserValue($user->getUID(), Application::APP_ID, 'pdf_enable', 'true'), - 'enableCbx' => Server::get(IConfig::class)->getUserValue($user->getUID(), Application::APP_ID, 'cbx_enable', 'true'), + 'enableEpub' => Server::get(IConfig::class)->getUserValue($user->getUID(), Application::APP_ID, 'epub_enable', true), + 'enablePdf' => Server::get(IConfig::class)->getUserValue($user->getUID(), Application::APP_ID, 'pdf_enable', true), + 'enableCbx' => Server::get(IConfig::class)->getUserValue($user->getUID(), Application::APP_ID, 'cbx_enable', true), ]; $settings['array']['oc_appconfig'] = ($isJson) ? json_encode($array) : $array; } diff --git a/lib/Settings/Personal.php b/lib/Settings/Personal.php index 5220547..6d1291e 100644 --- a/lib/Settings/Personal.php +++ b/lib/Settings/Personal.php @@ -35,9 +35,9 @@ class Personal implements ISettings { */ public function getForm(): TemplateResponse { $parameters = [ - 'EpubEnable' => $this->configManager->getUserValue($this->userId, Application::APP_ID, 'epub_enable'), - 'PdfEnable' => $this->configManager->getUserValue($this->userId, Application::APP_ID, 'pdf_enable'), - 'CbxEnable' => $this->configManager->getUserValue($this->userId, Application::APP_ID, 'cbx_enable'), + 'EpubEnable' => $this->configManager->getUserValue($this->userId, Application::APP_ID, 'epub_enable', 'true'), + 'PdfEnable' => $this->configManager->getUserValue($this->userId, Application::APP_ID, 'pdf_enable', 'true'), + 'CbxEnable' => $this->configManager->getUserValue($this->userId, Application::APP_ID, 'cbx_enable', 'true'), ]; return new TemplateResponse(Application::APP_ID, 'settings-personal', $parameters, '');