fix settings

This commit is contained in:
Michel Roux 2023-06-18 00:55:37 +02:00
parent a88fd4e2fe
commit 474a4dcf53
3 changed files with 8 additions and 10 deletions

View File

@ -65,8 +65,6 @@ class PageController extends Controller {
/** /**
* @PublicPage * @PublicPage
* @NoCSRFRequired * @NoCSRFRequired
*
* @return TemplateResponse
*/ */
public function showReader(): TemplateResponse { public function showReader(): TemplateResponse {
$templates = [ $templates = [
@ -124,8 +122,8 @@ class PageController extends Controller {
* (this should be abstracted away in OC/NC IMnsHO) * (this should be abstracted away in OC/NC IMnsHO)
* *
* @param string $path path-fragment from url * @param string $path path-fragment from url
* @return array *
* @throws NotFoundException * @throws NotFoundException|InvalidPathException
*/ */
private function getFileInfo(string $path): array { private function getFileInfo(string $path): array {
$count = 0; $count = 0;

View File

@ -55,9 +55,9 @@ class Hooks {
/** @var array $array */ /** @var array $array */
$array = ($isJson) ? json_decode((string) $settings['array']['oc_appconfig'], true) : $settings['array']['oc_appconfig']; $array = ($isJson) ? json_decode((string) $settings['array']['oc_appconfig'], true) : $settings['array']['oc_appconfig'];
$array['filesReader'] = [ $array['filesReader'] = [
'enableEpub' => Server::get(IConfig::class)->getUserValue($user->getUID(), Application::APP_ID, 'epub_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'), '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'), 'enableCbx' => Server::get(IConfig::class)->getUserValue($user->getUID(), Application::APP_ID, 'cbx_enable', true),
]; ];
$settings['array']['oc_appconfig'] = ($isJson) ? json_encode($array) : $array; $settings['array']['oc_appconfig'] = ($isJson) ? json_encode($array) : $array;
} }

View File

@ -35,9 +35,9 @@ class Personal implements ISettings {
*/ */
public function getForm(): TemplateResponse { public function getForm(): TemplateResponse {
$parameters = [ $parameters = [
'EpubEnable' => $this->configManager->getUserValue($this->userId, Application::APP_ID, 'epub_enable'), 'EpubEnable' => $this->configManager->getUserValue($this->userId, Application::APP_ID, 'epub_enable', 'true'),
'PdfEnable' => $this->configManager->getUserValue($this->userId, Application::APP_ID, 'pdf_enable'), 'PdfEnable' => $this->configManager->getUserValue($this->userId, Application::APP_ID, 'pdf_enable', 'true'),
'CbxEnable' => $this->configManager->getUserValue($this->userId, Application::APP_ID, 'cbx_enable'), 'CbxEnable' => $this->configManager->getUserValue($this->userId, Application::APP_ID, 'cbx_enable', 'true'),
]; ];
return new TemplateResponse(Application::APP_ID, 'settings-personal', $parameters, ''); return new TemplateResponse(Application::APP_ID, 'settings-personal', $parameters, '');