diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2019-09-18 00:56:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-18 00:56:50 +0200 |
commit | b636aa79c32bd96d8087813b1797ed03d16a3da0 (patch) | |
tree | 4f6c4d76482cb9753691c09704a92a07025ec967 /apps/accessibility/lib/Controller/ConfigController.php | |
parent | 7549f5e4d1ac63d5d0f385f600ae0ce79158be00 (diff) | |
parent | d75fbab5d21cade3174466bf9a80d42da1f42a44 (diff) | |
download | nextcloud-server-b636aa79c32bd96d8087813b1797ed03d16a3da0.tar.gz nextcloud-server-b636aa79c32bd96d8087813b1797ed03d16a3da0.zip |
Add theme class to body and fix for theme selection (#16929)
Add theme class to body and fix for theme selection
Diffstat (limited to 'apps/accessibility/lib/Controller/ConfigController.php')
-rw-r--r-- | apps/accessibility/lib/Controller/ConfigController.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/accessibility/lib/Controller/ConfigController.php b/apps/accessibility/lib/Controller/ConfigController.php index 1fe2c4fbc13..d98ba231fa8 100644 --- a/apps/accessibility/lib/Controller/ConfigController.php +++ b/apps/accessibility/lib/Controller/ConfigController.php @@ -2,6 +2,7 @@ declare (strict_types = 1); /** * @copyright Copyright (c) 2018 John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> + * @copyright Copyright (c) 2019 Janis Köhr <janiskoehr@icloud.com> * * @license GNU AGPL version 3 or any later version * @@ -83,6 +84,7 @@ class ConfigController extends OCSController { */ public function getConfig(): DataResponse { return new DataResponse([ + 'highcontrast' => $this->config->getUserValue($this->userId, $this->appName, 'highcontrast', false), 'theme' => $this->config->getUserValue($this->userId, $this->appName, 'theme', false), 'font' => $this->config->getUserValue($this->userId, $this->appName, 'font', false) ]); @@ -98,7 +100,7 @@ class ConfigController extends OCSController { * @throws Exception */ public function setConfig(string $key, $value): DataResponse { - if ($key === 'theme' || $key === 'font') { + if ($key === 'theme' || $key === 'font' || $key === 'highcontrast') { if ($value === false) { $this->config->deleteUserValue($this->userId, $this->appName, $key); @@ -113,11 +115,12 @@ class ConfigController extends OCSController { } $themes = $this->accessibilityProvider->getThemes(); + $highcontrast = array($this->accessibilityProvider->getHighContrast()); $fonts = $this->accessibilityProvider->getFonts(); $availableOptions = array_map(function($option) { return $option['id']; - }, array_merge($themes, $fonts)); + }, array_merge($themes, $highcontrast, $fonts)); if (in_array($value, $availableOptions)) { $this->config->setUserValue($this->userId, $this->appName, $key, $value); @@ -130,4 +133,4 @@ class ConfigController extends OCSController { throw new OCSBadRequestException('Invalid key: ' . $key); } -}
\ No newline at end of file +} |