summaryrefslogtreecommitdiffstats
path: root/apps/accessibility/lib/Controller/ConfigController.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/accessibility/lib/Controller/ConfigController.php')
-rw-r--r--apps/accessibility/lib/Controller/ConfigController.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/accessibility/lib/Controller/ConfigController.php b/apps/accessibility/lib/Controller/ConfigController.php
index 1fe2c4fbc13..cb15324f9c6 100644
--- a/apps/accessibility/lib/Controller/ConfigController.php
+++ b/apps/accessibility/lib/Controller/ConfigController.php
@@ -83,6 +83,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 +99,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 +114,12 @@ class ConfigController extends OCSController {
}
$themes = $this->accessibilityProvider->getThemes();
+ $highcontrast = $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 +132,4 @@ class ConfigController extends OCSController {
throw new OCSBadRequestException('Invalid key: ' . $key);
}
-} \ No newline at end of file
+}