@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | '--color-text-light' => $colorMainText, |
136 | 136 | '--color-text-lighter' => $this->util->lighten($colorMainText, 33), |
137 | 137 | |
138 | - '--color-scrollbar' => 'rgba(' . $colorMainTextRgb . ', .15)', |
|
138 | + '--color-scrollbar' => 'rgba('.$colorMainTextRgb.', .15)', |
|
139 | 139 | |
140 | 140 | // info/warning/success feedback colours |
141 | 141 | '--color-error' => '#e9322d', |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | '--background-image-invert-if-bright' => 'no', |
193 | 193 | |
194 | 194 | // Default last fallback values |
195 | - '--image-background' => "url('" . $this->urlGenerator->imagePath('core', 'app-background.jpg') . "')", |
|
196 | - '--image-background-default' => "url('" . $this->urlGenerator->imagePath('core', 'app-background.jpg') . "')", |
|
195 | + '--image-background' => "url('".$this->urlGenerator->imagePath('core', 'app-background.jpg')."')", |
|
196 | + '--image-background-default' => "url('".$this->urlGenerator->imagePath('core', 'app-background.jpg')."')", |
|
197 | 197 | '--color-background-plain' => $this->defaultPrimaryColor, |
198 | 198 | ]; |
199 | 199 |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | continue; |
109 | 109 | } |
110 | 110 | $variables['--image-background-size'] = 'cover'; |
111 | - $variables['--image-background-default'] = "url('" . $imageUrl . "')"; |
|
111 | + $variables['--image-background-default'] = "url('".$imageUrl."')"; |
|
112 | 112 | } |
113 | - $variables["--image-$image"] = "url('" . $imageUrl . "')"; |
|
113 | + $variables["--image-$image"] = "url('".$imageUrl."')"; |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
@@ -130,13 +130,13 @@ discard block |
||
130 | 130 | && !$this->themingDefaults->isUserThemingDisabled() |
131 | 131 | && $this->appManager->isEnabledForUser(Application::APP_ID)) { |
132 | 132 | $themingBackground = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'background', 'default'); |
133 | - $currentVersion = (int)$this->config->getUserValue($user->getUID(), Application::APP_ID, 'userCacheBuster', '0'); |
|
133 | + $currentVersion = (int) $this->config->getUserValue($user->getUID(), Application::APP_ID, 'userCacheBuster', '0'); |
|
134 | 134 | |
135 | 135 | // The user uploaded a custom background |
136 | 136 | if ($themingBackground === 'custom') { |
137 | - $cacheBuster = substr(sha1($user->getUID() . '_' . $currentVersion), 0, 8); |
|
137 | + $cacheBuster = substr(sha1($user->getUID().'_'.$currentVersion), 0, 8); |
|
138 | 138 | return [ |
139 | - '--image-background' => "url('" . $this->urlGenerator->linkToRouteAbsolute('theming.userTheme.getBackground') . "?v=$cacheBuster')", |
|
139 | + '--image-background' => "url('".$this->urlGenerator->linkToRouteAbsolute('theming.userTheme.getBackground')."?v=$cacheBuster')", |
|
140 | 140 | // TODO: implement primary color from custom background --color-background-plain |
141 | 141 | ]; |
142 | 142 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | // The user picked a shipped background |
145 | 145 | if (isset(BackgroundService::SHIPPED_BACKGROUNDS[$themingBackground])) { |
146 | 146 | return [ |
147 | - '--image-background' => "url('" . $this->urlGenerator->linkTo(Application::APP_ID, "/img/background/$themingBackground") . "')", |
|
147 | + '--image-background' => "url('".$this->urlGenerator->linkTo(Application::APP_ID, "/img/background/$themingBackground")."')", |
|
148 | 148 | '--color-background-plain' => $this->themingDefaults->getColorPrimary(), |
149 | 149 | '--background-image-invert-if-bright' => BackgroundService::SHIPPED_BACKGROUNDS[$themingBackground]['theming'] ?? null === BackgroundService::THEMING_MODE_DARK ? 'invert(100%)' : 'no', |
150 | 150 | ]; |
@@ -77,16 +77,16 @@ discard block |
||
77 | 77 | public function getImageUrl(string $key, bool $useSvg = true): string { |
78 | 78 | $cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0'); |
79 | 79 | if ($this->hasImage($key)) { |
80 | - return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => $key ]) . '?v=' . $cacheBusterCounter; |
|
80 | + return $this->urlGenerator->linkToRoute('theming.Theming.getImage', ['key' => $key]).'?v='.$cacheBusterCounter; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | switch ($key) { |
84 | 84 | case 'logo': |
85 | 85 | case 'logoheader': |
86 | 86 | case 'favicon': |
87 | - return $this->urlGenerator->imagePath('core', 'logo/logo.png') . '?v=' . $cacheBusterCounter; |
|
87 | + return $this->urlGenerator->imagePath('core', 'logo/logo.png').'?v='.$cacheBusterCounter; |
|
88 | 88 | case 'background': |
89 | - return $this->urlGenerator->imagePath('core', 'background.png') . '?v=' . $cacheBusterCounter; |
|
89 | + return $this->urlGenerator->imagePath('core', 'background.png').'?v='.$cacheBusterCounter; |
|
90 | 90 | } |
91 | 91 | return ''; |
92 | 92 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @throws NotPermittedException |
104 | 104 | */ |
105 | 105 | public function getImage(string $key, bool $useSvg = true): ISimpleFile { |
106 | - $logo = $this->config->getAppValue('theming', $key . 'Mime', ''); |
|
106 | + $logo = $this->config->getAppValue('theming', $key.'Mime', ''); |
|
107 | 107 | $folder = $this->getRootFolder()->getFolder('images'); |
108 | 108 | |
109 | 109 | if ($logo === '' || !$folder->fileExists($key)) { |
@@ -111,20 +111,20 @@ discard block |
||
111 | 111 | } |
112 | 112 | |
113 | 113 | if (!$useSvg && $this->shouldReplaceIcons()) { |
114 | - if (!$folder->fileExists($key . '.png')) { |
|
114 | + if (!$folder->fileExists($key.'.png')) { |
|
115 | 115 | try { |
116 | 116 | $finalIconFile = new \Imagick(); |
117 | 117 | $finalIconFile->setBackgroundColor('none'); |
118 | 118 | $finalIconFile->readImageBlob($folder->getFile($key)->getContent()); |
119 | 119 | $finalIconFile->setImageFormat('png32'); |
120 | - $pngFile = $folder->newFile($key . '.png'); |
|
120 | + $pngFile = $folder->newFile($key.'.png'); |
|
121 | 121 | $pngFile->putContent($finalIconFile->getImageBlob()); |
122 | 122 | return $pngFile; |
123 | 123 | } catch (\ImagickException $e) { |
124 | - $this->logger->info('The image was requested to be no SVG file, but converting it to PNG failed: ' . $e->getMessage()); |
|
124 | + $this->logger->info('The image was requested to be no SVG file, but converting it to PNG failed: '.$e->getMessage()); |
|
125 | 125 | } |
126 | 126 | } else { |
127 | - return $folder->getFile($key . '.png'); |
|
127 | + return $folder->getFile($key.'.png'); |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | } |
133 | 133 | |
134 | 134 | public function hasImage(string $key): bool { |
135 | - $mimeSetting = $this->config->getAppValue('theming', $key . 'Mime', ''); |
|
135 | + $mimeSetting = $this->config->getAppValue('theming', $key.'Mime', ''); |
|
136 | 136 | return $mimeSetting !== ''; |
137 | 137 | } |
138 | 138 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | } catch (NotPermittedException $e) { |
196 | 196 | } |
197 | 197 | try { |
198 | - $file = $this->getRootFolder()->getFolder('images')->getFile($key . '.png'); |
|
198 | + $file = $this->getRootFolder()->getFolder('images')->getFile($key.'.png'); |
|
199 | 199 | $file->delete(); |
200 | 200 | } catch (NotFoundException $e) { |
201 | 201 | } catch (NotPermittedException $e) { |
@@ -228,8 +228,8 @@ discard block |
||
228 | 228 | imagealphablending($newImage, true); |
229 | 229 | |
230 | 230 | $tmpFile = $this->tempManager->getTemporaryFile(); |
231 | - $newWidth = (int)(imagesx($newImage) < 4096 ? imagesx($newImage) : 4096); |
|
232 | - $newHeight = (int)(imagesy($newImage) / (imagesx($newImage) / $newWidth)); |
|
231 | + $newWidth = (int) (imagesx($newImage) < 4096 ? imagesx($newImage) : 4096); |
|
232 | + $newHeight = (int) (imagesy($newImage) / (imagesx($newImage) / $newWidth)); |
|
233 | 233 | $outputImage = imagescale($newImage, $newWidth, $newHeight); |
234 | 234 | |
235 | 235 | imageinterlace($outputImage, 1); |
@@ -290,9 +290,9 @@ discard block |
||
290 | 290 | * @return bool |
291 | 291 | */ |
292 | 292 | public function shouldReplaceIcons() { |
293 | - $cache = $this->cacheFactory->createDistributed('theming-' . $this->urlGenerator->getBaseUrl()); |
|
293 | + $cache = $this->cacheFactory->createDistributed('theming-'.$this->urlGenerator->getBaseUrl()); |
|
294 | 294 | if ($value = $cache->get('shouldReplaceIcons')) { |
295 | - return (bool)$value; |
|
295 | + return (bool) $value; |
|
296 | 296 | } |
297 | 297 | $value = false; |
298 | 298 | if (extension_loaded('imagick')) { |