diff options
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 +} |