@@ -107,7 +107,7 @@ |
||
107 | 107 | * @return string language |
108 | 108 | * @since 7.0.0 |
109 | 109 | */ |
110 | - public function getLanguageCode(): string ; |
|
110 | + public function getLanguageCode(): string; |
|
111 | 111 | |
112 | 112 | /** |
113 | 113 | * * The code (en_US, fr_CA, ...) of the locale that is used for this IL10N object |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | public function getForm() { |
90 | 90 | $federatedFileSharingEnabled = $this->appManager->isEnabledForUser('federatedfilesharing'); |
91 | 91 | $lookupServerUploadEnabled = false; |
92 | - if($federatedFileSharingEnabled) { |
|
92 | + if ($federatedFileSharingEnabled) { |
|
93 | 93 | $federatedFileSharing = new Application(); |
94 | 94 | $shareProvider = $federatedFileSharing->getFederatedShareProvider(); |
95 | 95 | $lookupServerUploadEnabled = $shareProvider->isLookupServerUploadEnabled(); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | */ |
190 | 190 | private function getLanguages(IUser $user) { |
191 | 191 | $forceLanguage = $this->config->getSystemValue('force_language', false); |
192 | - if($forceLanguage !== false) { |
|
192 | + if ($forceLanguage !== false) { |
|
193 | 193 | return []; |
194 | 194 | } |
195 | 195 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | |
223 | 223 | private function getLocales(IUser $user) { |
224 | 224 | $forceLanguage = $this->config->getSystemValue('force_locale', false); |
225 | - if($forceLanguage !== false) { |
|
225 | + if ($forceLanguage !== false) { |
|
226 | 226 | return []; |
227 | 227 | } |
228 | 228 | |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | default: |
274 | 274 | $message = $this->l->t('Verify'); |
275 | 275 | } |
276 | - $messageParameters[$property . 'Message'] = $message; |
|
276 | + $messageParameters[$property.'Message'] = $message; |
|
277 | 277 | } |
278 | 278 | return $messageParameters; |
279 | 279 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | </div> |
72 | 72 | </div> |
73 | 73 | <span class="icon-checkmark hidden"></span> |
74 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
74 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
75 | 75 | <input type="hidden" id="avatarscope" value="<?php p($_['avatarScope']) ?>"> |
76 | 76 | <?php } ?> |
77 | 77 | </form> |
@@ -89,14 +89,14 @@ discard block |
||
89 | 89 | <p class="quotatext"> |
90 | 90 | <?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?> |
91 | 91 | <?php print_unescaped($l->t('You are using <strong>%s</strong>', |
92 | - [$_['usage']]));?> |
|
92 | + [$_['usage']])); ?> |
|
93 | 93 | <?php else: ?> |
94 | 94 | <?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong> (<strong>%s %%</strong>)', |
95 | - [$_['usage'], $_['total_space'], $_['usage_relative']]));?> |
|
95 | + [$_['usage'], $_['total_space'], $_['usage_relative']])); ?> |
|
96 | 96 | <?php endif ?> |
97 | 97 | </p> |
98 | 98 | </div> |
99 | - <progress value="<?php p($_['usage_relative']); ?>" max="100"<?php if($_['usage_relative'] > 80): ?> class="warn" <?php endif; ?>></progress> |
|
99 | + <progress value="<?php p($_['usage_relative']); ?>" max="100"<?php if ($_['usage_relative'] > 80): ?> class="warn" <?php endif; ?>></progress> |
|
100 | 100 | </div> |
101 | 101 | </div> |
102 | 102 | </div> |
@@ -113,15 +113,15 @@ discard block |
||
113 | 113 | </div> |
114 | 114 | </h2> |
115 | 115 | <input type="text" id="displayname" name="displayname" |
116 | - <?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> |
|
116 | + <?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> |
|
117 | 117 | value="<?php p($_['displayName']) ?>" |
118 | 118 | autocomplete="on" autocapitalize="none" autocorrect="off" /> |
119 | - <?php if(!$_['displayNameChangeSupported']) { ?> |
|
120 | - <span><?php if(isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span> |
|
119 | + <?php if (!$_['displayNameChangeSupported']) { ?> |
|
120 | + <span><?php if (isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span> |
|
121 | 121 | <?php } ?> |
122 | 122 | <span class="icon-checkmark hidden"></span> |
123 | 123 | <span class="icon-error hidden" ></span> |
124 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
124 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
125 | 125 | <input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>"> |
126 | 126 | <?php } ?> |
127 | 127 | </form> |
@@ -136,10 +136,10 @@ discard block |
||
136 | 136 | </span> |
137 | 137 | </div> |
138 | 138 | </h2> |
139 | - <div class="verify <?php if ($_['email'] === '' || $_['emailScope'] !== 'public') p('hidden'); ?>"> |
|
139 | + <div class="verify <?php if ($_['email'] === '' || $_['emailScope'] !== 'public') p('hidden'); ?>"> |
|
140 | 140 | <img id="verify-email" title="<?php p($_['emailMessage']); ?>" data-status="<?php p($_['emailVerification']) ?>" src=" |
141 | 141 | <?php |
142 | - switch($_['emailVerification']) { |
|
142 | + switch ($_['emailVerification']) { |
|
143 | 143 | case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: |
144 | 144 | p(image_path('core', 'actions/verifying.svg')); |
145 | 145 | break; |
@@ -152,18 +152,18 @@ discard block |
||
152 | 152 | ?>"> |
153 | 153 | </div> |
154 | 154 | <input type="email" name="email" id="email" value="<?php p($_['email']); ?>" |
155 | - <?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> |
|
155 | + <?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> |
|
156 | 156 | placeholder="<?php p($l->t('Your email address')); ?>" |
157 | 157 | autocomplete="on" autocapitalize="none" autocorrect="off" /> |
158 | 158 | <span class="icon-checkmark hidden"></span> |
159 | 159 | <span class="icon-error hidden" ></span> |
160 | - <?php if(!$_['displayNameChangeSupported']) { ?> |
|
161 | - <span><?php if(isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span> |
|
160 | + <?php if (!$_['displayNameChangeSupported']) { ?> |
|
161 | + <span><?php if (isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span> |
|
162 | 162 | <?php } ?> |
163 | - <?php if($_['displayNameChangeSupported']) { ?> |
|
163 | + <?php if ($_['displayNameChangeSupported']) { ?> |
|
164 | 164 | <em><?php p($l->t('For password reset and notifications')); ?></em> |
165 | 165 | <?php } ?> |
166 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
166 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
167 | 167 | <input type="hidden" id="emailscope" value="<?php p($_['emailScope']) ?>"> |
168 | 168 | <?php } ?> |
169 | 169 | </form> |
@@ -179,12 +179,12 @@ discard block |
||
179 | 179 | </span> |
180 | 180 | </div> |
181 | 181 | </h2> |
182 | - <input type="tel" id="phone" name="phone" <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
182 | + <input type="tel" id="phone" name="phone" <?php if (!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
183 | 183 | value="<?php p($_['phone']) ?>" |
184 | 184 | placeholder="<?php p($l->t('Your phone number')); ?>" |
185 | 185 | autocomplete="on" autocapitalize="none" autocorrect="off" /> |
186 | 186 | <span class="icon-checkmark hidden"></span> |
187 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
187 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
188 | 188 | <input type="hidden" id="phonescope" value="<?php p($_['phoneScope']) ?>"> |
189 | 189 | <?php } ?> |
190 | 190 | </form> |
@@ -201,12 +201,12 @@ discard block |
||
201 | 201 | </span> |
202 | 202 | </div> |
203 | 203 | </h2> |
204 | - <input type="text" id="address" name="address" <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
204 | + <input type="text" id="address" name="address" <?php if (!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
205 | 205 | placeholder="<?php p($l->t('Your postal address')); ?>" |
206 | 206 | value="<?php p($_['address']) ?>" |
207 | 207 | autocomplete="on" autocapitalize="none" autocorrect="off" /> |
208 | 208 | <span class="icon-checkmark hidden"></span> |
209 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
209 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
210 | 210 | <input type="hidden" id="addressscope" value="<?php p($_['addressScope']) ?>"> |
211 | 211 | <?php } ?> |
212 | 212 | </form> |
@@ -223,11 +223,11 @@ discard block |
||
223 | 223 | </span> |
224 | 224 | </div> |
225 | 225 | </h2> |
226 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
227 | - <div class="verify <?php if ($_['website'] === '' || $_['websiteScope'] !== 'public') p('hidden'); ?>"> |
|
226 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
227 | + <div class="verify <?php if ($_['website'] === '' || $_['websiteScope'] !== 'public') p('hidden'); ?>"> |
|
228 | 228 | <img id="verify-website" title="<?php p($_['websiteMessage']); ?>" data-status="<?php p($_['websiteVerification']) ?>" src=" |
229 | 229 | <?php |
230 | - switch($_['websiteVerification']) { |
|
230 | + switch ($_['websiteVerification']) { |
|
231 | 231 | case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: |
232 | 232 | p(image_path('core', 'actions/verifying.svg')); |
233 | 233 | break; |
@@ -238,13 +238,13 @@ discard block |
||
238 | 238 | p(image_path('core', 'actions/verify.svg')); |
239 | 239 | } |
240 | 240 | ?>" |
241 | - <?php if($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?> |
|
241 | + <?php if ($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?> |
|
242 | 242 | > |
243 | 243 | <div class="verification-dialog popovermenu bubble menu"> |
244 | 244 | <div class="verification-dialog-content"> |
245 | 245 | <p class="explainVerification"></p> |
246 | 246 | <p class="verificationCode"></p> |
247 | - <p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p> |
|
247 | + <p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p> |
|
248 | 248 | </div> |
249 | 249 | </div> |
250 | 250 | </div> |
@@ -252,10 +252,10 @@ discard block |
||
252 | 252 | <input type="url" name="website" id="website" value="<?php p($_['website']); ?>" |
253 | 253 | placeholder="<?php p($l->t('Link https://…')); ?>" |
254 | 254 | autocomplete="on" autocapitalize="none" autocorrect="off" |
255 | - <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
255 | + <?php if (!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
256 | 256 | /> |
257 | 257 | <span class="icon-checkmark hidden"></span> |
258 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
258 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
259 | 259 | <input type="hidden" id="websitescope" value="<?php p($_['websiteScope']) ?>"> |
260 | 260 | <?php } ?> |
261 | 261 | </form> |
@@ -272,11 +272,11 @@ discard block |
||
272 | 272 | </span> |
273 | 273 | </div> |
274 | 274 | </h2> |
275 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
276 | - <div class="verify <?php if ($_['twitter'] === '' || $_['twitterScope'] !== 'public') p('hidden'); ?>"> |
|
275 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
276 | + <div class="verify <?php if ($_['twitter'] === '' || $_['twitterScope'] !== 'public') p('hidden'); ?>"> |
|
277 | 277 | <img id="verify-twitter" title="<?php p($_['twitterMessage']); ?>" data-status="<?php p($_['twitterVerification']) ?>" src=" |
278 | 278 | <?php |
279 | - switch($_['twitterVerification']) { |
|
279 | + switch ($_['twitterVerification']) { |
|
280 | 280 | case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: |
281 | 281 | p(image_path('core', 'actions/verifying.svg')); |
282 | 282 | break; |
@@ -287,13 +287,13 @@ discard block |
||
287 | 287 | p(image_path('core', 'actions/verify.svg')); |
288 | 288 | } |
289 | 289 | ?>" |
290 | - <?php if($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?> |
|
290 | + <?php if ($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?> |
|
291 | 291 | > |
292 | 292 | <div class="verification-dialog popovermenu bubble menu"> |
293 | 293 | <div class="verification-dialog-content"> |
294 | 294 | <p class="explainVerification"></p> |
295 | 295 | <p class="verificationCode"></p> |
296 | - <p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p> |
|
296 | + <p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p> |
|
297 | 297 | </div> |
298 | 298 | </div> |
299 | 299 | </div> |
@@ -301,10 +301,10 @@ discard block |
||
301 | 301 | <input type="text" name="twitter" id="twitter" value="<?php p($_['twitter']); ?>" |
302 | 302 | placeholder="<?php p($l->t('Twitter handle @…')); ?>" |
303 | 303 | autocomplete="on" autocapitalize="none" autocorrect="off" |
304 | - <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
304 | + <?php if (!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
305 | 305 | /> |
306 | 306 | <span class="icon-checkmark hidden"></span> |
307 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
307 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
308 | 308 | <input type="hidden" id="twitterscope" value="<?php p($_['twitterScope']) ?>"> |
309 | 309 | <?php } ?> |
310 | 310 | </form> |
@@ -317,54 +317,54 @@ discard block |
||
317 | 317 | <?php if (isset($_['activelanguage'])) { ?> |
318 | 318 | <form id="language" class="section"> |
319 | 319 | <h2> |
320 | - <label for="languageinput"><?php p($l->t('Language'));?></label> |
|
320 | + <label for="languageinput"><?php p($l->t('Language')); ?></label> |
|
321 | 321 | </h2> |
322 | - <select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language'));?>"> |
|
323 | - <option value="<?php p($_['activelanguage']['code']);?>"> |
|
324 | - <?php p($_['activelanguage']['name']);?> |
|
322 | + <select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language')); ?>"> |
|
323 | + <option value="<?php p($_['activelanguage']['code']); ?>"> |
|
324 | + <?php p($_['activelanguage']['name']); ?> |
|
325 | 325 | </option> |
326 | - <?php foreach($_['commonlanguages'] as $language):?> |
|
327 | - <option value="<?php p($language['code']);?>"> |
|
328 | - <?php p($language['name']);?> |
|
326 | + <?php foreach ($_['commonlanguages'] as $language):?> |
|
327 | + <option value="<?php p($language['code']); ?>"> |
|
328 | + <?php p($language['name']); ?> |
|
329 | 329 | </option> |
330 | - <?php endforeach;?> |
|
330 | + <?php endforeach; ?> |
|
331 | 331 | <optgroup label="––––––––––"></optgroup> |
332 | - <?php foreach($_['languages'] as $language):?> |
|
333 | - <option value="<?php p($language['code']);?>"> |
|
334 | - <?php p($language['name']);?> |
|
332 | + <?php foreach ($_['languages'] as $language):?> |
|
333 | + <option value="<?php p($language['code']); ?>"> |
|
334 | + <?php p($language['name']); ?> |
|
335 | 335 | </option> |
336 | - <?php endforeach;?> |
|
336 | + <?php endforeach; ?> |
|
337 | 337 | </select> |
338 | 338 | <a href="https://www.transifex.com/nextcloud/nextcloud/" |
339 | 339 | target="_blank" rel="noreferrer noopener"> |
340 | - <em><?php p($l->t('Help translate'));?></em> |
|
340 | + <em><?php p($l->t('Help translate')); ?></em> |
|
341 | 341 | </a> |
342 | 342 | </form> |
343 | 343 | <?php } ?> |
344 | 344 | <?php if (isset($_['activelocale'])) { ?> |
345 | 345 | <form id="locale" class="section"> |
346 | 346 | <h2> |
347 | - <label for="localeinput"><?php p($l->t('Locale'));?></label> |
|
347 | + <label for="localeinput"><?php p($l->t('Locale')); ?></label> |
|
348 | 348 | </h2> |
349 | - <select id="localeinput" name="lang" data-placeholder="<?php p($l->t('Locale'));?>"> |
|
350 | - <option value="<?php p($_['activelocale']['code']);?>"> |
|
351 | - <?php p($_['activelocale']['name']);?> |
|
349 | + <select id="localeinput" name="lang" data-placeholder="<?php p($l->t('Locale')); ?>"> |
|
350 | + <option value="<?php p($_['activelocale']['code']); ?>"> |
|
351 | + <?php p($_['activelocale']['name']); ?> |
|
352 | 352 | </option> |
353 | 353 | <optgroup label="––––––––––"></optgroup> |
354 | - <?php foreach($_['localesForLanguage'] as $locale):?> |
|
355 | - <option value="<?php p($locale['code']);?>"> |
|
356 | - <?php p($locale['name']);?> |
|
354 | + <?php foreach ($_['localesForLanguage'] as $locale):?> |
|
355 | + <option value="<?php p($locale['code']); ?>"> |
|
356 | + <?php p($locale['name']); ?> |
|
357 | 357 | </option> |
358 | - <?php endforeach;?> |
|
358 | + <?php endforeach; ?> |
|
359 | 359 | <optgroup label="––––––––––"></optgroup> |
360 | - <option value="<?php p($_['activelocale']['code']);?>"> |
|
361 | - <?php p($_['activelocale']['name']);?> |
|
360 | + <option value="<?php p($_['activelocale']['code']); ?>"> |
|
361 | + <?php p($_['activelocale']['name']); ?> |
|
362 | 362 | </option> |
363 | - <?php foreach($_['locales'] as $locale):?> |
|
364 | - <option value="<?php p($locale['code']);?>"> |
|
365 | - <?php p($locale['name']);?> |
|
363 | + <?php foreach ($_['locales'] as $locale):?> |
|
364 | + <option value="<?php p($locale['code']); ?>"> |
|
365 | + <?php p($locale['name']); ?> |
|
366 | 366 | </option> |
367 | - <?php endforeach;?> |
|
367 | + <?php endforeach; ?> |
|
368 | 368 | </select> |
369 | 369 | <div id="localeexample"> |
370 | 370 | <p id="localeexample-time"></p> |
@@ -376,20 +376,20 @@ discard block |
||
376 | 376 | </div> |
377 | 377 | <div class="personal-settings-setting-box personal-settings-password-box"> |
378 | 378 | <?php |
379 | - if($_['passwordChangeSupported']) { |
|
379 | + if ($_['passwordChangeSupported']) { |
|
380 | 380 | script('jquery-showpassword'); |
381 | 381 | ?> |
382 | 382 | <form id="passwordform" class="section"> |
383 | - <h2 class="inlineblock"><?php p($l->t('Password'));?></h2> |
|
383 | + <h2 class="inlineblock"><?php p($l->t('Password')); ?></h2> |
|
384 | 384 | <div id="password-error-msg" class="msg success inlineblock" style="display: none;">Saved</div> |
385 | 385 | |
386 | 386 | <label for="pass1" class="hidden-visually"><?php p($l->t('Current password')); ?>: </label> |
387 | 387 | <input type="password" id="pass1" name="oldpassword" |
388 | - placeholder="<?php p($l->t('Current password'));?>" |
|
388 | + placeholder="<?php p($l->t('Current password')); ?>" |
|
389 | 389 | autocomplete="off" autocapitalize="none" autocorrect="off" /> |
390 | 390 | |
391 | 391 | <div class="personal-show-container"> |
392 | - <label for="pass2" class="hidden-visually"><?php p($l->t('New password'));?>: </label> |
|
392 | + <label for="pass2" class="hidden-visually"><?php p($l->t('New password')); ?>: </label> |
|
393 | 393 | <input type="password" id="pass2" name="newpassword" |
394 | 394 | placeholder="<?php p($l->t('New password')); ?>" |
395 | 395 | data-typetoggle="#personal-show" |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | * @link https://github.com/owncloud/core/issues/21955 |
164 | 164 | */ |
165 | 165 | if ($this->config->getSystemValue('installed', false)) { |
166 | - $userId = !is_null($this->userSession->getUser()) ? $this->userSession->getUser()->getUID() : null; |
|
166 | + $userId = !is_null($this->userSession->getUser()) ? $this->userSession->getUser()->getUID() : null; |
|
167 | 167 | if (!is_null($userId)) { |
168 | 168 | $userLang = $this->config->getUserValue($userId, 'core', 'lang', null); |
169 | 169 | } else { |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | } |
214 | 214 | |
215 | 215 | if ($this->config->getSystemValue('installed', false)) { |
216 | - $userId = null !== $this->userSession->getUser() ? $this->userSession->getUser()->getUID() : null; |
|
216 | + $userId = null !== $this->userSession->getUser() ? $this->userSession->getUser()->getUID() : null; |
|
217 | 217 | $userLocale = null; |
218 | 218 | if (null !== $userId) { |
219 | 219 | $userLocale = $this->config->getUserValue($userId, 'core', 'locale', null); |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | // merge with translations from theme |
276 | 276 | $theme = $this->config->getSystemValue('theme'); |
277 | 277 | if (!empty($theme)) { |
278 | - $themeDir = $this->serverRoot . '/themes/' . $theme . substr($dir, strlen($this->serverRoot)); |
|
278 | + $themeDir = $this->serverRoot.'/themes/'.$theme.substr($dir, strlen($this->serverRoot)); |
|
279 | 279 | |
280 | 280 | if (is_dir($themeDir)) { |
281 | 281 | $files = scandir($themeDir); |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | return $this->availableLocales; |
302 | 302 | } |
303 | 303 | |
304 | - $localeData = file_get_contents(\OC::$SERVERROOT . '/resources/locales.json'); |
|
304 | + $localeData = file_get_contents(\OC::$SERVERROOT.'/resources/locales.json'); |
|
305 | 305 | $this->availableLocales = \json_decode($localeData, true); |
306 | 306 | |
307 | 307 | return $this->availableLocales; |
@@ -433,12 +433,12 @@ discard block |
||
433 | 433 | $languageFiles = []; |
434 | 434 | |
435 | 435 | $i18nDir = $this->findL10nDir($app); |
436 | - $transFile = strip_tags($i18nDir) . strip_tags($lang) . '.json'; |
|
436 | + $transFile = strip_tags($i18nDir).strip_tags($lang).'.json'; |
|
437 | 437 | |
438 | - if (($this->isSubDirectory($transFile, $this->serverRoot . '/core/l10n/') |
|
439 | - || $this->isSubDirectory($transFile, $this->serverRoot . '/lib/l10n/') |
|
440 | - || $this->isSubDirectory($transFile, $this->serverRoot . '/settings/l10n/') |
|
441 | - || $this->isSubDirectory($transFile, \OC_App::getAppPath($app) . '/l10n/') |
|
438 | + if (($this->isSubDirectory($transFile, $this->serverRoot.'/core/l10n/') |
|
439 | + || $this->isSubDirectory($transFile, $this->serverRoot.'/lib/l10n/') |
|
440 | + || $this->isSubDirectory($transFile, $this->serverRoot.'/settings/l10n/') |
|
441 | + || $this->isSubDirectory($transFile, \OC_App::getAppPath($app).'/l10n/') |
|
442 | 442 | ) |
443 | 443 | && file_exists($transFile)) { |
444 | 444 | // load the translations file |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | // merge with translations from theme |
449 | 449 | $theme = $this->config->getSystemValue('theme'); |
450 | 450 | if (!empty($theme)) { |
451 | - $transFile = $this->serverRoot . '/themes/' . $theme . substr($transFile, strlen($this->serverRoot)); |
|
451 | + $transFile = $this->serverRoot.'/themes/'.$theme.substr($transFile, strlen($this->serverRoot)); |
|
452 | 452 | if (file_exists($transFile)) { |
453 | 453 | $languageFiles[] = $transFile; |
454 | 454 | } |
@@ -465,14 +465,14 @@ discard block |
||
465 | 465 | */ |
466 | 466 | protected function findL10nDir($app = null) { |
467 | 467 | if (in_array($app, ['core', 'lib', 'settings'])) { |
468 | - if (file_exists($this->serverRoot . '/' . $app . '/l10n/')) { |
|
469 | - return $this->serverRoot . '/' . $app . '/l10n/'; |
|
468 | + if (file_exists($this->serverRoot.'/'.$app.'/l10n/')) { |
|
469 | + return $this->serverRoot.'/'.$app.'/l10n/'; |
|
470 | 470 | } |
471 | 471 | } else if ($app && \OC_App::getAppPath($app) !== false) { |
472 | 472 | // Check if the app is in the app folder |
473 | - return \OC_App::getAppPath($app) . '/l10n/'; |
|
473 | + return \OC_App::getAppPath($app).'/l10n/'; |
|
474 | 474 | } |
475 | - return $this->serverRoot . '/core/l10n/'; |
|
475 | + return $this->serverRoot.'/core/l10n/'; |
|
476 | 476 | } |
477 | 477 | |
478 | 478 | |
@@ -489,15 +489,15 @@ discard block |
||
489 | 489 | return $this->pluralFunctions[$string]; |
490 | 490 | } |
491 | 491 | |
492 | - if (preg_match( '/^\s*nplurals\s*=\s*(\d+)\s*;\s*plural=(.*)$/u', $string, $matches)) { |
|
492 | + if (preg_match('/^\s*nplurals\s*=\s*(\d+)\s*;\s*plural=(.*)$/u', $string, $matches)) { |
|
493 | 493 | // sanitize |
494 | - $nplurals = preg_replace( '/[^0-9]/', '', $matches[1] ); |
|
495 | - $plural = preg_replace( '#[^n0-9:\(\)\?\|\&=!<>+*/\%-]#', '', $matches[2] ); |
|
494 | + $nplurals = preg_replace('/[^0-9]/', '', $matches[1]); |
|
495 | + $plural = preg_replace('#[^n0-9:\(\)\?\|\&=!<>+*/\%-]#', '', $matches[2]); |
|
496 | 496 | |
497 | 497 | $body = str_replace( |
498 | - array( 'plural', 'n', '$n$plurals', ), |
|
499 | - array( '$plural', '$n', '$nplurals', ), |
|
500 | - 'nplurals='. $nplurals . '; plural=' . $plural |
|
498 | + array('plural', 'n', '$n$plurals',), |
|
499 | + array('$plural', '$n', '$nplurals',), |
|
500 | + 'nplurals='.$nplurals.'; plural='.$plural |
|
501 | 501 | ); |
502 | 502 | |
503 | 503 | // add parents |
@@ -506,9 +506,9 @@ discard block |
||
506 | 506 | $res = ''; |
507 | 507 | $p = 0; |
508 | 508 | $length = strlen($body); |
509 | - for($i = 0; $i < $length; $i++) { |
|
509 | + for ($i = 0; $i < $length; $i++) { |
|
510 | 510 | $ch = $body[$i]; |
511 | - switch ( $ch ) { |
|
511 | + switch ($ch) { |
|
512 | 512 | case '?': |
513 | 513 | $res .= ' ? ('; |
514 | 514 | $p++; |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | $res .= ') : ('; |
518 | 518 | break; |
519 | 519 | case ';': |
520 | - $res .= str_repeat( ')', $p ) . ';'; |
|
520 | + $res .= str_repeat(')', $p).';'; |
|
521 | 521 | $p = 0; |
522 | 522 | break; |
523 | 523 | default: |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | } |
526 | 526 | } |
527 | 527 | |
528 | - $body = $res . 'return ($plural>=$nplurals?$nplurals-1:$plural);'; |
|
528 | + $body = $res.'return ($plural>=$nplurals?$nplurals-1:$plural);'; |
|
529 | 529 | $function = create_function('$n', $body); |
530 | 530 | $this->pluralFunctions[$string] = $function; |
531 | 531 | return $function; |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | $commonLanguages = []; |
558 | 558 | $languages = []; |
559 | 559 | |
560 | - foreach($languageCodes as $lang) { |
|
560 | + foreach ($languageCodes as $lang) { |
|
561 | 561 | $l = $this->get('lib', $lang); |
562 | 562 | // TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version |
563 | 563 | $potentialName = (string) $l->t('__language_name__'); |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | ksort($commonLanguages); |
591 | 591 | |
592 | 592 | // sort now by displayed language not the iso-code |
593 | - usort( $languages, function ($a, $b) { |
|
593 | + usort($languages, function($a, $b) { |
|
594 | 594 | if ($a['code'] === $a['name'] && $b['code'] !== $b['name']) { |
595 | 595 | // If a doesn't have a name, but b does, list b before a |
596 | 596 | return 1; |
@@ -56,44 +56,44 @@ discard block |
||
56 | 56 | * @param string $renderAs |
57 | 57 | * @param string $appId application id |
58 | 58 | */ |
59 | - public function __construct( $renderAs, $appId = '' ) { |
|
59 | + public function __construct($renderAs, $appId = '') { |
|
60 | 60 | |
61 | 61 | // yes - should be injected .... |
62 | 62 | $this->config = \OC::$server->getConfig(); |
63 | 63 | |
64 | 64 | |
65 | 65 | // Decide which page we show |
66 | - if($renderAs == 'user') { |
|
67 | - parent::__construct( 'core', 'layout.user' ); |
|
68 | - if(in_array(\OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) { |
|
66 | + if ($renderAs == 'user') { |
|
67 | + parent::__construct('core', 'layout.user'); |
|
68 | + if (in_array(\OC_App::getCurrentApp(), ['settings', 'admin', 'help']) !== false) { |
|
69 | 69 | $this->assign('bodyid', 'body-settings'); |
70 | - }else{ |
|
70 | + } else { |
|
71 | 71 | $this->assign('bodyid', 'body-user'); |
72 | 72 | } |
73 | 73 | |
74 | 74 | // Code integrity notification |
75 | 75 | $integrityChecker = \OC::$server->getIntegrityCodeChecker(); |
76 | - if(\OC_User::isAdminUser(\OC_User::getUser()) && $integrityChecker->isCodeCheckEnforced() && !$integrityChecker->hasPassedCheck()) { |
|
76 | + if (\OC_User::isAdminUser(\OC_User::getUser()) && $integrityChecker->isCodeCheckEnforced() && !$integrityChecker->hasPassedCheck()) { |
|
77 | 77 | \OCP\Util::addScript('core', 'integritycheck-failed-notification'); |
78 | 78 | } |
79 | 79 | |
80 | 80 | // Add navigation entry |
81 | - $this->assign( 'application', ''); |
|
82 | - $this->assign( 'appid', $appId ); |
|
81 | + $this->assign('application', ''); |
|
82 | + $this->assign('appid', $appId); |
|
83 | 83 | $navigation = \OC::$server->getNavigationManager()->getAll(); |
84 | - $this->assign( 'navigation', $navigation); |
|
84 | + $this->assign('navigation', $navigation); |
|
85 | 85 | $settingsNavigation = \OC::$server->getNavigationManager()->getAll('settings'); |
86 | - $this->assign( 'settingsnavigation', $settingsNavigation); |
|
87 | - foreach($navigation as $entry) { |
|
86 | + $this->assign('settingsnavigation', $settingsNavigation); |
|
87 | + foreach ($navigation as $entry) { |
|
88 | 88 | if ($entry['active']) { |
89 | - $this->assign( 'application', $entry['name'] ); |
|
89 | + $this->assign('application', $entry['name']); |
|
90 | 90 | break; |
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | - foreach($settingsNavigation as $entry) { |
|
94 | + foreach ($settingsNavigation as $entry) { |
|
95 | 95 | if ($entry['active']) { |
96 | - $this->assign( 'application', $entry['name'] ); |
|
96 | + $this->assign('application', $entry['name']); |
|
97 | 97 | break; |
98 | 98 | } |
99 | 99 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $this->assign('bodyid', 'body-login'); |
126 | 126 | } else if ($renderAs == 'public') { |
127 | 127 | parent::__construct('core', 'layout.public'); |
128 | - $this->assign( 'appid', $appId ); |
|
128 | + $this->assign('appid', $appId); |
|
129 | 129 | $this->assign('bodyid', 'body-public'); |
130 | 130 | } else { |
131 | 131 | parent::__construct('core', 'layout.base'); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $this->assign('language', $lang); |
138 | 138 | $this->assign('locale', \OC::$server->getL10NFactory()->findLocale($lang)); |
139 | 139 | |
140 | - if(\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
140 | + if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
141 | 141 | if (empty(self::$versionHash)) { |
142 | 142 | $v = \OC_App::getAppVersions(); |
143 | 143 | $v['core'] = implode('.', \OCP\Util::getVersion()); |
@@ -169,10 +169,10 @@ discard block |
||
169 | 169 | $this->append('jsfiles', \OC::$server->getURLGenerator()->linkToRoute('core.OCJS.getConfig', ['v' => self::$versionHash])); |
170 | 170 | } |
171 | 171 | } |
172 | - foreach($jsFiles as $info) { |
|
172 | + foreach ($jsFiles as $info) { |
|
173 | 173 | $web = $info[1]; |
174 | 174 | $file = $info[2]; |
175 | - $this->append( 'jsfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
175 | + $this->append('jsfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | try { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | // Do not initialise scss appdata until we have a fully installed instance |
185 | 185 | // Do not load scss for update, errors, installation or login page |
186 | - if(\OC::$server->getSystemConfig()->getValue('installed', false) |
|
186 | + if (\OC::$server->getSystemConfig()->getValue('installed', false) |
|
187 | 187 | && !\OCP\Util::needUpgrade() |
188 | 188 | && $pathInfo !== '' |
189 | 189 | && !preg_match('/^\/login/', $pathInfo) |
@@ -200,14 +200,14 @@ discard block |
||
200 | 200 | $this->assign('cssfiles', array()); |
201 | 201 | $this->assign('printcssfiles', []); |
202 | 202 | $this->assign('versionHash', self::$versionHash); |
203 | - foreach($cssFiles as $info) { |
|
203 | + foreach ($cssFiles as $info) { |
|
204 | 204 | $web = $info[1]; |
205 | 205 | $file = $info[2]; |
206 | 206 | |
207 | 207 | if (substr($file, -strlen('print.css')) === 'print.css') { |
208 | - $this->append( 'printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
208 | + $this->append('printcssfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
209 | 209 | } else { |
210 | - $this->append( 'cssfiles', $web.'/'.$file . $this->getVersionHashSuffix($web, $file) ); |
|
210 | + $this->append('cssfiles', $web.'/'.$file.$this->getVersionHashSuffix($web, $file)); |
|
211 | 211 | } |
212 | 212 | } |
213 | 213 | } |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | |
228 | 228 | if ($this->config->getSystemValue('installed', false)) { |
229 | 229 | if (\OC::$server->getAppManager()->isInstalled('theming')) { |
230 | - $themingSuffix = '-' . $this->config->getAppValue('theming', 'cachebuster', '0'); |
|
230 | + $themingSuffix = '-'.$this->config->getAppValue('theming', 'cachebuster', '0'); |
|
231 | 231 | } |
232 | 232 | $v = \OC_App::getAppVersions(); |
233 | 233 | } |
@@ -235,21 +235,21 @@ discard block |
||
235 | 235 | // Try the webroot path for a match |
236 | 236 | if ($path !== false && $path !== '') { |
237 | 237 | $appName = $this->getAppNamefromPath($path); |
238 | - if(array_key_exists($appName, $v)) { |
|
238 | + if (array_key_exists($appName, $v)) { |
|
239 | 239 | $appVersion = $v[$appName]; |
240 | - return '?v=' . substr(md5($appVersion), 0, 8) . $themingSuffix; |
|
240 | + return '?v='.substr(md5($appVersion), 0, 8).$themingSuffix; |
|
241 | 241 | } |
242 | 242 | } |
243 | 243 | // fallback to the file path instead |
244 | 244 | if ($file !== false && $file !== '') { |
245 | 245 | $appName = $this->getAppNamefromPath($file); |
246 | - if(array_key_exists($appName, $v)) { |
|
246 | + if (array_key_exists($appName, $v)) { |
|
247 | 247 | $appVersion = $v[$appName]; |
248 | - return '?v=' . substr(md5($appVersion), 0, 8) . $themingSuffix; |
|
248 | + return '?v='.substr(md5($appVersion), 0, 8).$themingSuffix; |
|
249 | 249 | } |
250 | 250 | } |
251 | 251 | |
252 | - return '?v=' . self::$versionHash . $themingSuffix; |
|
252 | + return '?v='.self::$versionHash.$themingSuffix; |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | /** |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | // Read the selected theme from the config file |
261 | 261 | $theme = \OC_Util::getTheme(); |
262 | 262 | |
263 | - if($compileScss) { |
|
263 | + if ($compileScss) { |
|
264 | 264 | $SCSSCacher = \OC::$server->query(SCSSCacher::class); |
265 | 265 | } else { |
266 | 266 | $SCSSCacher = null; |
@@ -269,8 +269,8 @@ discard block |
||
269 | 269 | $locator = new \OC\Template\CSSResourceLocator( |
270 | 270 | \OC::$server->getLogger(), |
271 | 271 | $theme, |
272 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
273 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
272 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
273 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
274 | 274 | $SCSSCacher |
275 | 275 | ); |
276 | 276 | $locator->find($styles); |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | $locator = new \OC\Template\JSResourceLocator( |
306 | 306 | \OC::$server->getLogger(), |
307 | 307 | $theme, |
308 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
309 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
308 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
309 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
310 | 310 | \OC::$server->query(JSCombiner::class) |
311 | 311 | ); |
312 | 312 | $locator->find($scripts); |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | */ |
322 | 322 | public static function convertToRelativePath($filePath) { |
323 | 323 | $relativePath = explode(\OC::$SERVERROOT, $filePath); |
324 | - if(count($relativePath) !== 2) { |
|
324 | + if (count($relativePath) !== 2) { |
|
325 | 325 | throw new \Exception('$filePath is not under the \OC::$SERVERROOT'); |
326 | 326 | } |
327 | 327 |