diff options
Diffstat (limited to 'apps/theming/lib')
-rw-r--r-- | apps/theming/lib/Controller/ThemingController.php | 14 | ||||
-rw-r--r-- | apps/theming/lib/ThemingDefaults.php | 5 |
2 files changed, 19 insertions, 0 deletions
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index faaff1f2174..1b3420f3cb7 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -185,6 +185,20 @@ class ThemingController extends Controller { * @return DataResponse */ public function updateLogo() { + $backgroundColor = $this->request->getParam('backgroundColor'); + if($backgroundColor) { + $this->themingDefaults->set('backgroundMime', 'backgroundColor'); + return new DataResponse( + [ + 'data' => + [ + 'name' => 'backgroundColor', + 'message' => $this->l10n->t('Saved') + ], + 'status' => 'success' + ] + ); + } $newLogo = $this->request->getUploadedFile('uploadlogo'); $newBackgroundLogo = $this->request->getUploadedFile('upload-login-background'); if (empty($newLogo) && empty($newBackgroundLogo)) { diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php index 39547af4916..9509fc11077 100644 --- a/apps/theming/lib/ThemingDefaults.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -190,6 +190,7 @@ class ThemingDefaults extends \OC_Defaults { $variables['image-logo'] = "'".$this->urlGenerator->getAbsoluteURL($this->getLogo())."'"; $variables['image-login-background'] = "'".$this->urlGenerator->getAbsoluteURL($this->getBackground())."'"; + $variables['image-login-plain'] = 'false'; if ($this->config->getAppValue('theming', 'color', null) !== null) { if ($this->util->invertTextColor($this->getColorPrimary())) { @@ -200,6 +201,10 @@ class ThemingDefaults extends \OC_Defaults { $variables['color-primary'] = $this->getColorPrimary(); $variables['color-primary-text'] = $colorPrimaryText; } + + if ($this->config->getAppValue('theming', 'backgroundMime', null) === 'backgroundColor') { + $variables['image-login-plain'] = 'true'; + } $cache->set('getScssVariables', $variables); return $variables; } |