@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | * @var array $_ |
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | -$getUserAvatar = static function (int $size) use ($_): string { |
|
| 7 | +$getUserAvatar = static function(int $size) use ($_): string { |
|
| 8 | 8 | return \OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', [ |
| 9 | 9 | 'userId' => $_['user_uid'], |
| 10 | 10 | 'size' => $size, |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | <meta charset="utf-8"> |
| 19 | 19 | <title> |
| 20 | 20 | <?php |
| 21 | - p(!empty($_['application'])?$_['application'].' - ':''); |
|
| 21 | + p(!empty($_['application']) ? $_['application'].' - ' : ''); |
|
| 22 | 22 | p($theme->getTitle()); |
| 23 | 23 | ?> |
| 24 | 24 | </title> |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | <?php } ?> |
| 29 | 29 | <meta name="apple-mobile-web-app-capable" content="yes"> |
| 30 | 30 | <meta name="apple-mobile-web-app-status-bar-style" content="black"> |
| 31 | - <meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid'] != 'files')? $_['application']:$theme->getTitle()); ?>"> |
|
| 31 | + <meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid'] != 'files') ? $_['application'] : $theme->getTitle()); ?>"> |
|
| 32 | 32 | <meta name="mobile-web-app-capable" content="yes"> |
| 33 | 33 | <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>"> |
| 34 | 34 | <link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>"> |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | <?php emit_script_loading_tags($_); ?> |
| 41 | 41 | <?php print_unescaped($_['headers']); ?> |
| 42 | 42 | </head> |
| 43 | - <body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) { |
|
| 43 | + <body id="<?php p($_['bodyid']); ?>" <?php foreach ($_['enabledThemes'] as $themeId) { |
|
| 44 | 44 | p("data-theme-$themeId "); |
| 45 | 45 | }?>> |
| 46 | 46 | <?php include 'layout.noscript.warning.php'; ?> |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | id="nextcloud"> |
| 62 | 62 | <div class="logo logo-icon"> |
| 63 | 63 | <h1 class="hidden-visually"> |
| 64 | - <?php p($theme->getName()); ?> <?php p(!empty($_['application'])?$_['application']: $l->t('Apps')); ?> |
|
| 64 | + <?php p($theme->getName()); ?> <?php p(!empty($_['application']) ? $_['application'] : $l->t('Apps')); ?> |
|
| 65 | 65 | </h1> |
| 66 | 66 | </div> |
| 67 | 67 | </a> |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | <circle r="4.5" cx="21" cy="3" fill="black"/> |
| 81 | 81 | </mask> |
| 82 | 82 | </defs> |
| 83 | - <image x="2" y="0" width="20" height="20" preserveAspectRatio="xMinYMin meet" xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" style="<?php if ($entry['unread'] !== 0) { ?>mask: url("#hole");<?php } ?>" class="app-icon"></image> |
|
| 83 | + <image x="2" y="0" width="20" height="20" preserveAspectRatio="xMinYMin meet" xlink:href="<?php print_unescaped($entry['icon'].'?v='.$_['versionHash']); ?>" style="<?php if ($entry['unread'] !== 0) { ?>mask: url("#hole");<?php } ?>" class="app-icon"></image> |
|
| 84 | 84 | <circle class="app-icon-notification" r="3" cx="21" cy="3" fill="red"/> |
| 85 | 85 | </svg> |
| 86 | 86 | <div class="unread-counter" aria-hidden="true"><?php p($entry['unread']); ?></div> |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | <circle r="4.5" cx="17" cy="3" fill="black"/> |
| 118 | 118 | </mask> |
| 119 | 119 | </defs> |
| 120 | - <image x="0" y="0" width="16" height="16" preserveAspectRatio="xMinYMin meet" filter="url(#invertMenuMore-<?php p($entry['id']); ?>)" xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" style="<?php if ($entry['unread'] !== 0) { ?>mask: url("#hole");<?php } ?>" class="app-icon"></image> |
|
| 120 | + <image x="0" y="0" width="16" height="16" preserveAspectRatio="xMinYMin meet" filter="url(#invertMenuMore-<?php p($entry['id']); ?>)" xlink:href="<?php print_unescaped($entry['icon'].'?v='.$_['versionHash']); ?>" style="<?php if ($entry['unread'] !== 0) { ?>mask: url("#hole");<?php } ?>" class="app-icon"></image> |
|
| 121 | 121 | <circle class="app-icon-notification" r="3" cx="17" cy="3" fill="red"/> |
| 122 | 122 | </svg> |
| 123 | 123 | <div class="unread-counter" aria-hidden="true"><?php p($entry['unread']); ?></div> |
@@ -138,14 +138,14 @@ discard block |
||
| 138 | 138 | <div id="contactsmenu"> |
| 139 | 139 | <div class="icon-contacts menutoggle" tabindex="0" role="button" |
| 140 | 140 | aria-haspopup="true" aria-controls="contactsmenu-menu" aria-expanded="false"> |
| 141 | - <span class="hidden-visually"><?php p($l->t('Contacts'));?></span> |
|
| 141 | + <span class="hidden-visually"><?php p($l->t('Contacts')); ?></span> |
|
| 142 | 142 | </div> |
| 143 | 143 | <div id="contactsmenu-menu" class="menu" |
| 144 | - aria-label="<?php p($l->t('Contacts menu'));?>"></div> |
|
| 144 | + aria-label="<?php p($l->t('Contacts menu')); ?>"></div> |
|
| 145 | 145 | </div> |
| 146 | 146 | <div id="settings"> |
| 147 | 147 | <div id="expand" tabindex="0" role="button" class="menutoggle" |
| 148 | - aria-label="<?php p($l->t('Settings'));?>" |
|
| 148 | + aria-label="<?php p($l->t('Settings')); ?>" |
|
| 149 | 149 | aria-haspopup="true" aria-controls="expanddiv" aria-expanded="false"> |
| 150 | 150 | <div id="avatardiv-menu" class="avatardiv<?php if ($_['userAvatarSet']) { |
| 151 | 151 | print_unescaped(' avatardiv-shown'); |
@@ -162,20 +162,20 @@ discard block |
||
| 162 | 162 | <?php |
| 163 | 163 | if ($_['userAvatarSet']) {?> |
| 164 | 164 | <img alt="" width="32" height="32" |
| 165 | - src="<?php p($avatar32);?>" |
|
| 166 | - srcset="<?php p($getUserAvatar(64));?> 2x, <?php p($getUserAvatar(128));?> 4x" |
|
| 165 | + src="<?php p($avatar32); ?>" |
|
| 166 | + srcset="<?php p($getUserAvatar(64)); ?> 2x, <?php p($getUserAvatar(128)); ?> 4x" |
|
| 167 | 167 | > |
| 168 | 168 | <?php } ?> |
| 169 | 169 | </div> |
| 170 | 170 | </div> |
| 171 | 171 | <nav class="settings-menu" id="expanddiv" style="display:none;" |
| 172 | - aria-label="<?php p($l->t('Settings menu'));?>"> |
|
| 172 | + aria-label="<?php p($l->t('Settings menu')); ?>"> |
|
| 173 | 173 | <ul> |
| 174 | 174 | <?php foreach ($_['settingsnavigation'] as $entry):?> |
| 175 | 175 | <li data-id="<?php p($entry['id']); ?>"> |
| 176 | 176 | <a href="<?php print_unescaped($entry['href']); ?>" |
| 177 | 177 | <?php if ($entry["active"]): ?> class="active"<?php endif; ?>> |
| 178 | - <img alt="" src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>"> |
|
| 178 | + <img alt="" src="<?php print_unescaped($entry['icon'].'?v='.$_['versionHash']); ?>"> |
|
| 179 | 179 | <?php p($entry['name']) ?> |
| 180 | 180 | </a> |
| 181 | 181 | </li> |
@@ -72,12 +72,12 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function enableTheme(string $themeId): DataResponse { |
| 74 | 74 | if ($themeId === '' || !$themeId) { |
| 75 | - throw new OCSBadRequestException('Invalid theme id: ' . $themeId); |
|
| 75 | + throw new OCSBadRequestException('Invalid theme id: '.$themeId); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | $themes = $this->themesService->getThemes(); |
| 79 | 79 | if (!isset($themes[$themeId])) { |
| 80 | - throw new OCSBadRequestException('Invalid theme id: ' . $themeId); |
|
| 80 | + throw new OCSBadRequestException('Invalid theme id: '.$themeId); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | // Enable selected theme |
@@ -96,12 +96,12 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function disableTheme(string $themeId): DataResponse { |
| 98 | 98 | if ($themeId === '' || !$themeId) { |
| 99 | - throw new OCSBadRequestException('Invalid theme id: ' . $themeId); |
|
| 99 | + throw new OCSBadRequestException('Invalid theme id: '.$themeId); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | $themes = $this->themesService->getThemes(); |
| 103 | 103 | if (!isset($themes[$themeId])) { |
| 104 | - throw new OCSBadRequestException('Invalid theme id: ' . $themeId); |
|
| 104 | + throw new OCSBadRequestException('Invalid theme id: '.$themeId); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // Enable selected theme |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | |
| 220 | 220 | try { |
| 221 | 221 | $mime = $this->imageManager->updateImage($key, $image['tmp_name']); |
| 222 | - $this->themingDefaults->set($key . 'Mime', $mime); |
|
| 222 | + $this->themingDefaults->set($key.'Mime', $mime); |
|
| 223 | 223 | } catch (\Exception $e) { |
| 224 | 224 | return new DataResponse( |
| 225 | 225 | [ |
@@ -292,12 +292,12 @@ discard block |
||
| 292 | 292 | $csp->allowInlineStyle(); |
| 293 | 293 | $response->setContentSecurityPolicy($csp); |
| 294 | 294 | $response->cacheFor(3600); |
| 295 | - $response->addHeader('Content-Type', $this->config->getAppValue($this->appName, $key . 'Mime', '')); |
|
| 296 | - $response->addHeader('Content-Disposition', 'attachment; filename="' . $key . '"'); |
|
| 295 | + $response->addHeader('Content-Type', $this->config->getAppValue($this->appName, $key.'Mime', '')); |
|
| 296 | + $response->addHeader('Content-Disposition', 'attachment; filename="'.$key.'"'); |
|
| 297 | 297 | if (!$useSvg) { |
| 298 | 298 | $response->addHeader('Content-Type', 'image/png'); |
| 299 | 299 | } else { |
| 300 | - $response->addHeader('Content-Type', $this->config->getAppValue($this->appName, $key . 'Mime', '')); |
|
| 300 | + $response->addHeader('Content-Type', $this->config->getAppValue($this->appName, $key.'Mime', '')); |
|
| 301 | 301 | } |
| 302 | 302 | return $response; |
| 303 | 303 | } |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | $theme = $themes[$themeId]; |
| 320 | - $customCss = $theme->getCustomCss(); |
|
| 320 | + $customCss = $theme->getCustomCss(); |
|
| 321 | 321 | |
| 322 | 322 | // Generate variables |
| 323 | 323 | $variables = ''; |
@@ -327,12 +327,12 @@ discard block |
||
| 327 | 327 | |
| 328 | 328 | // If plain is set, the browser decides of the css priority |
| 329 | 329 | if ($plain) { |
| 330 | - $css = ":root { $variables } " . $customCss; |
|
| 330 | + $css = ":root { $variables } ".$customCss; |
|
| 331 | 331 | } else { |
| 332 | 332 | // If not set, we'll rely on the body class |
| 333 | 333 | $compiler = new Compiler(); |
| 334 | 334 | $compiledCss = $compiler->compileString("body[data-theme-$themeId] { $variables $customCss }"); |
| 335 | - $css = $compiledCss->getCss();; |
|
| 335 | + $css = $compiledCss->getCss(); ; |
|
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | try { |
@@ -359,12 +359,12 @@ discard block |
||
| 359 | 359 | $description = $this->themingDefaults->getSlogan(); |
| 360 | 360 | } else { |
| 361 | 361 | $info = $this->appManager->getAppInfo($app, false, $this->l10n->getLanguageCode()); |
| 362 | - $name = $info['name'] . ' - ' . $this->themingDefaults->getName(); |
|
| 362 | + $name = $info['name'].' - '.$this->themingDefaults->getName(); |
|
| 363 | 363 | $shortName = $info['name']; |
| 364 | 364 | if (strpos($this->request->getRequestUri(), '/index.php/') !== false) { |
| 365 | - $startUrl = $this->urlGenerator->getBaseUrl() . '/index.php/apps/' . $app . '/'; |
|
| 365 | + $startUrl = $this->urlGenerator->getBaseUrl().'/index.php/apps/'.$app.'/'; |
|
| 366 | 366 | } else { |
| 367 | - $startUrl = $this->urlGenerator->getBaseUrl() . '/apps/' . $app . '/'; |
|
| 367 | + $startUrl = $this->urlGenerator->getBaseUrl().'/apps/'.$app.'/'; |
|
| 368 | 368 | } |
| 369 | 369 | $description = $info['summary'] ?? ''; |
| 370 | 370 | } |
@@ -379,13 +379,13 @@ discard block |
||
| 379 | 379 | [ |
| 380 | 380 | [ |
| 381 | 381 | 'src' => $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', |
| 382 | - ['app' => $app]) . '?v=' . $cacheBusterValue, |
|
| 382 | + ['app' => $app]).'?v='.$cacheBusterValue, |
|
| 383 | 383 | 'type' => 'image/png', |
| 384 | 384 | 'sizes' => '512x512' |
| 385 | 385 | ], |
| 386 | 386 | [ |
| 387 | 387 | 'src' => $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', |
| 388 | - ['app' => $app]) . '?v=' . $cacheBusterValue, |
|
| 388 | + ['app' => $app]).'?v='.$cacheBusterValue, |
|
| 389 | 389 | 'type' => 'image/svg+xml', |
| 390 | 390 | 'sizes' => '16x16' |
| 391 | 391 | ] |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | */ |
| 89 | 89 | public function run(IOutput $output) { |
| 90 | 90 | $output->startProgress(); |
| 91 | - $this->userManager->callForSeenUsers(function (IUser $user) use ($output) { |
|
| 91 | + $this->userManager->callForSeenUsers(function(IUser $user) use ($output) { |
|
| 92 | 92 | $config = []; |
| 93 | 93 | |
| 94 | 94 | $font = $this->config->getUserValue($user->getUID(), 'accessibility', 'font', false); |
@@ -93,17 +93,17 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | public function mix(string $color1, string $color2, int $factor): string { |
| 95 | 95 | $color = new Color($color1); |
| 96 | - return '#' . $color->mix($color2, $factor); |
|
| 96 | + return '#'.$color->mix($color2, $factor); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | public function lighten(string $color, int $factor): string { |
| 100 | 100 | $color = new Color($color); |
| 101 | - return '#' . $color->lighten($factor); |
|
| 101 | + return '#'.$color->lighten($factor); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | public function darken(string $color, int $factor): string { |
| 105 | 105 | $color = new Color($color); |
| 106 | - return '#' . $color->darken($factor); |
|
| 106 | + return '#'.$color->darken($factor); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * @return string base64 encoded radio button svg |
| 157 | 157 | */ |
| 158 | 158 | public function generateRadioButton($color) { |
| 159 | - $radioButtonIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16">' . |
|
| 159 | + $radioButtonIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16">'. |
|
| 160 | 160 | '<path d="M8 1a7 7 0 0 0-7 7 7 7 0 0 0 7 7 7 7 0 0 0 7-7 7 7 0 0 0-7-7zm0 1a6 6 0 0 1 6 6 6 6 0 0 1-6 6 6 6 0 0 1-6-6 6 6 0 0 1 6-6zm0 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8z" fill="'.$color.'"/></svg>'; |
| 161 | 161 | return base64_encode($radioButtonIcon); |
| 162 | 162 | } |
@@ -170,11 +170,11 @@ discard block |
||
| 170 | 170 | $app = str_replace(['\0', '/', '\\', '..'], '', $app); |
| 171 | 171 | try { |
| 172 | 172 | $appPath = $this->appManager->getAppPath($app); |
| 173 | - $icon = $appPath . '/img/' . $app . '.svg'; |
|
| 173 | + $icon = $appPath.'/img/'.$app.'.svg'; |
|
| 174 | 174 | if (file_exists($icon)) { |
| 175 | 175 | return $icon; |
| 176 | 176 | } |
| 177 | - $icon = $appPath . '/img/app.svg'; |
|
| 177 | + $icon = $appPath.'/img/app.svg'; |
|
| 178 | 178 | if (file_exists($icon)) { |
| 179 | 179 | return $icon; |
| 180 | 180 | } |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } catch (NotFoundException $e) { |
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | - return \OC::$SERVERROOT . '/core/img/logo/logo.svg'; |
|
| 192 | + return \OC::$SERVERROOT.'/core/img/logo/logo.svg'; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $app = str_replace(['\0', '/', '\\', '..'], '', $app); |
| 202 | 202 | $image = str_replace(['\0', '\\', '..'], '', $image); |
| 203 | 203 | if ($app === "core") { |
| 204 | - $icon = \OC::$SERVERROOT . '/core/img/' . $image; |
|
| 204 | + $icon = \OC::$SERVERROOT.'/core/img/'.$image; |
|
| 205 | 205 | if (file_exists($icon)) { |
| 206 | 206 | return $icon; |
| 207 | 207 | } |
@@ -213,23 +213,23 @@ discard block |
||
| 213 | 213 | return false; |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - $icon = $appPath . '/img/' . $image; |
|
| 216 | + $icon = $appPath.'/img/'.$image; |
|
| 217 | 217 | if (file_exists($icon)) { |
| 218 | 218 | return $icon; |
| 219 | 219 | } |
| 220 | - $icon = $appPath . '/img/' . $image . '.svg'; |
|
| 220 | + $icon = $appPath.'/img/'.$image.'.svg'; |
|
| 221 | 221 | if (file_exists($icon)) { |
| 222 | 222 | return $icon; |
| 223 | 223 | } |
| 224 | - $icon = $appPath . '/img/' . $image . '.png'; |
|
| 224 | + $icon = $appPath.'/img/'.$image.'.png'; |
|
| 225 | 225 | if (file_exists($icon)) { |
| 226 | 226 | return $icon; |
| 227 | 227 | } |
| 228 | - $icon = $appPath . '/img/' . $image . '.gif'; |
|
| 228 | + $icon = $appPath.'/img/'.$image.'.gif'; |
|
| 229 | 229 | if (file_exists($icon)) { |
| 230 | 230 | return $icon; |
| 231 | 231 | } |
| 232 | - $icon = $appPath . '/img/' . $image . '.jpg'; |
|
| 232 | + $icon = $appPath.'/img/'.$image.'.jpg'; |
|
| 233 | 233 | if (file_exists($icon)) { |
| 234 | 234 | return $icon; |
| 235 | 235 | } |
@@ -181,7 +181,7 @@ |
||
| 181 | 181 | |
| 182 | 182 | // Register image variables only if custom-defined |
| 183 | 183 | $backgroundDeleted = $this->config->getAppValue('theming', 'backgroundMime', '') === 'backgroundColor'; |
| 184 | - foreach(['logo', 'logoheader', 'favicon', 'background'] as $image) { |
|
| 184 | + foreach (['logo', 'logoheader', 'favicon', 'background'] as $image) { |
|
| 185 | 185 | if ($this->imageManager->hasImage($image)) { |
| 186 | 186 | // If primary as background has been request, let's not define the background image |
| 187 | 187 | if ($image === 'background' && $backgroundDeleted) { |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | $originalFontFace = $variables['--font-face']; |
| 54 | 54 | |
| 55 | 55 | $variables = [ |
| 56 | - '--font-face' => 'OpenDyslexic, ' . $originalFontFace |
|
| 56 | + '--font-face' => 'OpenDyslexic, '.$originalFontFace |
|
| 57 | 57 | ]; |
| 58 | 58 | |
| 59 | 59 | return $variables; |
@@ -45,19 +45,19 @@ |
||
| 45 | 45 | $defaultTheme = $themes[$this->defaultTheme->getId()]; |
| 46 | 46 | $mediaThemes = array_filter($themes, function($theme) { |
| 47 | 47 | // Check if the theme provides a media query |
| 48 | - return (bool)$theme->getMediaQuery(); |
|
| 48 | + return (bool) $theme->getMediaQuery(); |
|
| 49 | 49 | }); |
| 50 | 50 | |
| 51 | 51 | // Default theme fallback |
| 52 | 52 | $this->addThemeHeader($defaultTheme->getId()); |
| 53 | 53 | |
| 54 | 54 | // Themes applied by media queries |
| 55 | - foreach($mediaThemes as $theme) { |
|
| 55 | + foreach ($mediaThemes as $theme) { |
|
| 56 | 56 | $this->addThemeHeader($theme->getId(), true, $theme->getMediaQuery()); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // Themes |
| 60 | - foreach($this->themesService->getThemes() as $theme) { |
|
| 60 | + foreach ($this->themesService->getThemes() as $theme) { |
|
| 61 | 61 | // Ignore default theme as already processed first |
| 62 | 62 | if ($theme->getId() === $this->defaultTheme->getId()) { |
| 63 | 63 | continue; |