@ -167,7 +167,7 @@ class AccessibilityController extends Controller {
$appWebRoot = substr($this->appRoot, strlen($this->serverRoot) - strlen(\OC::$WEBROOT));
$css = $this->rebaseUrls($css, $appWebRoot . '/css');
if (in_array('theme dark', $userValues) & & $this->iconsCacher->getCachedList() & & $this->iconsCacher->getCachedList()->getSize() > 0) {
if (in_array('dark', $userValues) & & $this->iconsCacher->getCachedList() & & $this->iconsCacher->getCachedList()->getSize() > 0) {
$iconsCss = $this->invertSvgIconsColor($this->iconsCacher->getCachedList()->getContent());
$css = $css . $iconsCss;
}
@ -201,16 +201,27 @@ class AccessibilityController extends Controller {
if ($user === null) {
$theme = false;
$highcontrast = false;
} else {
$theme = $this->config->getUserValue($user->getUID(), $this->appName, 'theme', false);
$highcontrast = $this->config->getUserValue($user->getUID(), $this->appName, 'highcontrast', false) !== false;
}
$responseJS = '(function() {
if ($theme !== false) {
$responseJS = '(function() {
OCA.Accessibility = {
highcontrast: ' . json_encode($highcontrast) . ',
theme: ' . json_encode($theme) . ',
};
document.body.classList.add(' . json_encode($theme) . ');
})();';
} else {
$responseJS = '(function() {
OCA.Accessibility = {
highcontrast: ' . json_encode($highcontrast) . ',
theme: ' . json_encode($theme) . ',
};
})();';
}
$response = new DataDownloadResponse($responseJS, 'javascript', 'text/javascript');
$response->cacheFor(3600);
return $response;
@ -224,8 +235,9 @@ class AccessibilityController extends Controller {
private function getUserValues(): array{
$userTheme = $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'theme', false);
$userFont = $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'font', false);
$userHighContrast = $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'highcontrast', false);
return [$userTheme, $userFont];
return [$userTheme, $userHighContrast, $user Font];
}
/**