@@ -72,7 +72,7 @@ |
||
72 | 72 | $query = $this->db->getQueryBuilder(); |
73 | 73 | $query->select($query->createFunction('MAX(id)')) |
74 | 74 | ->from('calendarobjects'); |
75 | - $maxId = (int)$query->execute()->fetchColumn(); |
|
75 | + $maxId = (int) $query->execute()->fetchColumn(); |
|
76 | 76 | |
77 | 77 | $output->info('Add background job'); |
78 | 78 | $this->jobList->add(BuildCalendarSearchIndexBackgroundJob::class, [ |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | |
379 | 379 | $this->htmlBody .= vsprintf($this->heading, [htmlspecialchars($title)]); |
380 | 380 | if ($plainTitle !== false) { |
381 | - $this->plainBody .= $plainTitle . PHP_EOL . PHP_EOL; |
|
381 | + $this->plainBody .= $plainTitle.PHP_EOL.PHP_EOL; |
|
382 | 382 | } |
383 | 383 | } |
384 | 384 | |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | |
414 | 414 | $this->htmlBody .= vsprintf($this->bodyText, [htmlspecialchars($text)]); |
415 | 415 | if ($plainText !== false) { |
416 | - $this->plainBody .= $plainText . PHP_EOL . PHP_EOL; |
|
416 | + $this->plainBody .= $plainText.PHP_EOL.PHP_EOL; |
|
417 | 417 | } |
418 | 418 | } |
419 | 419 | |
@@ -441,18 +441,18 @@ discard block |
||
441 | 441 | |
442 | 442 | $htmlText = htmlspecialchars($text); |
443 | 443 | if ($metaInfo) { |
444 | - $htmlText = '<em style="color:#777;">' . htmlspecialchars($metaInfo) . '</em><br>' . $htmlText; |
|
444 | + $htmlText = '<em style="color:#777;">'.htmlspecialchars($metaInfo).'</em><br>'.$htmlText; |
|
445 | 445 | } |
446 | 446 | if ($icon !== '') { |
447 | - $icon = '<img src="' . htmlspecialchars($icon) . '" alt="•">'; |
|
447 | + $icon = '<img src="'.htmlspecialchars($icon).'" alt="•">'; |
|
448 | 448 | } else { |
449 | 449 | $icon = '•'; |
450 | 450 | } |
451 | 451 | $this->htmlBody .= vsprintf($this->listItem, [$icon, $htmlText]); |
452 | 452 | if ($plainText !== false) { |
453 | - $this->plainBody .= ' * ' . $plainText; |
|
453 | + $this->plainBody .= ' * '.$plainText; |
|
454 | 454 | if ($plainMetaInfo !== false) { |
455 | - $this->plainBody .= ' (' . $plainMetaInfo . ')'; |
|
455 | + $this->plainBody .= ' ('.$plainMetaInfo.')'; |
|
456 | 456 | } |
457 | 457 | $this->plainBody .= PHP_EOL; |
458 | 458 | } |
@@ -510,8 +510,8 @@ discard block |
||
510 | 510 | $color = $this->themingDefaults->getColorPrimary(); |
511 | 511 | |
512 | 512 | $this->htmlBody .= vsprintf($this->buttonGroup, [$color, $color, $urlLeft, $color, htmlspecialchars($textLeft), $urlRight, htmlspecialchars($textRight)]); |
513 | - $this->plainBody .= $plainTextLeft . ': ' . $urlLeft . PHP_EOL; |
|
514 | - $this->plainBody .= $plainTextRight . ': ' . $urlRight . PHP_EOL . PHP_EOL; |
|
513 | + $this->plainBody .= $plainTextLeft.': '.$urlLeft.PHP_EOL; |
|
514 | + $this->plainBody .= $plainTextRight.': '.$urlRight.PHP_EOL.PHP_EOL; |
|
515 | 515 | |
516 | 516 | } |
517 | 517 | |
@@ -541,10 +541,10 @@ discard block |
||
541 | 541 | $this->htmlBody .= vsprintf($this->button, [$color, $color, $url, $color, htmlspecialchars($text)]); |
542 | 542 | |
543 | 543 | if ($plainText !== false) { |
544 | - $this->plainBody .= $plainText . ': '; |
|
544 | + $this->plainBody .= $plainText.': '; |
|
545 | 545 | } |
546 | 546 | |
547 | - $this->plainBody .= $url . PHP_EOL; |
|
547 | + $this->plainBody .= $url.PHP_EOL; |
|
548 | 548 | |
549 | 549 | } |
550 | 550 | |
@@ -568,8 +568,8 @@ discard block |
||
568 | 568 | * @param string $text If the text is empty the default "Name - Slogan<br>This is an automatically sent email" will be used |
569 | 569 | */ |
570 | 570 | public function addFooter($text = '') { |
571 | - if($text === '') { |
|
572 | - $text = $this->themingDefaults->getName() . ' - ' . $this->themingDefaults->getSlogan() . '<br>' . $this->l10n->t('This is an automatically sent email, please do not reply.'); |
|
571 | + if ($text === '') { |
|
572 | + $text = $this->themingDefaults->getName().' - '.$this->themingDefaults->getSlogan().'<br>'.$this->l10n->t('This is an automatically sent email, please do not reply.'); |
|
573 | 573 | } |
574 | 574 | |
575 | 575 | if ($this->footerAdded) { |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | |
582 | 582 | $this->htmlBody .= vsprintf($this->footer, [$text]); |
583 | 583 | $this->htmlBody .= $this->tail; |
584 | - $this->plainBody .= PHP_EOL . '-- ' . PHP_EOL; |
|
584 | + $this->plainBody .= PHP_EOL.'-- '.PHP_EOL; |
|
585 | 585 | $this->plainBody .= str_replace('<br>', PHP_EOL, $text); |
586 | 586 | } |
587 | 587 |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $server->on('report', [$this, 'report']); |
76 | 76 | |
77 | - $server->xml->elementMap['{' . self::NS_Nextcloud . '}calendar-search'] = |
|
77 | + $server->xml->elementMap['{'.self::NS_Nextcloud.'}calendar-search'] = |
|
78 | 78 | 'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport'; |
79 | 79 | } |
80 | 80 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function report($reportName, $report, $path) { |
90 | 90 | switch ($reportName) { |
91 | - case '{' . self::NS_Nextcloud . '}calendar-search': |
|
91 | + case '{'.self::NS_Nextcloud.'}calendar-search': |
|
92 | 92 | $this->server->transactionType = 'report-nc-calendar-search'; |
93 | 93 | $this->calendarSearch($report); |
94 | 94 | return false; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | $reports = []; |
112 | 112 | if ($node instanceof CalendarHome) { |
113 | - $reports[] = '{' . self::NS_Nextcloud . '}calendar-search'; |
|
113 | + $reports[] = '{'.self::NS_Nextcloud.'}calendar-search'; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | return $reports; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | foreach ($nodePaths as $path) { |
142 | 142 | list($properties) = $this->server->getPropertiesForPath( |
143 | - $this->server->getRequestUri() . '/' . $path, |
|
143 | + $this->server->getRequestUri().'/'.$path, |
|
144 | 144 | $report->properties); |
145 | 145 | $result[] = $properties; |
146 | 146 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | public function __destruct() { |
67 | 67 | try { |
68 | 68 | $this->close(); |
69 | - } catch (SessionNotAvailableException $e){ |
|
69 | + } catch (SessionNotAvailableException $e) { |
|
70 | 70 | // This exception can occur if session is already closed |
71 | 71 | // So it is safe to ignore it and let the garbage collector to proceed |
72 | 72 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * @return string|null Either the value or null |
103 | 103 | */ |
104 | 104 | public function get($key) { |
105 | - if(isset($this->sessionValues[$key])) { |
|
105 | + if (isset($this->sessionValues[$key])) { |
|
106 | 106 | return $this->sessionValues[$key]; |
107 | 107 | } |
108 | 108 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | * Close the session and release the lock, also writes all changed data in batch |
169 | 169 | */ |
170 | 170 | public function close() { |
171 | - if($this->isModified) { |
|
171 | + if ($this->isModified) { |
|
172 | 172 | $encryptedValue = $this->crypto->encrypt(json_encode($this->sessionValues), $this->passphrase); |
173 | 173 | $this->session->set(self::encryptedSessionName, $encryptedValue); |
174 | 174 | $this->isModified = false; |
@@ -11,9 +11,9 @@ |
||
11 | 11 | <p class="settings-hint"><?php p($l->t('Allows users to share a personalized link to a file or folder by putting in an email address.')); ?></p> |
12 | 12 | |
13 | 13 | <p> |
14 | - <input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if($_['sendPasswordMail']) p('checked'); ?> /> |
|
14 | + <input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if ($_['sendPasswordMail']) p('checked'); ?> /> |
|
15 | 15 | <label for="sendPasswordMail"><?php p($l->t('Send password by mail')); ?></label><br/> |
16 | - <input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if($_['enforcePasswordProtection']) p('checked'); ?> /> |
|
16 | + <input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if ($_['enforcePasswordProtection']) p('checked'); ?> /> |
|
17 | 17 | <label for="enforcePasswordProtection"><?php p($l->t('Enforce password protection')); ?></label> |
18 | 18 | </p> |
19 | 19 |
@@ -220,9 +220,9 @@ discard block |
||
220 | 220 | )) { |
221 | 221 | // note: pre-fetching only supported for depth <= 1 |
222 | 222 | $folderContent = $node->getChildren(); |
223 | - $fileIds[] = (int)$node->getId(); |
|
223 | + $fileIds[] = (int) $node->getId(); |
|
224 | 224 | foreach ($folderContent as $info) { |
225 | - $fileIds[] = (int)$info->getId(); |
|
225 | + $fileIds[] = (int) $info->getId(); |
|
226 | 226 | } |
227 | 227 | $tags = $this->getTagger()->getTagsForObjects($fileIds); |
228 | 228 | if ($tags === false) { |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | }); |
279 | 279 | |
280 | 280 | $propPatch->handle(self::FAVORITE_PROPERTYNAME, function($favState) use ($node) { |
281 | - if ((int)$favState === 1 || $favState === 'true') { |
|
281 | + if ((int) $favState === 1 || $favState === 'true') { |
|
282 | 282 | $this->getTagger()->tagAs($node->getId(), self::TAG_FAVORITE); |
283 | 283 | } else { |
284 | 284 | $this->getTagger()->unTag($node->getId(), self::TAG_FAVORITE); |
@@ -53,44 +53,44 @@ discard block |
||
53 | 53 | * @param string $renderAs |
54 | 54 | * @param string $appId application id |
55 | 55 | */ |
56 | - public function __construct( $renderAs, $appId = '' ) { |
|
56 | + public function __construct($renderAs, $appId = '') { |
|
57 | 57 | |
58 | 58 | // yes - should be injected .... |
59 | 59 | $this->config = \OC::$server->getConfig(); |
60 | 60 | |
61 | 61 | |
62 | 62 | // Decide which page we show |
63 | - if($renderAs == 'user') { |
|
64 | - parent::__construct( 'core', 'layout.user' ); |
|
65 | - if(in_array(\OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) { |
|
63 | + if ($renderAs == 'user') { |
|
64 | + parent::__construct('core', 'layout.user'); |
|
65 | + if (in_array(\OC_App::getCurrentApp(), ['settings', 'admin', 'help']) !== false) { |
|
66 | 66 | $this->assign('bodyid', 'body-settings'); |
67 | - }else{ |
|
67 | + } else { |
|
68 | 68 | $this->assign('bodyid', 'body-user'); |
69 | 69 | } |
70 | 70 | |
71 | 71 | // Code integrity notification |
72 | 72 | $integrityChecker = \OC::$server->getIntegrityCodeChecker(); |
73 | - if(\OC_User::isAdminUser(\OC_User::getUser()) && $integrityChecker->isCodeCheckEnforced() && !$integrityChecker->hasPassedCheck()) { |
|
73 | + if (\OC_User::isAdminUser(\OC_User::getUser()) && $integrityChecker->isCodeCheckEnforced() && !$integrityChecker->hasPassedCheck()) { |
|
74 | 74 | \OCP\Util::addScript('core', 'integritycheck-failed-notification'); |
75 | 75 | } |
76 | 76 | |
77 | 77 | // Add navigation entry |
78 | - $this->assign( 'application', ''); |
|
79 | - $this->assign( 'appid', $appId ); |
|
78 | + $this->assign('application', ''); |
|
79 | + $this->assign('appid', $appId); |
|
80 | 80 | $navigation = \OC_App::getNavigation(); |
81 | - $this->assign( 'navigation', $navigation); |
|
81 | + $this->assign('navigation', $navigation); |
|
82 | 82 | $settingsNavigation = \OC_App::getSettingsNavigation(); |
83 | - $this->assign( 'settingsnavigation', $settingsNavigation); |
|
84 | - foreach($navigation as $entry) { |
|
83 | + $this->assign('settingsnavigation', $settingsNavigation); |
|
84 | + foreach ($navigation as $entry) { |
|
85 | 85 | if ($entry['active']) { |
86 | - $this->assign( 'application', $entry['name'] ); |
|
86 | + $this->assign('application', $entry['name']); |
|
87 | 87 | break; |
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | - foreach($settingsNavigation as $entry) { |
|
91 | + foreach ($settingsNavigation as $entry) { |
|
92 | 92 | if ($entry['active']) { |
93 | - $this->assign( 'application', $entry['name'] ); |
|
93 | + $this->assign('application', $entry['name']); |
|
94 | 94 | break; |
95 | 95 | } |
96 | 96 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | // Send the language to our layouts |
119 | 119 | $this->assign('language', \OC::$server->getL10NFactory()->findLanguage()); |
120 | 120 | |
121 | - if(\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
121 | + if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
122 | 122 | if (empty(self::$versionHash)) { |
123 | 123 | $v = \OC_App::getAppVersions(); |
124 | 124 | $v['core'] = implode('.', \OCP\Util::getVersion()); |
@@ -149,10 +149,10 @@ discard block |
||
149 | 149 | $this->append('jsfiles', \OC::$server->getURLGenerator()->linkToRoute('core.OCJS.getConfig', ['v' => self::$versionHash])); |
150 | 150 | } |
151 | 151 | } |
152 | - foreach($jsFiles as $info) { |
|
152 | + foreach ($jsFiles as $info) { |
|
153 | 153 | $web = $info[1]; |
154 | 154 | $file = $info[2]; |
155 | - $this->append( 'jsfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
155 | + $this->append('jsfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | try { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | |
164 | 164 | // Do not initialise scss appdata until we have a fully installed instance |
165 | 165 | // Do not load scss for update, errors, installation or login page |
166 | - if(\OC::$server->getSystemConfig()->getValue('installed', false) |
|
166 | + if (\OC::$server->getSystemConfig()->getValue('installed', false) |
|
167 | 167 | && !\OCP\Util::needUpgrade() |
168 | 168 | && $pathInfo !== '' |
169 | 169 | && !preg_match('/^\/login/', $pathInfo)) { |
@@ -178,27 +178,27 @@ discard block |
||
178 | 178 | $this->assign('cssfiles', array()); |
179 | 179 | $this->assign('printcssfiles', []); |
180 | 180 | $this->assign('versionHash', self::$versionHash); |
181 | - foreach($cssFiles as $info) { |
|
181 | + foreach ($cssFiles as $info) { |
|
182 | 182 | $web = $info[1]; |
183 | 183 | $file = $info[2]; |
184 | 184 | |
185 | 185 | if (substr($file, -strlen('print.css')) === 'print.css') { |
186 | - $this->append( 'printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
186 | + $this->append('printcssfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
187 | 187 | } else { |
188 | - $this->append( 'cssfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
188 | + $this->append('cssfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
189 | 189 | } |
190 | 190 | } |
191 | 191 | } |
192 | 192 | |
193 | 193 | protected function getVersionHashSuffix() { |
194 | - if(\OC::$server->getConfig()->getSystemValue('debug', false)) { |
|
194 | + if (\OC::$server->getConfig()->getSystemValue('debug', false)) { |
|
195 | 195 | // allows chrome workspace mapping in debug mode |
196 | 196 | return ""; |
197 | 197 | } |
198 | 198 | if ($this->config->getSystemValue('installed', false) && \OC::$server->getAppManager()->isInstalled('theming')) { |
199 | - return '?v=' . self::$versionHash . '-' . $this->config->getAppValue('theming', 'cachebuster', '0'); |
|
199 | + return '?v='.self::$versionHash.'-'.$this->config->getAppValue('theming', 'cachebuster', '0'); |
|
200 | 200 | } |
201 | - return '?v=' . self::$versionHash; |
|
201 | + return '?v='.self::$versionHash; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | // Read the selected theme from the config file |
210 | 210 | $theme = \OC_Util::getTheme(); |
211 | 211 | |
212 | - if($compileScss) { |
|
212 | + if ($compileScss) { |
|
213 | 213 | $SCSSCacher = \OC::$server->query(SCSSCacher::class); |
214 | 214 | } else { |
215 | 215 | $SCSSCacher = null; |
@@ -218,8 +218,8 @@ discard block |
||
218 | 218 | $locator = new \OC\Template\CSSResourceLocator( |
219 | 219 | \OC::$server->getLogger(), |
220 | 220 | $theme, |
221 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
222 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
221 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
222 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
223 | 223 | $SCSSCacher |
224 | 224 | ); |
225 | 225 | $locator->find($styles); |
@@ -237,8 +237,8 @@ discard block |
||
237 | 237 | $locator = new \OC\Template\JSResourceLocator( |
238 | 238 | \OC::$server->getLogger(), |
239 | 239 | $theme, |
240 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
241 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
240 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
241 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
242 | 242 | new JSCombiner( |
243 | 243 | \OC::$server->getAppDataDir('js'), |
244 | 244 | \OC::$server->getURLGenerator(), |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | */ |
259 | 259 | public static function convertToRelativePath($filePath) { |
260 | 260 | $relativePath = explode(\OC::$SERVERROOT, $filePath); |
261 | - if(count($relativePath) !== 2) { |
|
261 | + if (count($relativePath) !== 2) { |
|
262 | 262 | throw new \Exception('$filePath is not under the \OC::$SERVERROOT'); |
263 | 263 | } |
264 | 264 |
@@ -68,8 +68,8 @@ |
||
68 | 68 | $this->getBundles(), |
69 | 69 | $this->getDefaultInstallationBundle() |
70 | 70 | ); |
71 | - foreach($bundles as $bundle) { |
|
72 | - if($bundle->getIdentifier() === $identifier) { |
|
71 | + foreach ($bundles as $bundle) { |
|
72 | + if ($bundle->getIdentifier() === $identifier) { |
|
73 | 73 | return $bundle; |
74 | 74 | } |
75 | 75 | } |
@@ -31,20 +31,20 @@ discard block |
||
31 | 31 | $lastConfirm = (int) \OC::$server->getSession()->get('last-password-confirm'); |
32 | 32 | if ($lastConfirm < (time() - 30 * 60 + 15)) { // allow 15 seconds delay |
33 | 33 | $l = \OC::$server->getL10N('core'); |
34 | - OC_JSON::error(array( 'data' => array( 'message' => $l->t('Password confirmation is required')))); |
|
34 | + OC_JSON::error(array('data' => array('message' => $l->t('Password confirmation is required')))); |
|
35 | 35 | exit(); |
36 | 36 | } |
37 | 37 | |
38 | -$groups = isset($_POST['groups']) ? (array)$_POST['groups'] : null; |
|
39 | -$appIds = isset($_POST['appIds']) ? (array)$_POST['appIds'] : []; |
|
38 | +$groups = isset($_POST['groups']) ? (array) $_POST['groups'] : null; |
|
39 | +$appIds = isset($_POST['appIds']) ? (array) $_POST['appIds'] : []; |
|
40 | 40 | |
41 | 41 | try { |
42 | 42 | $updateRequired = false; |
43 | - foreach($appIds as $appId) { |
|
43 | + foreach ($appIds as $appId) { |
|
44 | 44 | $app = new OC_App(); |
45 | 45 | $appId = OC_App::cleanAppId($appId); |
46 | 46 | $app->enable($appId, $groups); |
47 | - if(\OC_App::shouldUpgrade($appId)) { |
|
47 | + if (\OC_App::shouldUpgrade($appId)) { |
|
48 | 48 | $updateRequired = true; |
49 | 49 | } |
50 | 50 | } |
@@ -52,5 +52,5 @@ discard block |
||
52 | 52 | OC_JSON::success(['data' => ['update_required' => $updateRequired]]); |
53 | 53 | } catch (Exception $e) { |
54 | 54 | \OCP\Util::writeLog('core', $e->getMessage(), \OCP\Util::ERROR); |
55 | - OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); |
|
55 | + OC_JSON::error(array("data" => array("message" => $e->getMessage()))); |
|
56 | 56 | } |