@@ -142,47 +142,47 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | public function getImprintUrl() { |
| 145 | - return (string)$this->config->getAppValue('theming', 'imprintUrl', ''); |
|
| 145 | + return (string) $this->config->getAppValue('theming', 'imprintUrl', ''); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | public function getPrivacyUrl() { |
| 149 | - return (string)$this->config->getAppValue('theming', 'privacyUrl', ''); |
|
| 149 | + return (string) $this->config->getAppValue('theming', 'privacyUrl', ''); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | public function getShortFooter() { |
| 153 | 153 | $slogan = $this->getSlogan(); |
| 154 | 154 | $baseUrl = $this->getBaseUrl(); |
| 155 | 155 | if ($baseUrl !== '') { |
| 156 | - $footer = '<a href="' . $baseUrl . '" target="_blank"' . |
|
| 157 | - ' rel="noreferrer noopener" class="entity-name">' . $this->getEntity() . '</a>'; |
|
| 156 | + $footer = '<a href="'.$baseUrl.'" target="_blank"'. |
|
| 157 | + ' rel="noreferrer noopener" class="entity-name">'.$this->getEntity().'</a>'; |
|
| 158 | 158 | } else { |
| 159 | - $footer = '<span class="entity-name">' .$this->getEntity() . '</span>'; |
|
| 159 | + $footer = '<span class="entity-name">'.$this->getEntity().'</span>'; |
|
| 160 | 160 | } |
| 161 | - $footer .= ($slogan !== '' ? ' – ' . $slogan : ''); |
|
| 161 | + $footer .= ($slogan !== '' ? ' – '.$slogan : ''); |
|
| 162 | 162 | |
| 163 | 163 | $links = [ |
| 164 | 164 | [ |
| 165 | 165 | 'text' => $this->l->t('Legal notice'), |
| 166 | - 'url' => (string)$this->getImprintUrl() |
|
| 166 | + 'url' => (string) $this->getImprintUrl() |
|
| 167 | 167 | ], |
| 168 | 168 | [ |
| 169 | 169 | 'text' => $this->l->t('Privacy policy'), |
| 170 | - 'url' => (string)$this->getPrivacyUrl() |
|
| 170 | + 'url' => (string) $this->getPrivacyUrl() |
|
| 171 | 171 | ], |
| 172 | 172 | ]; |
| 173 | 173 | |
| 174 | 174 | $legalLinks = ''; $divider = ''; |
| 175 | - foreach($links as $link) { |
|
| 176 | - if($link['url'] !== '' |
|
| 175 | + foreach ($links as $link) { |
|
| 176 | + if ($link['url'] !== '' |
|
| 177 | 177 | && filter_var($link['url'], FILTER_VALIDATE_URL) |
| 178 | 178 | ) { |
| 179 | - $legalLinks .= $divider . '<a href="' . $link['url'] . '" class="legal" target="_blank"' . |
|
| 180 | - ' rel="noreferrer noopener">' . $link['text'] . '</a>'; |
|
| 179 | + $legalLinks .= $divider.'<a href="'.$link['url'].'" class="legal" target="_blank"'. |
|
| 180 | + ' rel="noreferrer noopener">'.$link['text'].'</a>'; |
|
| 181 | 181 | $divider = ' · '; |
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | - if($legalLinks !== '' ) { |
|
| 185 | - $footer .= '<br/>' . $legalLinks; |
|
| 184 | + if ($legalLinks !== '') { |
|
| 185 | + $footer .= '<br/>'.$legalLinks; |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | return $footer; |
@@ -215,16 +215,16 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | $cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0'); |
| 217 | 217 | |
| 218 | - if(!$logo || !$logoExists) { |
|
| 219 | - if($useSvg) { |
|
| 218 | + if (!$logo || !$logoExists) { |
|
| 219 | + if ($useSvg) { |
|
| 220 | 220 | $logo = $this->urlGenerator->imagePath('core', 'logo.svg'); |
| 221 | 221 | } else { |
| 222 | 222 | $logo = $this->urlGenerator->imagePath('core', 'logo.png'); |
| 223 | 223 | } |
| 224 | - return $logo . '?v=' . $cacheBusterCounter; |
|
| 224 | + return $logo.'?v='.$cacheBusterCounter; |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => 'logo', 'useSvg' => $useSvg, 'v' => $cacheBusterCounter ]); |
|
| 227 | + return $this->urlGenerator->linkToRoute('theming.Theming.getImage', ['key' => 'logo', 'useSvg' => $useSvg, 'v' => $cacheBusterCounter]); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /** |
@@ -262,17 +262,17 @@ discard block |
||
| 262 | 262 | * @return array scss variables to overwrite |
| 263 | 263 | */ |
| 264 | 264 | public function getScssVariables() { |
| 265 | - $cache = $this->cacheFactory->createDistributed('theming-' . $this->urlGenerator->getBaseUrl()); |
|
| 265 | + $cache = $this->cacheFactory->createDistributed('theming-'.$this->urlGenerator->getBaseUrl()); |
|
| 266 | 266 | if ($value = $cache->get('getScssVariables')) { |
| 267 | 267 | return $value; |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | $variables = [ |
| 271 | - 'theming-cachebuster' => "'" . $this->config->getAppValue('theming', 'cachebuster', '0') . "'", |
|
| 272 | - 'theming-logo-mime' => "'" . $this->config->getAppValue('theming', 'logoMime') . "'", |
|
| 273 | - 'theming-background-mime' => "'" . $this->config->getAppValue('theming', 'backgroundMime') . "'", |
|
| 274 | - 'theming-logoheader-mime' => "'" . $this->config->getAppValue('theming', 'logoheaderMime') . "'", |
|
| 275 | - 'theming-favicon-mime' => "'" . $this->config->getAppValue('theming', 'faviconMime') . "'" |
|
| 271 | + 'theming-cachebuster' => "'".$this->config->getAppValue('theming', 'cachebuster', '0')."'", |
|
| 272 | + 'theming-logo-mime' => "'".$this->config->getAppValue('theming', 'logoMime')."'", |
|
| 273 | + 'theming-background-mime' => "'".$this->config->getAppValue('theming', 'backgroundMime')."'", |
|
| 274 | + 'theming-logoheader-mime' => "'".$this->config->getAppValue('theming', 'logoheaderMime')."'", |
|
| 275 | + 'theming-favicon-mime' => "'".$this->config->getAppValue('theming', 'faviconMime')."'" |
|
| 276 | 276 | ]; |
| 277 | 277 | |
| 278 | 278 | $variables['image-logo'] = "url('".$this->imageManager->getImageUrl('logo')."')"; |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | $variables['has-legal-links'] = 'false'; |
| 295 | - if($this->getImprintUrl() !== '' || $this->getPrivacyUrl() !== '') { |
|
| 295 | + if ($this->getImprintUrl() !== '' || $this->getPrivacyUrl() !== '') { |
|
| 296 | 296 | $variables['has-legal-links'] = 'true'; |
| 297 | 297 | } |
| 298 | 298 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | * @return bool|string false if image should not replaced, otherwise the location of the image |
| 310 | 310 | */ |
| 311 | 311 | public function replaceImagePath($app, $image) { |
| 312 | - if($app==='') { |
|
| 312 | + if ($app === '') { |
|
| 313 | 313 | $app = 'core'; |
| 314 | 314 | } |
| 315 | 315 | $cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0'); |
@@ -321,19 +321,19 @@ discard block |
||
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | if ($image === 'favicon.ico' && ($customFavicon !== null || $this->imageManager->shouldReplaceIcons())) { |
| 324 | - return $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]) . '?v=' . $cacheBusterValue; |
|
| 324 | + return $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]).'?v='.$cacheBusterValue; |
|
| 325 | 325 | } |
| 326 | 326 | if ($image === 'favicon-touch.png' && ($customFavicon !== null || $this->imageManager->shouldReplaceIcons())) { |
| 327 | - return $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]) . '?v=' . $cacheBusterValue; |
|
| 327 | + return $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]).'?v='.$cacheBusterValue; |
|
| 328 | 328 | } |
| 329 | 329 | if ($image === 'manifest.json') { |
| 330 | 330 | try { |
| 331 | 331 | $appPath = $this->appManager->getAppPath($app); |
| 332 | - if (file_exists($appPath . '/img/manifest.json')) { |
|
| 332 | + if (file_exists($appPath.'/img/manifest.json')) { |
|
| 333 | 333 | return false; |
| 334 | 334 | } |
| 335 | 335 | } catch (AppPathNotFoundException $e) {} |
| 336 | - return $this->urlGenerator->linkToRoute('theming.Theming.getManifest') . '?v=' . $cacheBusterValue; |
|
| 336 | + return $this->urlGenerator->linkToRoute('theming.Theming.getManifest').'?v='.$cacheBusterValue; |
|
| 337 | 337 | } |
| 338 | 338 | return false; |
| 339 | 339 | } |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | */ |
| 344 | 344 | private function increaseCacheBuster() { |
| 345 | 345 | $cacheBusterKey = $this->config->getAppValue('theming', 'cachebuster', '0'); |
| 346 | - $this->config->setAppValue('theming', 'cachebuster', (int)$cacheBusterKey+1); |
|
| 346 | + $this->config->setAppValue('theming', 'cachebuster', (int) $cacheBusterKey + 1); |
|
| 347 | 347 | $this->cacheFactory->createDistributed('theming-')->clear(); |
| 348 | 348 | $this->cacheFactory->createDistributed('imagePath')->clear(); |
| 349 | 349 | |