@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | } |
104 | 104 | $variables['--image-background-size'] = 'cover'; |
105 | 105 | } |
106 | - $variables["--image-$image"] = "url('" . $imageUrl . "')"; |
|
106 | + $variables["--image-$image"] = "url('".$imageUrl."')"; |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
@@ -123,13 +123,13 @@ discard block |
||
123 | 123 | && !$this->themingDefaults->isUserThemingDisabled() |
124 | 124 | && $this->appManager->isEnabledForUser(Application::APP_ID)) { |
125 | 125 | $themingBackground = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'background', 'default'); |
126 | - $currentVersion = (int)$this->config->getUserValue($user->getUID(), Application::APP_ID, 'userCacheBuster', '0'); |
|
126 | + $currentVersion = (int) $this->config->getUserValue($user->getUID(), Application::APP_ID, 'userCacheBuster', '0'); |
|
127 | 127 | |
128 | 128 | // The user uploaded a custom background |
129 | 129 | if ($themingBackground === 'custom') { |
130 | - $cacheBuster = substr(sha1($user->getUID() . '_' . $currentVersion), 0, 8); |
|
130 | + $cacheBuster = substr(sha1($user->getUID().'_'.$currentVersion), 0, 8); |
|
131 | 131 | return [ |
132 | - '--image-background' => "url('" . $this->urlGenerator->linkToRouteAbsolute('theming.userTheme.getBackground') . "?v=$cacheBuster')", |
|
132 | + '--image-background' => "url('".$this->urlGenerator->linkToRouteAbsolute('theming.userTheme.getBackground')."?v=$cacheBuster')", |
|
133 | 133 | // TODO: implement primary color from custom background --color-background-plain |
134 | 134 | ]; |
135 | 135 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | // The user picked a shipped background |
138 | 138 | if (isset(BackgroundService::SHIPPED_BACKGROUNDS[$themingBackground])) { |
139 | 139 | return [ |
140 | - '--image-background' => "url('" . $this->urlGenerator->linkTo(Application::APP_ID, "/img/background/$themingBackground") . "')", |
|
140 | + '--image-background' => "url('".$this->urlGenerator->linkTo(Application::APP_ID, "/img/background/$themingBackground")."')", |
|
141 | 141 | '--color-background-plain' => $this->themingDefaults->getColorPrimary(), |
142 | 142 | ]; |
143 | 143 | } |
@@ -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', |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | '--background-invert-if-bright' => 'invert(100%)', |
192 | 192 | |
193 | 193 | // Default last fallback values |
194 | - '--image-background' => "url('" . $this->urlGenerator->imagePath('core', 'app-background.jpg') . "')", |
|
194 | + '--image-background' => "url('".$this->urlGenerator->imagePath('core', 'app-background.jpg')."')", |
|
195 | 195 | '--color-background-plain' => $this->defaultPrimaryColor, |
196 | 196 | ]; |
197 | 197 |
@@ -78,16 +78,16 @@ discard block |
||
78 | 78 | public function getImageUrl(string $key, bool $useSvg = true): string { |
79 | 79 | $cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0'); |
80 | 80 | if ($this->hasImage($key)) { |
81 | - return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => $key ]) . '?v=' . $cacheBusterCounter; |
|
81 | + return $this->urlGenerator->linkToRoute('theming.Theming.getImage', ['key' => $key]).'?v='.$cacheBusterCounter; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | switch ($key) { |
85 | 85 | case 'logo': |
86 | 86 | case 'logoheader': |
87 | 87 | case 'favicon': |
88 | - return $this->urlGenerator->imagePath('core', 'logo/logo.png') . '?v=' . $cacheBusterCounter; |
|
88 | + return $this->urlGenerator->imagePath('core', 'logo/logo.png').'?v='.$cacheBusterCounter; |
|
89 | 89 | case 'background': |
90 | - return $this->urlGenerator->imagePath('core', 'background.png') . '?v=' . $cacheBusterCounter; |
|
90 | + return $this->urlGenerator->imagePath('core', 'background.png').'?v='.$cacheBusterCounter; |
|
91 | 91 | } |
92 | 92 | return ''; |
93 | 93 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * @throws NotPermittedException |
105 | 105 | */ |
106 | 106 | public function getImage(string $key, bool $useSvg = true): ISimpleFile { |
107 | - $logo = $this->config->getAppValue('theming', $key . 'Mime', ''); |
|
107 | + $logo = $this->config->getAppValue('theming', $key.'Mime', ''); |
|
108 | 108 | $folder = $this->getRootFolder()->getFolder('images'); |
109 | 109 | |
110 | 110 | if ($logo === '' || !$folder->fileExists($key)) { |
@@ -112,20 +112,20 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | if (!$useSvg && $this->shouldReplaceIcons()) { |
115 | - if (!$folder->fileExists($key . '.png')) { |
|
115 | + if (!$folder->fileExists($key.'.png')) { |
|
116 | 116 | try { |
117 | 117 | $finalIconFile = new \Imagick(); |
118 | 118 | $finalIconFile->setBackgroundColor('none'); |
119 | 119 | $finalIconFile->readImageBlob($folder->getFile($key)->getContent()); |
120 | 120 | $finalIconFile->setImageFormat('png32'); |
121 | - $pngFile = $folder->newFile($key . '.png'); |
|
121 | + $pngFile = $folder->newFile($key.'.png'); |
|
122 | 122 | $pngFile->putContent($finalIconFile->getImageBlob()); |
123 | 123 | return $pngFile; |
124 | 124 | } catch (\ImagickException $e) { |
125 | - $this->logger->info('The image was requested to be no SVG file, but converting it to PNG failed: ' . $e->getMessage()); |
|
125 | + $this->logger->info('The image was requested to be no SVG file, but converting it to PNG failed: '.$e->getMessage()); |
|
126 | 126 | } |
127 | 127 | } else { |
128 | - return $folder->getFile($key . '.png'); |
|
128 | + return $folder->getFile($key.'.png'); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | public function hasImage(string $key): bool { |
136 | - $mimeSetting = $this->config->getAppValue('theming', $key . 'Mime', ''); |
|
136 | + $mimeSetting = $this->config->getAppValue('theming', $key.'Mime', ''); |
|
137 | 137 | return $mimeSetting !== ''; |
138 | 138 | } |
139 | 139 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $images = []; |
145 | 145 | foreach ($this::SupportedImageKeys as $key) { |
146 | 146 | $images[$key] = [ |
147 | - 'mime' => $this->config->getAppValue('theming', $key . 'Mime', ''), |
|
147 | + 'mime' => $this->config->getAppValue('theming', $key.'Mime', ''), |
|
148 | 148 | 'url' => $this->getImageUrl($key), |
149 | 149 | ]; |
150 | 150 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | } catch (NotPermittedException $e) { |
211 | 211 | } |
212 | 212 | try { |
213 | - $file = $this->getRootFolder()->getFolder('images')->getFile($key . '.png'); |
|
213 | + $file = $this->getRootFolder()->getFolder('images')->getFile($key.'.png'); |
|
214 | 214 | $file->delete(); |
215 | 215 | } catch (NotFoundException $e) { |
216 | 216 | } catch (NotPermittedException $e) { |
@@ -243,8 +243,8 @@ discard block |
||
243 | 243 | imagealphablending($newImage, true); |
244 | 244 | |
245 | 245 | $tmpFile = $this->tempManager->getTemporaryFile(); |
246 | - $newWidth = (int)(imagesx($newImage) < 4096 ? imagesx($newImage) : 4096); |
|
247 | - $newHeight = (int)(imagesy($newImage) / (imagesx($newImage) / $newWidth)); |
|
246 | + $newWidth = (int) (imagesx($newImage) < 4096 ? imagesx($newImage) : 4096); |
|
247 | + $newHeight = (int) (imagesy($newImage) / (imagesx($newImage) / $newWidth)); |
|
248 | 248 | $outputImage = imagescale($newImage, $newWidth, $newHeight); |
249 | 249 | |
250 | 250 | imageinterlace($outputImage, 1); |
@@ -305,9 +305,9 @@ discard block |
||
305 | 305 | * @return bool |
306 | 306 | */ |
307 | 307 | public function shouldReplaceIcons() { |
308 | - $cache = $this->cacheFactory->createDistributed('theming-' . $this->urlGenerator->getBaseUrl()); |
|
308 | + $cache = $this->cacheFactory->createDistributed('theming-'.$this->urlGenerator->getBaseUrl()); |
|
309 | 309 | if ($value = $cache->get('shouldReplaceIcons')) { |
310 | - return (bool)$value; |
|
310 | + return (bool) $value; |
|
311 | 311 | } |
312 | 312 | $value = false; |
313 | 313 | if (extension_loaded('imagick')) { |