diff --git a/apps/accessibility/js/accessibility.js b/apps/accessibility/js/accessibility.js index 1303fba27ee40a954b6008388308783aab58f9bd..6e0b9c3958d033ee8a1db39993595e7fde1ff40e 100644 Binary files a/apps/accessibility/js/accessibility.js and b/apps/accessibility/js/accessibility.js differ diff --git a/apps/accessibility/js/accessibility.js.map b/apps/accessibility/js/accessibility.js.map index 5c54f18579dfe22773d552592f8b7e2be977e36c..cafc3dd859483568f14294f923b58816ac69736a 100644 Binary files a/apps/accessibility/js/accessibility.js.map and b/apps/accessibility/js/accessibility.js.map differ diff --git a/apps/accessibility/lib/AppInfo/Application.php b/apps/accessibility/lib/AppInfo/Application.php index e87341b6c1c8234fd27a38cde374fb172d0e182c..e884acad0af97cfd8ebc48234a0b0e79b2c8c0d5 100644 --- a/apps/accessibility/lib/AppInfo/Application.php +++ b/apps/accessibility/lib/AppInfo/Application.php @@ -31,7 +31,7 @@ use OCP\IURLGenerator; class Application extends App { /** @var string */ - protected $appName = 'accessibility'; + public const APP_NAME = 'accessibility'; /** @var IConfig */ private $config; @@ -43,7 +43,7 @@ class Application extends App { private $urlGenerator; public function __construct() { - parent::__construct($this->appName); + parent::__construct(self::APP_NAME); $this->config = \OC::$server->getConfig(); $this->userSession = \OC::$server->getUserSession(); $this->urlGenerator = \OC::$server->getURLGenerator(); @@ -53,11 +53,11 @@ class Application extends App { // Inject the fake css on all pages if enabled and user is logged $loggedUser = $this->userSession->getUser(); if (!is_null($loggedUser)) { - $userValues = $this->config->getUserKeys($loggedUser->getUID(), $this->appName); + $userValues = $this->config->getUserKeys($loggedUser->getUID(), self::APP_NAME); // we want to check if any theme or font is enabled. if (count($userValues) > 0) { - $hash = $this->config->getUserValue($loggedUser->getUID(), $this->appName, 'icons-css', md5(implode('-', $userValues))); - $linkToCSS = $this->urlGenerator->linkToRoute($this->appName . '.accessibility.getCss', ['md5' => $hash]); + $hash = $this->config->getUserValue($loggedUser->getUID(), self::APP_NAME, 'icons-css', md5(implode('-', $userValues))); + $linkToCSS = $this->urlGenerator->linkToRoute(self::APP_NAME . '.accessibility.getCss', ['md5' => $hash]); \OCP\Util::addHeader('link', ['rel' => 'stylesheet', 'href' => $linkToCSS]); } } @@ -65,7 +65,7 @@ class Application extends App { public function injectJavascript() { $linkToJs = $this->urlGenerator->linkToRoute( - $this->appName . '.accessibility.getJavascript', + self::APP_NAME . '.accessibility.getJavascript', [ 'v' => \OC::$server->getConfig()->getAppValue('accessibility', 'cachebuster', '0'), ] diff --git a/apps/accessibility/lib/Migration/RepairUserConfig.php b/apps/accessibility/lib/Migration/RepairUserConfig.php index 0f80927839d049b74e6dde7e796fd94aafa25792..bd409f94d475fc871e887dbb70dc76cd7a9372e3 100644 --- a/apps/accessibility/lib/Migration/RepairUserConfig.php +++ b/apps/accessibility/lib/Migration/RepairUserConfig.php @@ -22,6 +22,7 @@ declare (strict_types = 1); namespace OCA\Accessibility\Migration; +use OCA\Accessibility\AppInfo\Application; use OCP\IConfig; use OCP\IUser; use OCP\IUserManager; @@ -30,9 +31,6 @@ use OCP\Migration\IRepairStep; class RepairUserConfig implements IRepairStep { - /** @var string */ - private const APP_NAME = 'accessibility'; - /** @var IUserManager */ protected $userManager; @@ -72,13 +70,13 @@ class RepairUserConfig implements IRepairStep { public function run(IOutput $output) { $output->startProgress(); $this->userManager->callForSeenUsers(function(IUser $user) use ($output) { - $theme = $this->config->getUserValue($user->getUID(), self::APP_NAME, 'theme', false); + $theme = $this->config->getUserValue($user->getUID(), Application::APP_NAME, 'theme', false); if ($theme === 'themedark') { - $this->config->setUserValue($user->getUID(), self::APP_NAME, 'theme', 'dark'); + $this->config->setUserValue($user->getUID(), Application::APP_NAME, 'theme', 'dark'); } if ($theme === 'themehighcontrast') { - $this->config->setUserValue($user->getUID(), self::APP_NAME, 'highcontrast', 'highcontrast'); - $this->config->deleteUserValue($user->getUID(), self::APP_NAME, 'theme'); + $this->config->setUserValue($user->getUID(), Application::APP_NAME, 'highcontrast', 'highcontrast'); + $this->config->deleteUserValue($user->getUID(), Application::APP_NAME, 'theme'); } $output->advance(); });