Passed
Push — master ( 2e7eb3...34dc16 )
by Morris
11:12
created
settings/templates/settings/personal/personal.info.php 2 patches
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@  discard block
 block discarded – undo
26 26
 /** @var array $_ */
27 27
 
28 28
 script('settings', [
29
-	'usersettings',
30
-	'templates',
31
-	'federationsettingsview',
32
-	'federationscopemenu',
33
-	'settings/personalInfo',
29
+    'usersettings',
30
+    'templates',
31
+    'federationsettingsview',
32
+    'federationscopemenu',
33
+    'settings/personalInfo',
34 34
 ]);
35 35
 ?>
36 36
 
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
 					<p class="quotatext">
86 86
 						<?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?>
87 87
 							<?php print_unescaped($l->t('You are using <strong>%s</strong>',
88
-								[$_['usage']]));?>
88
+                                [$_['usage']]));?>
89 89
 						<?php else: ?>
90 90
 							<?php print_unescaped($l->t('You are using <strong>%1$s</strong> of <strong>%2$s</strong> (<strong>%3$s %%</strong>)',
91
-								[$_['usage'], $_['total_space'],  $_['usage_relative']]));?>
91
+                                [$_['usage'], $_['total_space'],  $_['usage_relative']]));?>
92 92
 						<?php endif ?>
93 93
 					</p>
94 94
 				</div>
@@ -96,10 +96,10 @@  discard block
 block discarded – undo
96 96
 			</div>
97 97
 		</div>
98 98
 		<?php
99
-			if ($_['show_where_is_your_data_section']) {
100
-				include __DIR__ . '/partials/where-is-your-data.php';
101
-			}
102
-		?>
99
+            if ($_['show_where_is_your_data_section']) {
100
+                include __DIR__ . '/partials/where-is-your-data.php';
101
+            }
102
+        ?>
103 103
 	</div>
104 104
 
105 105
 	<div class="personal-settings-container">
@@ -140,17 +140,17 @@  discard block
 block discarded – undo
140 140
 				<div class="verify <?php if ($_['email'] === ''  || $_['emailScope'] !== 'public') p('hidden'); ?>">
141 141
 					<img id="verify-email" title="<?php p($_['emailMessage']); ?>" data-status="<?php p($_['emailVerification']) ?>" src="
142 142
 				<?php
143
-					switch($_['emailVerification']) {
144
-						case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
145
-							p(image_path('core', 'actions/verifying.svg'));
146
-							break;
147
-						case \OC\Accounts\AccountManager::VERIFIED:
148
-							p(image_path('core', 'actions/verified.svg'));
149
-							break;
150
-						default:
151
-							p(image_path('core', 'actions/verify.svg'));
152
-					}
153
-					?>">
143
+                    switch($_['emailVerification']) {
144
+                        case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
145
+                            p(image_path('core', 'actions/verifying.svg'));
146
+                            break;
147
+                        case \OC\Accounts\AccountManager::VERIFIED:
148
+                            p(image_path('core', 'actions/verified.svg'));
149
+                            break;
150
+                        default:
151
+                            p(image_path('core', 'actions/verify.svg'));
152
+                    }
153
+                    ?>">
154 154
 				</div>
155 155
 				<input type="email" name="email" id="email" value="<?php p($_['email']); ?>"
156 156
 					<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
@@ -228,17 +228,17 @@  discard block
 block discarded – undo
228 228
 				<div class="verify <?php if ($_['website'] === ''  || $_['websiteScope'] !== 'public') p('hidden'); ?>">
229 229
 					<img id="verify-website" title="<?php p($_['websiteMessage']); ?>" data-status="<?php p($_['websiteVerification']) ?>" src="
230 230
 					<?php
231
-					switch($_['websiteVerification']) {
232
-						case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
233
-							p(image_path('core', 'actions/verifying.svg'));
234
-							break;
235
-						case \OC\Accounts\AccountManager::VERIFIED:
236
-							p(image_path('core', 'actions/verified.svg'));
237
-							break;
238
-						default:
239
-							p(image_path('core', 'actions/verify.svg'));
240
-					}
241
-					?>"
231
+                    switch($_['websiteVerification']) {
232
+                        case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
233
+                            p(image_path('core', 'actions/verifying.svg'));
234
+                            break;
235
+                        case \OC\Accounts\AccountManager::VERIFIED:
236
+                            p(image_path('core', 'actions/verified.svg'));
237
+                            break;
238
+                        default:
239
+                            p(image_path('core', 'actions/verify.svg'));
240
+                    }
241
+                    ?>"
242 242
 					<?php if($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
243 243
 					>
244 244
 					<div class="verification-dialog popovermenu bubble menu">
@@ -277,17 +277,17 @@  discard block
 block discarded – undo
277 277
 				<div class="verify <?php if ($_['twitter'] === ''  || $_['twitterScope'] !== 'public') p('hidden'); ?>">
278 278
 					<img id="verify-twitter" title="<?php p($_['twitterMessage']); ?>" data-status="<?php p($_['twitterVerification']) ?>" src="
279 279
 					<?php
280
-					switch($_['twitterVerification']) {
281
-						case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
282
-							p(image_path('core', 'actions/verifying.svg'));
283
-							break;
284
-						case \OC\Accounts\AccountManager::VERIFIED:
285
-							p(image_path('core', 'actions/verified.svg'));
286
-							break;
287
-						default:
288
-							p(image_path('core', 'actions/verify.svg'));
289
-					}
290
-					?>"
280
+                    switch($_['twitterVerification']) {
281
+                        case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
282
+                            p(image_path('core', 'actions/verifying.svg'));
283
+                            break;
284
+                        case \OC\Accounts\AccountManager::VERIFIED:
285
+                            p(image_path('core', 'actions/verified.svg'));
286
+                            break;
287
+                        default:
288
+                            p(image_path('core', 'actions/verify.svg'));
289
+                    }
290
+                    ?>"
291 291
 					<?php if($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
292 292
 					>
293 293
 					<div class="verification-dialog popovermenu bubble menu">
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 					</div>
68 68
 				</div>
69 69
 				<span class="icon-checkmark hidden"></span>
70
-				<?php if($_['lookupServerUploadEnabled']) { ?>
70
+				<?php if ($_['lookupServerUploadEnabled']) { ?>
71 71
 				<input type="hidden" id="avatarscope" value="<?php p($_['avatarScope']) ?>">
72 72
 				<?php } ?>
73 73
 			</form>
@@ -85,19 +85,19 @@  discard block
 block discarded – undo
85 85
 					<p class="quotatext">
86 86
 						<?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?>
87 87
 							<?php print_unescaped($l->t('You are using <strong>%s</strong>',
88
-								[$_['usage']]));?>
88
+								[$_['usage']])); ?>
89 89
 						<?php else: ?>
90 90
 							<?php print_unescaped($l->t('You are using <strong>%1$s</strong> of <strong>%2$s</strong> (<strong>%3$s %%</strong>)',
91
-								[$_['usage'], $_['total_space'],  $_['usage_relative']]));?>
91
+								[$_['usage'], $_['total_space'], $_['usage_relative']])); ?>
92 92
 						<?php endif ?>
93 93
 					</p>
94 94
 				</div>
95
-				<progress value="<?php p($_['usage_relative']); ?>" max="100"<?php if($_['usage_relative'] > 80): ?> class="warn" <?php endif; ?>></progress>
95
+				<progress value="<?php p($_['usage_relative']); ?>" max="100"<?php if ($_['usage_relative'] > 80): ?> class="warn" <?php endif; ?>></progress>
96 96
 			</div>
97 97
 		</div>
98 98
 		<?php
99 99
 			if ($_['show_where_is_your_data_section']) {
100
-				include __DIR__ . '/partials/where-is-your-data.php';
100
+				include __DIR__.'/partials/where-is-your-data.php';
101 101
 			}
102 102
 		?>
103 103
 	</div>
@@ -114,15 +114,15 @@  discard block
 block discarded – undo
114 114
 					</div>
115 115
 				</h3>
116 116
 				<input type="text" id="displayname" name="displayname"
117
-					<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
117
+					<?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
118 118
 					   value="<?php p($_['displayName']) ?>"
119 119
 					   autocomplete="on" autocapitalize="none" autocorrect="off" />
120
-				<?php if(!$_['displayNameChangeSupported']) { ?>
121
-					<span><?php if(isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
120
+				<?php if (!$_['displayNameChangeSupported']) { ?>
121
+					<span><?php if (isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
122 122
 				<?php } ?>
123 123
 				<span class="icon-checkmark hidden"></span>
124 124
 				<span class="icon-error hidden" ></span>
125
-				<?php if($_['lookupServerUploadEnabled']) { ?>
125
+				<?php if ($_['lookupServerUploadEnabled']) { ?>
126 126
 					<input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>">
127 127
 				<?php } ?>
128 128
 			</form>
@@ -137,10 +137,10 @@  discard block
 block discarded – undo
137 137
 						</span>
138 138
 					</div>
139 139
 				</h3>
140
-				<div class="verify <?php if ($_['email'] === ''  || $_['emailScope'] !== 'public') p('hidden'); ?>">
140
+				<div class="verify <?php if ($_['email'] === '' || $_['emailScope'] !== 'public') p('hidden'); ?>">
141 141
 					<img id="verify-email" title="<?php p($_['emailMessage']); ?>" data-status="<?php p($_['emailVerification']) ?>" src="
142 142
 				<?php
143
-					switch($_['emailVerification']) {
143
+					switch ($_['emailVerification']) {
144 144
 						case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
145 145
 							p(image_path('core', 'actions/verifying.svg'));
146 146
 							break;
@@ -153,18 +153,18 @@  discard block
 block discarded – undo
153 153
 					?>">
154 154
 				</div>
155 155
 				<input type="email" name="email" id="email" value="<?php p($_['email']); ?>"
156
-					<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
156
+					<?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
157 157
 					   placeholder="<?php p($l->t('Your email address')); ?>"
158 158
 					   autocomplete="on" autocapitalize="none" autocorrect="off" />
159 159
 			   	<span class="icon-checkmark hidden"></span>
160 160
 				<span class="icon-error hidden" ></span>
161
-				<?php if(!$_['displayNameChangeSupported']) { ?>
162
-					<span><?php if(isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span>
161
+				<?php if (!$_['displayNameChangeSupported']) { ?>
162
+					<span><?php if (isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span>
163 163
 				<?php } ?>
164
-				<?php if($_['displayNameChangeSupported']) { ?>
164
+				<?php if ($_['displayNameChangeSupported']) { ?>
165 165
 					<em><?php p($l->t('For password reset and notifications')); ?></em>
166 166
 				<?php } ?>
167
-				<?php if($_['lookupServerUploadEnabled']) { ?>
167
+				<?php if ($_['lookupServerUploadEnabled']) { ?>
168 168
 					<input type="hidden" id="emailscope" value="<?php p($_['emailScope']) ?>">
169 169
 				<?php } ?>
170 170
 			</form>
@@ -180,12 +180,12 @@  discard block
 block discarded – undo
180 180
 						</span>
181 181
 					</div>
182 182
 				</h3>
183
-				<input type="tel" id="phone" name="phone" <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?>
183
+				<input type="tel" id="phone" name="phone" <?php if (!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?>
184 184
 					   value="<?php p($_['phone']) ?>"
185 185
 					   placeholder="<?php p($l->t('Your phone number')); ?>"
186 186
 				       autocomplete="on" autocapitalize="none" autocorrect="off" />
187 187
 				<span class="icon-checkmark hidden"></span>
188
-				<?php if($_['lookupServerUploadEnabled']) { ?>
188
+				<?php if ($_['lookupServerUploadEnabled']) { ?>
189 189
 				<input type="hidden" id="phonescope" value="<?php p($_['phoneScope']) ?>">
190 190
 				<?php } ?>
191 191
 			</form>
@@ -202,12 +202,12 @@  discard block
 block discarded – undo
202 202
 						</span>
203 203
 					</div>
204 204
 				</h3>
205
-				<input type="text" id="address" name="address" <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"');  ?>
205
+				<input type="text" id="address" name="address" <?php if (!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?>
206 206
 					   placeholder="<?php p($l->t('Your postal address')); ?>"
207 207
 					   value="<?php p($_['address']) ?>"
208 208
 					   autocomplete="on" autocapitalize="none" autocorrect="off" />
209 209
 				<span class="icon-checkmark hidden"></span>
210
-				<?php if($_['lookupServerUploadEnabled']) { ?>
210
+				<?php if ($_['lookupServerUploadEnabled']) { ?>
211 211
 				<input type="hidden" id="addressscope" value="<?php p($_['addressScope']) ?>">
212 212
 				<?php } ?>
213 213
 			</form>
@@ -224,11 +224,11 @@  discard block
 block discarded – undo
224 224
 						</span>
225 225
 					</div>
226 226
 				</h3>
227
-				<?php if($_['lookupServerUploadEnabled']) { ?>
228
-				<div class="verify <?php if ($_['website'] === ''  || $_['websiteScope'] !== 'public') p('hidden'); ?>">
227
+				<?php if ($_['lookupServerUploadEnabled']) { ?>
228
+				<div class="verify <?php if ($_['website'] === '' || $_['websiteScope'] !== 'public') p('hidden'); ?>">
229 229
 					<img id="verify-website" title="<?php p($_['websiteMessage']); ?>" data-status="<?php p($_['websiteVerification']) ?>" src="
230 230
 					<?php
231
-					switch($_['websiteVerification']) {
231
+					switch ($_['websiteVerification']) {
232 232
 						case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
233 233
 							p(image_path('core', 'actions/verifying.svg'));
234 234
 							break;
@@ -239,13 +239,13 @@  discard block
 block discarded – undo
239 239
 							p(image_path('core', 'actions/verify.svg'));
240 240
 					}
241 241
 					?>"
242
-					<?php if($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
242
+					<?php if ($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
243 243
 					>
244 244
 					<div class="verification-dialog popovermenu bubble menu">
245 245
 						<div class="verification-dialog-content">
246 246
 							<p class="explainVerification"></p>
247 247
 							<p class="verificationCode"></p>
248
-							<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p>
248
+							<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p>
249 249
 						</div>
250 250
 					</div>
251 251
 				</div>
@@ -253,10 +253,10 @@  discard block
 block discarded – undo
253 253
 				<input type="url" name="website" id="website" value="<?php p($_['website']); ?>"
254 254
 				       placeholder="<?php p($l->t('Link https://…')); ?>"
255 255
 				       autocomplete="on" autocapitalize="none" autocorrect="off"
256
-					   <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"');  ?>
256
+					   <?php if (!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?>
257 257
 				/>
258 258
 				<span class="icon-checkmark hidden"></span>
259
-				<?php if($_['lookupServerUploadEnabled']) { ?>
259
+				<?php if ($_['lookupServerUploadEnabled']) { ?>
260 260
 				<input type="hidden" id="websitescope" value="<?php p($_['websiteScope']) ?>">
261 261
 				<?php } ?>
262 262
 			</form>
@@ -273,11 +273,11 @@  discard block
 block discarded – undo
273 273
 						</span>
274 274
 					</div>
275 275
 				</h3>
276
-				<?php if($_['lookupServerUploadEnabled']) { ?>
277
-				<div class="verify <?php if ($_['twitter'] === ''  || $_['twitterScope'] !== 'public') p('hidden'); ?>">
276
+				<?php if ($_['lookupServerUploadEnabled']) { ?>
277
+				<div class="verify <?php if ($_['twitter'] === '' || $_['twitterScope'] !== 'public') p('hidden'); ?>">
278 278
 					<img id="verify-twitter" title="<?php p($_['twitterMessage']); ?>" data-status="<?php p($_['twitterVerification']) ?>" src="
279 279
 					<?php
280
-					switch($_['twitterVerification']) {
280
+					switch ($_['twitterVerification']) {
281 281
 						case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
282 282
 							p(image_path('core', 'actions/verifying.svg'));
283 283
 							break;
@@ -288,13 +288,13 @@  discard block
 block discarded – undo
288 288
 							p(image_path('core', 'actions/verify.svg'));
289 289
 					}
290 290
 					?>"
291
-					<?php if($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
291
+					<?php if ($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
292 292
 					>
293 293
 					<div class="verification-dialog popovermenu bubble menu">
294 294
 						<div class="verification-dialog-content">
295 295
 							<p class="explainVerification"></p>
296 296
 							<p class="verificationCode"></p>
297
-							<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p>
297
+							<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p>
298 298
 						</div>
299 299
 					</div>
300 300
 				</div>
@@ -302,10 +302,10 @@  discard block
 block discarded – undo
302 302
 				<input type="text" name="twitter" id="twitter" value="<?php p($_['twitter']); ?>"
303 303
 					   placeholder="<?php p($l->t('Twitter handle @…')); ?>"
304 304
 					   autocomplete="on" autocapitalize="none" autocorrect="off"
305
-					   <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"');  ?>
305
+					   <?php if (!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?>
306 306
 				/>
307 307
 				<span class="icon-checkmark hidden"></span>
308
-				<?php if($_['lookupServerUploadEnabled']) { ?>
308
+				<?php if ($_['lookupServerUploadEnabled']) { ?>
309 309
 				<input type="hidden" id="twitterscope" value="<?php p($_['twitterScope']) ?>">
310 310
 				<?php } ?>
311 311
 			</form>
@@ -318,27 +318,27 @@  discard block
 block discarded – undo
318 318
 			<?php if (isset($_['activelanguage'])) { ?>
319 319
 				<form id="language" class="section">
320 320
 					<h3>
321
-						<label for="languageinput"><?php p($l->t('Language'));?></label>
321
+						<label for="languageinput"><?php p($l->t('Language')); ?></label>
322 322
 					</h3>
323
-					<select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language'));?>">
324
-						<option value="<?php p($_['activelanguage']['code']);?>">
325
-							<?php p($_['activelanguage']['name']);?>
323
+					<select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language')); ?>">
324
+						<option value="<?php p($_['activelanguage']['code']); ?>">
325
+							<?php p($_['activelanguage']['name']); ?>
326 326
 						</option>
327
-						<?php foreach($_['commonlanguages'] as $language):?>
328
-							<option value="<?php p($language['code']);?>">
329
-								<?php p($language['name']);?>
327
+						<?php foreach ($_['commonlanguages'] as $language):?>
328
+							<option value="<?php p($language['code']); ?>">
329
+								<?php p($language['name']); ?>
330 330
 							</option>
331
-						<?php endforeach;?>
331
+						<?php endforeach; ?>
332 332
 						<optgroup label="––––––––––"></optgroup>
333
-						<?php foreach($_['languages'] as $language):?>
334
-							<option value="<?php p($language['code']);?>">
335
-								<?php p($language['name']);?>
333
+						<?php foreach ($_['languages'] as $language):?>
334
+							<option value="<?php p($language['code']); ?>">
335
+								<?php p($language['name']); ?>
336 336
 							</option>
337
-						<?php endforeach;?>
337
+						<?php endforeach; ?>
338 338
 					</select>
339 339
 					<a href="https://www.transifex.com/nextcloud/nextcloud/"
340 340
 					   target="_blank" rel="noreferrer noopener">
341
-						<em><?php p($l->t('Help translate'));?></em>
341
+						<em><?php p($l->t('Help translate')); ?></em>
342 342
 					</a>
343 343
 				</form>
344 344
 			<?php } ?>
@@ -347,27 +347,27 @@  discard block
 block discarded – undo
347 347
 			<?php if (isset($_['activelocale'])) { ?>
348 348
 				<form id="locale" class="section">
349 349
 					<h3>
350
-						<label for="localeinput"><?php p($l->t('Locale'));?></label>
350
+						<label for="localeinput"><?php p($l->t('Locale')); ?></label>
351 351
 					</h3>
352
-					<select id="localeinput" name="lang" data-placeholder="<?php p($l->t('Locale'));?>">
353
-						<option value="<?php p($_['activelocale']['code']);?>">
354
-							<?php p($_['activelocale']['name']);?>
352
+					<select id="localeinput" name="lang" data-placeholder="<?php p($l->t('Locale')); ?>">
353
+						<option value="<?php p($_['activelocale']['code']); ?>">
354
+							<?php p($_['activelocale']['name']); ?>
355 355
 						</option>
356 356
 						<optgroup label="––––––––––"></optgroup>
357
-						<?php foreach($_['localesForLanguage'] as $locale):?>
358
-							<option value="<?php p($locale['code']);?>">
359
-								<?php p($locale['name']);?>
357
+						<?php foreach ($_['localesForLanguage'] as $locale):?>
358
+							<option value="<?php p($locale['code']); ?>">
359
+								<?php p($locale['name']); ?>
360 360
 							</option>
361
-						<?php endforeach;?>
361
+						<?php endforeach; ?>
362 362
 						<optgroup label="––––––––––"></optgroup>
363
-						<option value="<?php p($_['activelocale']['code']);?>">
364
-							<?php p($_['activelocale']['name']);?>
363
+						<option value="<?php p($_['activelocale']['code']); ?>">
364
+							<?php p($_['activelocale']['name']); ?>
365 365
 						</option>
366
-						<?php foreach($_['locales'] as $locale):?>
367
-							<option value="<?php p($locale['code']);?>">
368
-								<?php p($locale['name']);?>
366
+						<?php foreach ($_['locales'] as $locale):?>
367
+							<option value="<?php p($locale['code']); ?>">
368
+								<?php p($locale['name']); ?>
369 369
 							</option>
370
-						<?php endforeach;?>
370
+						<?php endforeach; ?>
371 371
 					</select>
372 372
 					<div id="localeexample" class="personal-info icon-timezone">
373 373
 						<p>
Please login to merge, or discard this patch.
settings/templates/settings/personal/partials/where-is-your-data.php 2 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -21,24 +21,24 @@  discard block
 block discarded – undo
21 21
 	<div class="personal-info icon-home">
22 22
 		<p>
23 23
 			<?php
24
-				if (empty($_['providerLink']) === false) {
25
-					echo $l->t('Your provider is %s%s%s.', [
26
-						'<a href="' . $_['providerLink'] . '" target="_blank" title="" rel="noreferrer noopener">',
27
-						$_['provider'],
28
-						'</a>'
29
-					]);
30
-				} else {
31
-					echo $l->t('Your provider is %s.', [$_['provider']]);
32
-				}
33
-			?>
24
+                if (empty($_['providerLink']) === false) {
25
+                    echo $l->t('Your provider is %s%s%s.', [
26
+                        '<a href="' . $_['providerLink'] . '" target="_blank" title="" rel="noreferrer noopener">',
27
+                        $_['provider'],
28
+                        '</a>'
29
+                    ]);
30
+                } else {
31
+                    echo $l->t('Your provider is %s.', [$_['provider']]);
32
+                }
33
+            ?>
34 34
 			<?php
35
-				if (empty($_['providerPrivacyLink']) === false) {
36
-					echo $l->t('Read the %sprivacy policy%s now.', [
37
-						'<a href="' . $_['providerPrivacyLink'] . '" target="_blank" title="" rel="noreferrer noopener">',
38
-						'</a>'
39
-					]);
40
-				}
41
-			?>
35
+                if (empty($_['providerPrivacyLink']) === false) {
36
+                    echo $l->t('Read the %sprivacy policy%s now.', [
37
+                        '<a href="' . $_['providerPrivacyLink'] . '" target="_blank" title="" rel="noreferrer noopener">',
38
+                        '</a>'
39
+                    ]);
40
+                }
41
+            ?>
42 42
 		</p>
43 43
 	</div>
44 44
 	<?php endif; ?>
@@ -47,12 +47,12 @@  discard block
 block discarded – undo
47 47
 		<div class="personal-info icon-password">
48 48
 			<p>
49 49
 				<?php echo $l->t(
50
-					'Your files are encrypted with %sserver side encryption%s.',
51
-					[
52
-						'<a href="https://nextcloud.com/blog/encryption-in-nextcloud/" target="_blank" title="" rel="noreferrer noopener">',
53
-						'</a>'
54
-					]
55
-				); ?>
50
+                    'Your files are encrypted with %sserver side encryption%s.',
51
+                    [
52
+                        '<a href="https://nextcloud.com/blog/encryption-in-nextcloud/" target="_blank" title="" rel="noreferrer noopener">',
53
+                        '</a>'
54
+                    ]
55
+                ); ?>
56 56
 			</p>
57 57
 		</div>
58 58
 	<?php endif; ?>
@@ -61,15 +61,15 @@  discard block
 block discarded – undo
61 61
 	<div class="personal-info icon-user-admin">
62 62
 		<p>
63 63
 			<?php echo $l->t(
64
-				'%s%s%s is your admin. If you have any issues, %scontact them%s.',
65
-				[
66
-					'<a href="mailto:' . $_['adminMail'] . '" target="_blank" title="" rel="noreferrer noopener">',
67
-					$_['adminName'],
68
-					'</a>',
69
-					'<a href="mailto:' . $_['adminMail'] . '" target="_blank" title="" rel="noreferrer noopener">',
70
-					'</a>'
71
-				]
72
-			); ?>
64
+                '%s%s%s is your admin. If you have any issues, %scontact them%s.',
65
+                [
66
+                    '<a href="mailto:' . $_['adminMail'] . '" target="_blank" title="" rel="noreferrer noopener">',
67
+                    $_['adminName'],
68
+                    '</a>',
69
+                    '<a href="mailto:' . $_['adminMail'] . '" target="_blank" title="" rel="noreferrer noopener">',
70
+                    '</a>'
71
+                ]
72
+            ); ?>
73 73
 		</p>
74 74
 	</div>
75 75
 	<?php endif; ?>
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 			<?php
24 24
 				if (empty($_['providerLink']) === false) {
25 25
 					echo $l->t('Your provider is %s%s%s.', [
26
-						'<a href="' . $_['providerLink'] . '" target="_blank" title="" rel="noreferrer noopener">',
26
+						'<a href="'.$_['providerLink'].'" target="_blank" title="" rel="noreferrer noopener">',
27 27
 						$_['provider'],
28 28
 						'</a>'
29 29
 					]);
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 			<?php
35 35
 				if (empty($_['providerPrivacyLink']) === false) {
36 36
 					echo $l->t('Read the %sprivacy policy%s now.', [
37
-						'<a href="' . $_['providerPrivacyLink'] . '" target="_blank" title="" rel="noreferrer noopener">',
37
+						'<a href="'.$_['providerPrivacyLink'].'" target="_blank" title="" rel="noreferrer noopener">',
38 38
 						'</a>'
39 39
 					]);
40 40
 				}
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
 			<?php echo $l->t(
64 64
 				'%s%s%s is your admin. If you have any issues, %scontact them%s.',
65 65
 				[
66
-					'<a href="mailto:' . $_['adminMail'] . '" target="_blank" title="" rel="noreferrer noopener">',
66
+					'<a href="mailto:'.$_['adminMail'].'" target="_blank" title="" rel="noreferrer noopener">',
67 67
 					$_['adminName'],
68 68
 					'</a>',
69
-					'<a href="mailto:' . $_['adminMail'] . '" target="_blank" title="" rel="noreferrer noopener">',
69
+					'<a href="mailto:'.$_['adminMail'].'" target="_blank" title="" rel="noreferrer noopener">',
70 70
 					'</a>'
71 71
 				]
72 72
 			); ?>
Please login to merge, or discard this patch.
settings/templates/settings/admin/server-info.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
 			<label class="label" for="adminContact"><?php p($l->t('Admin contact')); ?></label>
83 83
 			<select class="form-input" name="adminContact" id="adminContact">
84 84
 				<option value=""><?php p($l->t('choose admin contact')); ?></option>
85
-				<?php foreach($_['adminUsers'] as $adminUser): ?>
85
+				<?php foreach ($_['adminUsers'] as $adminUser): ?>
86 86
 					<option
87 87
 						value="<?php p($adminUser['id']); ?>"
88 88
 						<?php if ($adminUser['id'] === $_['adminContact']): ?>selected="selected"<?php endif; ?>>
Please login to merge, or discard this patch.
settings/routes.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -38,58 +38,58 @@
 block discarded – undo
38 38
 
39 39
 $application = new Application();
40 40
 $application->registerRoutes($this, [
41
-	'resources' => [
42
-		'AuthSettings' => ['url' => '/settings/personal/authtokens'],
43
-	],
44
-	'routes' => [
45
-		['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST'],
46
-		['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST'],
47
-		['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST'],
48
-		['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST'],
41
+    'resources' => [
42
+        'AuthSettings' => ['url' => '/settings/personal/authtokens'],
43
+    ],
44
+    'routes' => [
45
+        ['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST'],
46
+        ['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST'],
47
+        ['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST'],
48
+        ['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST'],
49 49
 
50
-		['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET'],
51
-		['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET'],
52
-		['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET'],
53
-		['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'GET'],
54
-		['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'POST'],
55
-		['name' => 'AppSettings#enableApps', 'url' => '/settings/apps/enable', 'verb' => 'POST'],
56
-		['name' => 'AppSettings#disableApp', 'url' => '/settings/apps/disable/{appId}', 'verb' => 'GET'],
57
-		['name' => 'AppSettings#disableApps', 'url' => '/settings/apps/disable', 'verb' => 'POST'],
58
-		['name' => 'AppSettings#updateApp', 'url' => '/settings/apps/update/{appId}', 'verb' => 'GET'],
59
-		['name' => 'AppSettings#uninstallApp', 'url' => '/settings/apps/uninstall/{appId}', 'verb' => 'GET'],
60
-		['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}', 'verb' => 'GET', 'defaults' => ['category' => '']],
61
-		['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}/{id}', 'verb' => 'GET', 'defaults' => ['category' => '', 'id' => '']],
50
+        ['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET'],
51
+        ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET'],
52
+        ['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET'],
53
+        ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'GET'],
54
+        ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'POST'],
55
+        ['name' => 'AppSettings#enableApps', 'url' => '/settings/apps/enable', 'verb' => 'POST'],
56
+        ['name' => 'AppSettings#disableApp', 'url' => '/settings/apps/disable/{appId}', 'verb' => 'GET'],
57
+        ['name' => 'AppSettings#disableApps', 'url' => '/settings/apps/disable', 'verb' => 'POST'],
58
+        ['name' => 'AppSettings#updateApp', 'url' => '/settings/apps/update/{appId}', 'verb' => 'GET'],
59
+        ['name' => 'AppSettings#uninstallApp', 'url' => '/settings/apps/uninstall/{appId}', 'verb' => 'GET'],
60
+        ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}', 'verb' => 'GET', 'defaults' => ['category' => '']],
61
+        ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}/{id}', 'verb' => 'GET', 'defaults' => ['category' => '', 'id' => '']],
62 62
 
63
-		['name' => 'Users#setDisplayName', 'url' => '/settings/users/{username}/displayName', 'verb' => 'POST'],
64
-		['name' => 'Users#setEMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT'],
65
-		['name' => 'Users#setUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'PUT'],
66
-		['name' => 'Users#getVerificationCode', 'url' => '/settings/users/{account}/verify', 'verb' => 'GET'],
67
-		['name' => 'Users#usersList', 'url' => '/settings/users', 'verb' => 'GET'],
68
-		['name' => 'Users#usersListByGroup', 'url' => '/settings/users/{group}', 'verb' => 'GET', 'requirements' => ['group' => '.+']],
69
-		['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST'],
70
-		['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET'],
71
-		['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET'],
72
-		['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET'],
73
-		['name' => 'CheckSetup#getFailedIntegrityCheckFiles', 'url' => '/settings/integrity/failed', 'verb' => 'GET'],
74
-		['name' => 'CheckSetup#rescanFailedIntegrityCheck', 'url' => '/settings/integrity/rescan', 'verb' => 'GET'],
75
-		['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST'],
76
-		['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE'],
77
-		['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST'],
78
-		['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE'],
79
-		['name' => 'PersonalSettings#index', 'url' => '/settings/user/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'personal-info']],
80
-		['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server']],
81
-		['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET'],
82
-		['name' => 'ChangePassword#changePersonalPassword', 'url' => '/settings/personal/changepassword', 'verb' => 'POST'],
83
-		['name' => 'ChangePassword#changeUserPassword', 'url' => '/settings/users/changepassword', 'verb' => 'POST'],
84
-		['name' => 'TwoFactorSettings#index', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'GET'],
85
-		['name' => 'TwoFactorSettings#update', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'PUT'],
86
-		['name' => 'ServerInfoSettings#storeServerInfo', 'url' => '/settings/serverinfo', 'verb' => 'POST'],
87
-	]
63
+        ['name' => 'Users#setDisplayName', 'url' => '/settings/users/{username}/displayName', 'verb' => 'POST'],
64
+        ['name' => 'Users#setEMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT'],
65
+        ['name' => 'Users#setUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'PUT'],
66
+        ['name' => 'Users#getVerificationCode', 'url' => '/settings/users/{account}/verify', 'verb' => 'GET'],
67
+        ['name' => 'Users#usersList', 'url' => '/settings/users', 'verb' => 'GET'],
68
+        ['name' => 'Users#usersListByGroup', 'url' => '/settings/users/{group}', 'verb' => 'GET', 'requirements' => ['group' => '.+']],
69
+        ['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST'],
70
+        ['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET'],
71
+        ['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET'],
72
+        ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET'],
73
+        ['name' => 'CheckSetup#getFailedIntegrityCheckFiles', 'url' => '/settings/integrity/failed', 'verb' => 'GET'],
74
+        ['name' => 'CheckSetup#rescanFailedIntegrityCheck', 'url' => '/settings/integrity/rescan', 'verb' => 'GET'],
75
+        ['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST'],
76
+        ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE'],
77
+        ['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST'],
78
+        ['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE'],
79
+        ['name' => 'PersonalSettings#index', 'url' => '/settings/user/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'personal-info']],
80
+        ['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server']],
81
+        ['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET'],
82
+        ['name' => 'ChangePassword#changePersonalPassword', 'url' => '/settings/personal/changepassword', 'verb' => 'POST'],
83
+        ['name' => 'ChangePassword#changeUserPassword', 'url' => '/settings/users/changepassword', 'verb' => 'POST'],
84
+        ['name' => 'TwoFactorSettings#index', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'GET'],
85
+        ['name' => 'TwoFactorSettings#update', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'PUT'],
86
+        ['name' => 'ServerInfoSettings#storeServerInfo', 'url' => '/settings/serverinfo', 'verb' => 'POST'],
87
+    ]
88 88
 ]);
89 89
 
90 90
 /** @var $this \OCP\Route\IRouter */
91 91
 
92 92
 // Settings pages
93 93
 $this->create('settings_help', '/settings/help')
94
-	->actionInclude('settings/help.php');
94
+    ->actionInclude('settings/help.php');
95 95
 
Please login to merge, or discard this patch.
settings/Controller/ServerInfoSettingsController.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -32,36 +32,36 @@
 block discarded – undo
32 32
  */
33 33
 class ServerInfoSettingsController extends Controller {
34 34
 
35
-	/**
36
-	 * @var IConfig
37
-	 */
38
-	private $config;
35
+    /**
36
+     * @var IConfig
37
+     */
38
+    private $config;
39 39
 
40
-	/**
41
-	 * ServerInfoSettingsController constructor.
42
-	 *
43
-	 * @param IConfig $config
44
-	 */
45
-	public function __construct($appName, IRequest $request, IConfig $config) {
46
-		parent::__construct($appName, $request);
47
-		$this->config = $config;
48
-	}
40
+    /**
41
+     * ServerInfoSettingsController constructor.
42
+     *
43
+     * @param IConfig $config
44
+     */
45
+    public function __construct($appName, IRequest $request, IConfig $config) {
46
+        parent::__construct($appName, $request);
47
+        $this->config = $config;
48
+    }
49 49
 
50
-	public function storeServerInfo(
51
-		string $location,
52
-		string $provider,
53
-		string $providerWebsite,
54
-		string $providerPrivacyLink,
55
-		string $adminContact
56
-	): void {
57
-		$configs = [
58
-			ServerInfo::SETTING_LOCATION => $location,
59
-			ServerInfo::SETTING_PROVIDER => $provider,
60
-			ServerInfo::SETTING_PROVIDER_WEBSITE => $providerWebsite,
61
-			ServerInfo::SETTING_PROVIDER_PRIVACY_LINK => $providerPrivacyLink,
62
-			ServerInfo::SETTING_PROVIDER_ADMIN_CONTACT => $adminContact
63
-		];
64
-		$this->config->setSystemValues($configs);
65
-	}
50
+    public function storeServerInfo(
51
+        string $location,
52
+        string $provider,
53
+        string $providerWebsite,
54
+        string $providerPrivacyLink,
55
+        string $adminContact
56
+    ): void {
57
+        $configs = [
58
+            ServerInfo::SETTING_LOCATION => $location,
59
+            ServerInfo::SETTING_PROVIDER => $provider,
60
+            ServerInfo::SETTING_PROVIDER_WEBSITE => $providerWebsite,
61
+            ServerInfo::SETTING_PROVIDER_PRIVACY_LINK => $providerPrivacyLink,
62
+            ServerInfo::SETTING_PROVIDER_ADMIN_CONTACT => $adminContact
63
+        ];
64
+        $this->config->setSystemValues($configs);
65
+    }
66 66
 
67 67
 }
Please login to merge, or discard this patch.
lib/private/Settings/Personal/PersonalInfo.php 1 patch
Indentation   +269 added lines, -269 removed lines patch added patch discarded remove patch
@@ -43,274 +43,274 @@
 block discarded – undo
43 43
 
44 44
 class PersonalInfo implements ISettings {
45 45
 
46
-	/** @var IConfig */
47
-	private $config;
48
-	/** @var IUserManager */
49
-	private $userManager;
50
-	/** @var AccountManager */
51
-	private $accountManager;
52
-	/** @var IGroupManager */
53
-	private $groupManager;
54
-	/** @var IAppManager */
55
-	private $appManager;
56
-	/** @var IFactory */
57
-	private $l10nFactory;
58
-	/** @var IL10N */
59
-	private $l;
60
-	/** @var EncryptionManager */
61
-	private $encryptionManager;
62
-
63
-	/**
64
-	 * @param IConfig $config
65
-	 * @param IUserManager $userManager
66
-	 * @param IGroupManager $groupManager
67
-	 * @param AccountManager $accountManager
68
-	 * @param IAppManager $appManager
69
-	 * @param IFactory $l10nFactory
70
-	 * @param IL10N $l
71
-	 * @param EncryptionManager $encryptionManager
72
-	 */
73
-	public function __construct(
74
-		IConfig $config,
75
-		IUserManager $userManager,
76
-		IGroupManager $groupManager,
77
-		AccountManager $accountManager,
78
-		IAppManager $appManager,
79
-		IFactory $l10nFactory,
80
-		IL10N $l,
81
-		EncryptionManager $encryptionManager
82
-	) {
83
-		$this->config = $config;
84
-		$this->userManager = $userManager;
85
-		$this->accountManager = $accountManager;
86
-		$this->groupManager = $groupManager;
87
-		$this->appManager = $appManager;
88
-		$this->l10nFactory = $l10nFactory;
89
-		$this->l = $l;
90
-		$this->encryptionManager = $encryptionManager;
91
-	}
92
-
93
-	/**
94
-	 * @return TemplateResponse returns the instance with all parameters set, ready to be rendered
95
-	 * @since 9.1
96
-	 */
97
-	public function getForm() {
98
-		$federatedFileSharingEnabled = $this->appManager->isEnabledForUser('federatedfilesharing');
99
-		$lookupServerUploadEnabled = false;
100
-		if($federatedFileSharingEnabled) {
101
-			$federatedFileSharing = new Application();
102
-			$shareProvider = $federatedFileSharing->getFederatedShareProvider();
103
-			$lookupServerUploadEnabled = $shareProvider->isLookupServerUploadEnabled();
104
-		}
105
-
106
-		$uid = \OC_User::getUser();
107
-		$user = $this->userManager->get($uid);
108
-		$userData = $this->accountManager->getUser($user);
109
-
110
-		$storageInfo = \OC_Helper::getStorageInfo('/');
111
-		if ($storageInfo['quota'] === FileInfo::SPACE_UNLIMITED) {
112
-			$totalSpace = $this->l->t('Unlimited');
113
-		} else {
114
-			$totalSpace = \OC_Helper::humanFileSize($storageInfo['total']);
115
-		}
116
-
117
-		$languageParameters = $this->getLanguages($user);
118
-		$localeParameters = $this->getLocales($user);
119
-		$messageParameters = $this->getMessageParameters($userData);
120
-
121
-		$parameters = [
122
-			'total_space' => $totalSpace,
123
-			'usage' => \OC_Helper::humanFileSize($storageInfo['used']),
124
-			'usage_relative' => round($storageInfo['relative']),
125
-			'quota' => $storageInfo['quota'],
126
-			'avatarChangeSupported' => $user->canChangeAvatar(),
127
-			'lookupServerUploadEnabled' => $lookupServerUploadEnabled,
128
-			'avatarScope' => $userData[AccountManager::PROPERTY_AVATAR]['scope'],
129
-			'displayNameChangeSupported' => $user->canChangeDisplayName(),
130
-			'displayName' => $userData[AccountManager::PROPERTY_DISPLAYNAME]['value'],
131
-			'displayNameScope' => $userData[AccountManager::PROPERTY_DISPLAYNAME]['scope'],
132
-			'email' => $userData[AccountManager::PROPERTY_EMAIL]['value'],
133
-			'emailScope' => $userData[AccountManager::PROPERTY_EMAIL]['scope'],
134
-			'emailVerification' => $userData[AccountManager::PROPERTY_EMAIL]['verified'],
135
-			'phone' => $userData[AccountManager::PROPERTY_PHONE]['value'],
136
-			'phoneScope' => $userData[AccountManager::PROPERTY_PHONE]['scope'],
137
-			'address' => $userData[AccountManager::PROPERTY_ADDRESS]['value'],
138
-			'addressScope' => $userData[AccountManager::PROPERTY_ADDRESS]['scope'],
139
-			'website' =>  $userData[AccountManager::PROPERTY_WEBSITE]['value'],
140
-			'websiteScope' =>  $userData[AccountManager::PROPERTY_WEBSITE]['scope'],
141
-			'websiteVerification' => $userData[AccountManager::PROPERTY_WEBSITE]['verified'],
142
-			'twitter' => $userData[AccountManager::PROPERTY_TWITTER]['value'],
143
-			'twitterScope' => $userData[AccountManager::PROPERTY_TWITTER]['scope'],
144
-			'twitterVerification' => $userData[AccountManager::PROPERTY_TWITTER]['verified'],
145
-			'groups' => $this->getGroups($user),
146
-		] + $this->getWhereIsYourDataParams() + $messageParameters + $languageParameters + $localeParameters;
147
-
148
-		return new TemplateResponse('settings', 'settings/personal/personal.info', $parameters, '');
149
-	}
150
-
151
-	/**
152
-	 * Returns the "where is your data" template params.
153
-	 *
154
-	 * @return array
155
-	 */
156
-	private function getWhereIsYourDataParams(): array {
157
-
158
-		$adminContactConfigId = $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER_ADMIN_CONTACT);
159
-		$adminContact = $this->userManager->get($adminContactConfigId);
160
-
161
-		$params = [
162
-			'dataLocation' => $this->config->getSystemValue(ServerInfo::SETTING_LOCATION),
163
-			'provider' => $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER),
164
-			'providerLink' => $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER_WEBSITE),
165
-			'providerPrivacyLink' => $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER_PRIVACY_LINK),
166
-			'encryptionEnabled' => $this->encryptionManager->isEnabled(),
167
-			'adminName' => $adminContact !== null ? $adminContact->getDisplayName() : '',
168
-			'adminMail' => $adminContact !== null ? $adminContact->getEMailAddress() : ''
169
-		];
170
-
171
-		$params['show_where_is_your_data_section'] = empty($params['dataLocation']) === false
172
-			|| empty($params['provider']) === false
173
-			|| $params['encryptionEnabled'] === true
174
-			|| empty($params['adminName']) === false;
175
-
176
-		return $params;
177
-
178
-	}
179
-
180
-	/**
181
-	 * @return string the section ID, e.g. 'sharing'
182
-	 * @since 9.1
183
-	 */
184
-	public function getSection() {
185
-		return 'personal-info';
186
-	}
187
-
188
-	/**
189
-	 * @return int whether the form should be rather on the top or bottom of
190
-	 * the admin section. The forms are arranged in ascending order of the
191
-	 * priority values. It is required to return a value between 0 and 100.
192
-	 *
193
-	 * E.g.: 70
194
-	 * @since 9.1
195
-	 */
196
-	public function getPriority() {
197
-		return 10;
198
-	}
199
-
200
-	/**
201
-	 * returns a sorted list of the user's group GIDs
202
-	 *
203
-	 * @param IUser $user
204
-	 * @return array
205
-	 */
206
-	private function getGroups(IUser $user) {
207
-		$groups = array_map(
208
-			function(IGroup $group) {
209
-				return $group->getDisplayName();
210
-			},
211
-			$this->groupManager->getUserGroups($user)
212
-		);
213
-		sort($groups);
214
-
215
-		return $groups;
216
-	}
217
-
218
-	/**
219
-	 * returns the user language, common language and other languages in an
220
-	 * associative array
221
-	 *
222
-	 * @param IUser $user
223
-	 * @return array
224
-	 */
225
-	private function getLanguages(IUser $user) {
226
-		$forceLanguage = $this->config->getSystemValue('force_language', false);
227
-		if($forceLanguage !== false) {
228
-			return [];
229
-		}
230
-
231
-		$uid = $user->getUID();
232
-
233
-		$userConfLang = $this->config->getUserValue($uid, 'core', 'lang', $this->l10nFactory->findLanguage());
234
-		$languages = $this->l10nFactory->getLanguages();
235
-
236
-		// associate the user language with the proper array
237
-		$userLangIndex = array_search($userConfLang, array_column($languages['commonlanguages'], 'code'));
238
-		$userLang = $languages['commonlanguages'][$userLangIndex];
239
-		// search in the other languages
240
-		if ($userLangIndex === false) {
241
-			$userLangIndex = array_search($userConfLang, array_column($languages['languages'], 'code'));
242
-			$userLang = $languages['languages'][$userLangIndex];
243
-		}
244
-		// if user language is not available but set somehow: show the actual code as name
245
-		if (!is_array($userLang)) {
246
-			$userLang = [
247
-				'code' => $userConfLang,
248
-				'name' => $userConfLang,
249
-			];
250
-		}
251
-
252
-		return array_merge(
253
-			array('activelanguage' => $userLang),
254
-			$languages
255
-		);
256
-	}
257
-
258
-	private function getLocales(IUser $user) {
259
-		$forceLanguage = $this->config->getSystemValue('force_locale', false);
260
-		if($forceLanguage !== false) {
261
-			return [];
262
-		}
263
-
264
-		$uid = $user->getUID();
265
-
266
-		$userLocaleString = $this->config->getUserValue($uid, 'core', 'locale', $this->l10nFactory->findLocale());
267
-
268
-		$userLang = $this->config->getUserValue($uid, 'core', 'lang', $this->l10nFactory->findLanguage());
269
-
270
-		$localeCodes = $this->l10nFactory->findAvailableLocales();
271
-
272
-		$userLocale = array_filter($localeCodes, function($value) use ($userLocaleString) {
273
-			return $userLocaleString === $value['code'];
274
-		});
275
-
276
-		if (!empty($userLocale))
277
-		{
278
-			$userLocale = reset($userLocale);
279
-		}
280
-
281
-		$localesForLanguage = array_filter($localeCodes, function($localeCode) use ($userLang) {
282
-			return 0 === strpos($localeCode['code'], $userLang);
283
-		});
284
-
285
-		return [
286
-			'activelocaleLang' => $userLocaleString,
287
-			'activelocale' => $userLocale,
288
-			'locales' => $localeCodes,
289
-			'localesForLanguage' => $localesForLanguage,
290
-		];
291
-	}
292
-
293
-	/**
294
-	 * @param array $userData
295
-	 * @return array
296
-	 */
297
-	private function getMessageParameters(array $userData) {
298
-		$needVerifyMessage = [AccountManager::PROPERTY_EMAIL, AccountManager::PROPERTY_WEBSITE, AccountManager::PROPERTY_TWITTER];
299
-		$messageParameters = [];
300
-		foreach ($needVerifyMessage as $property) {
301
-			switch ($userData[$property]['verified']) {
302
-				case AccountManager::VERIFIED:
303
-					$message = $this->l->t('Verifying');
304
-					break;
305
-				case AccountManager::VERIFICATION_IN_PROGRESS:
306
-					$message = $this->l->t('Verifying …');
307
-					break;
308
-				default:
309
-					$message = $this->l->t('Verify');
310
-			}
311
-			$messageParameters[$property . 'Message'] = $message;
312
-		}
313
-		return $messageParameters;
314
-	}
46
+    /** @var IConfig */
47
+    private $config;
48
+    /** @var IUserManager */
49
+    private $userManager;
50
+    /** @var AccountManager */
51
+    private $accountManager;
52
+    /** @var IGroupManager */
53
+    private $groupManager;
54
+    /** @var IAppManager */
55
+    private $appManager;
56
+    /** @var IFactory */
57
+    private $l10nFactory;
58
+    /** @var IL10N */
59
+    private $l;
60
+    /** @var EncryptionManager */
61
+    private $encryptionManager;
62
+
63
+    /**
64
+     * @param IConfig $config
65
+     * @param IUserManager $userManager
66
+     * @param IGroupManager $groupManager
67
+     * @param AccountManager $accountManager
68
+     * @param IAppManager $appManager
69
+     * @param IFactory $l10nFactory
70
+     * @param IL10N $l
71
+     * @param EncryptionManager $encryptionManager
72
+     */
73
+    public function __construct(
74
+        IConfig $config,
75
+        IUserManager $userManager,
76
+        IGroupManager $groupManager,
77
+        AccountManager $accountManager,
78
+        IAppManager $appManager,
79
+        IFactory $l10nFactory,
80
+        IL10N $l,
81
+        EncryptionManager $encryptionManager
82
+    ) {
83
+        $this->config = $config;
84
+        $this->userManager = $userManager;
85
+        $this->accountManager = $accountManager;
86
+        $this->groupManager = $groupManager;
87
+        $this->appManager = $appManager;
88
+        $this->l10nFactory = $l10nFactory;
89
+        $this->l = $l;
90
+        $this->encryptionManager = $encryptionManager;
91
+    }
92
+
93
+    /**
94
+     * @return TemplateResponse returns the instance with all parameters set, ready to be rendered
95
+     * @since 9.1
96
+     */
97
+    public function getForm() {
98
+        $federatedFileSharingEnabled = $this->appManager->isEnabledForUser('federatedfilesharing');
99
+        $lookupServerUploadEnabled = false;
100
+        if($federatedFileSharingEnabled) {
101
+            $federatedFileSharing = new Application();
102
+            $shareProvider = $federatedFileSharing->getFederatedShareProvider();
103
+            $lookupServerUploadEnabled = $shareProvider->isLookupServerUploadEnabled();
104
+        }
105
+
106
+        $uid = \OC_User::getUser();
107
+        $user = $this->userManager->get($uid);
108
+        $userData = $this->accountManager->getUser($user);
109
+
110
+        $storageInfo = \OC_Helper::getStorageInfo('/');
111
+        if ($storageInfo['quota'] === FileInfo::SPACE_UNLIMITED) {
112
+            $totalSpace = $this->l->t('Unlimited');
113
+        } else {
114
+            $totalSpace = \OC_Helper::humanFileSize($storageInfo['total']);
115
+        }
116
+
117
+        $languageParameters = $this->getLanguages($user);
118
+        $localeParameters = $this->getLocales($user);
119
+        $messageParameters = $this->getMessageParameters($userData);
120
+
121
+        $parameters = [
122
+            'total_space' => $totalSpace,
123
+            'usage' => \OC_Helper::humanFileSize($storageInfo['used']),
124
+            'usage_relative' => round($storageInfo['relative']),
125
+            'quota' => $storageInfo['quota'],
126
+            'avatarChangeSupported' => $user->canChangeAvatar(),
127
+            'lookupServerUploadEnabled' => $lookupServerUploadEnabled,
128
+            'avatarScope' => $userData[AccountManager::PROPERTY_AVATAR]['scope'],
129
+            'displayNameChangeSupported' => $user->canChangeDisplayName(),
130
+            'displayName' => $userData[AccountManager::PROPERTY_DISPLAYNAME]['value'],
131
+            'displayNameScope' => $userData[AccountManager::PROPERTY_DISPLAYNAME]['scope'],
132
+            'email' => $userData[AccountManager::PROPERTY_EMAIL]['value'],
133
+            'emailScope' => $userData[AccountManager::PROPERTY_EMAIL]['scope'],
134
+            'emailVerification' => $userData[AccountManager::PROPERTY_EMAIL]['verified'],
135
+            'phone' => $userData[AccountManager::PROPERTY_PHONE]['value'],
136
+            'phoneScope' => $userData[AccountManager::PROPERTY_PHONE]['scope'],
137
+            'address' => $userData[AccountManager::PROPERTY_ADDRESS]['value'],
138
+            'addressScope' => $userData[AccountManager::PROPERTY_ADDRESS]['scope'],
139
+            'website' =>  $userData[AccountManager::PROPERTY_WEBSITE]['value'],
140
+            'websiteScope' =>  $userData[AccountManager::PROPERTY_WEBSITE]['scope'],
141
+            'websiteVerification' => $userData[AccountManager::PROPERTY_WEBSITE]['verified'],
142
+            'twitter' => $userData[AccountManager::PROPERTY_TWITTER]['value'],
143
+            'twitterScope' => $userData[AccountManager::PROPERTY_TWITTER]['scope'],
144
+            'twitterVerification' => $userData[AccountManager::PROPERTY_TWITTER]['verified'],
145
+            'groups' => $this->getGroups($user),
146
+        ] + $this->getWhereIsYourDataParams() + $messageParameters + $languageParameters + $localeParameters;
147
+
148
+        return new TemplateResponse('settings', 'settings/personal/personal.info', $parameters, '');
149
+    }
150
+
151
+    /**
152
+     * Returns the "where is your data" template params.
153
+     *
154
+     * @return array
155
+     */
156
+    private function getWhereIsYourDataParams(): array {
157
+
158
+        $adminContactConfigId = $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER_ADMIN_CONTACT);
159
+        $adminContact = $this->userManager->get($adminContactConfigId);
160
+
161
+        $params = [
162
+            'dataLocation' => $this->config->getSystemValue(ServerInfo::SETTING_LOCATION),
163
+            'provider' => $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER),
164
+            'providerLink' => $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER_WEBSITE),
165
+            'providerPrivacyLink' => $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER_PRIVACY_LINK),
166
+            'encryptionEnabled' => $this->encryptionManager->isEnabled(),
167
+            'adminName' => $adminContact !== null ? $adminContact->getDisplayName() : '',
168
+            'adminMail' => $adminContact !== null ? $adminContact->getEMailAddress() : ''
169
+        ];
170
+
171
+        $params['show_where_is_your_data_section'] = empty($params['dataLocation']) === false
172
+            || empty($params['provider']) === false
173
+            || $params['encryptionEnabled'] === true
174
+            || empty($params['adminName']) === false;
175
+
176
+        return $params;
177
+
178
+    }
179
+
180
+    /**
181
+     * @return string the section ID, e.g. 'sharing'
182
+     * @since 9.1
183
+     */
184
+    public function getSection() {
185
+        return 'personal-info';
186
+    }
187
+
188
+    /**
189
+     * @return int whether the form should be rather on the top or bottom of
190
+     * the admin section. The forms are arranged in ascending order of the
191
+     * priority values. It is required to return a value between 0 and 100.
192
+     *
193
+     * E.g.: 70
194
+     * @since 9.1
195
+     */
196
+    public function getPriority() {
197
+        return 10;
198
+    }
199
+
200
+    /**
201
+     * returns a sorted list of the user's group GIDs
202
+     *
203
+     * @param IUser $user
204
+     * @return array
205
+     */
206
+    private function getGroups(IUser $user) {
207
+        $groups = array_map(
208
+            function(IGroup $group) {
209
+                return $group->getDisplayName();
210
+            },
211
+            $this->groupManager->getUserGroups($user)
212
+        );
213
+        sort($groups);
214
+
215
+        return $groups;
216
+    }
217
+
218
+    /**
219
+     * returns the user language, common language and other languages in an
220
+     * associative array
221
+     *
222
+     * @param IUser $user
223
+     * @return array
224
+     */
225
+    private function getLanguages(IUser $user) {
226
+        $forceLanguage = $this->config->getSystemValue('force_language', false);
227
+        if($forceLanguage !== false) {
228
+            return [];
229
+        }
230
+
231
+        $uid = $user->getUID();
232
+
233
+        $userConfLang = $this->config->getUserValue($uid, 'core', 'lang', $this->l10nFactory->findLanguage());
234
+        $languages = $this->l10nFactory->getLanguages();
235
+
236
+        // associate the user language with the proper array
237
+        $userLangIndex = array_search($userConfLang, array_column($languages['commonlanguages'], 'code'));
238
+        $userLang = $languages['commonlanguages'][$userLangIndex];
239
+        // search in the other languages
240
+        if ($userLangIndex === false) {
241
+            $userLangIndex = array_search($userConfLang, array_column($languages['languages'], 'code'));
242
+            $userLang = $languages['languages'][$userLangIndex];
243
+        }
244
+        // if user language is not available but set somehow: show the actual code as name
245
+        if (!is_array($userLang)) {
246
+            $userLang = [
247
+                'code' => $userConfLang,
248
+                'name' => $userConfLang,
249
+            ];
250
+        }
251
+
252
+        return array_merge(
253
+            array('activelanguage' => $userLang),
254
+            $languages
255
+        );
256
+    }
257
+
258
+    private function getLocales(IUser $user) {
259
+        $forceLanguage = $this->config->getSystemValue('force_locale', false);
260
+        if($forceLanguage !== false) {
261
+            return [];
262
+        }
263
+
264
+        $uid = $user->getUID();
265
+
266
+        $userLocaleString = $this->config->getUserValue($uid, 'core', 'locale', $this->l10nFactory->findLocale());
267
+
268
+        $userLang = $this->config->getUserValue($uid, 'core', 'lang', $this->l10nFactory->findLanguage());
269
+
270
+        $localeCodes = $this->l10nFactory->findAvailableLocales();
271
+
272
+        $userLocale = array_filter($localeCodes, function($value) use ($userLocaleString) {
273
+            return $userLocaleString === $value['code'];
274
+        });
275
+
276
+        if (!empty($userLocale))
277
+        {
278
+            $userLocale = reset($userLocale);
279
+        }
280
+
281
+        $localesForLanguage = array_filter($localeCodes, function($localeCode) use ($userLang) {
282
+            return 0 === strpos($localeCode['code'], $userLang);
283
+        });
284
+
285
+        return [
286
+            'activelocaleLang' => $userLocaleString,
287
+            'activelocale' => $userLocale,
288
+            'locales' => $localeCodes,
289
+            'localesForLanguage' => $localesForLanguage,
290
+        ];
291
+    }
292
+
293
+    /**
294
+     * @param array $userData
295
+     * @return array
296
+     */
297
+    private function getMessageParameters(array $userData) {
298
+        $needVerifyMessage = [AccountManager::PROPERTY_EMAIL, AccountManager::PROPERTY_WEBSITE, AccountManager::PROPERTY_TWITTER];
299
+        $messageParameters = [];
300
+        foreach ($needVerifyMessage as $property) {
301
+            switch ($userData[$property]['verified']) {
302
+                case AccountManager::VERIFIED:
303
+                    $message = $this->l->t('Verifying');
304
+                    break;
305
+                case AccountManager::VERIFICATION_IN_PROGRESS:
306
+                    $message = $this->l->t('Verifying …');
307
+                    break;
308
+                default:
309
+                    $message = $this->l->t('Verify');
310
+            }
311
+            $messageParameters[$property . 'Message'] = $message;
312
+        }
313
+        return $messageParameters;
314
+    }
315 315
 
316 316
 }
Please login to merge, or discard this patch.
lib/private/Settings/Theming/ServerInfo.php 1 patch
Indentation   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -33,89 +33,89 @@
 block discarded – undo
33 33
  */
34 34
 class ServerInfo implements ISettings {
35 35
 
36
-	const SETTING_LOCATION = 'serverinfo.location';
37
-	const SETTING_PROVIDER = 'serverinfo.provider';
38
-	const SETTING_PROVIDER_WEBSITE = 'serverinfo.provider.website';
39
-	const SETTING_PROVIDER_PRIVACY_LINK = 'serverinfo.provider.privacylink';
40
-	const SETTING_PROVIDER_ADMIN_CONTACT = 'serverinfo.admincontact';
36
+    const SETTING_LOCATION = 'serverinfo.location';
37
+    const SETTING_PROVIDER = 'serverinfo.provider';
38
+    const SETTING_PROVIDER_WEBSITE = 'serverinfo.provider.website';
39
+    const SETTING_PROVIDER_PRIVACY_LINK = 'serverinfo.provider.privacylink';
40
+    const SETTING_PROVIDER_ADMIN_CONTACT = 'serverinfo.admincontact';
41 41
 
42
-	/**
43
-	 * @var IConfig
44
-	 */
45
-	private $config;
42
+    /**
43
+     * @var IConfig
44
+     */
45
+    private $config;
46 46
 
47
-	/**
48
-	 * @var IGroupManager
49
-	 */
50
-	private $groupManager;
47
+    /**
48
+     * @var IGroupManager
49
+     */
50
+    private $groupManager;
51 51
 
52
-	/**
53
-	 * ServerInfo constructor.
54
-	 *
55
-	 * @param IConfig $config
56
-	 * @param IGroupManager $groupManager
57
-	 */
58
-	public function __construct(IConfig $config, IGroupManager $groupManager) {
59
-		$this->config = $config;
60
-		$this->groupManager = $groupManager;
61
-	}
52
+    /**
53
+     * ServerInfo constructor.
54
+     *
55
+     * @param IConfig $config
56
+     * @param IGroupManager $groupManager
57
+     */
58
+    public function __construct(IConfig $config, IGroupManager $groupManager) {
59
+        $this->config = $config;
60
+        $this->groupManager = $groupManager;
61
+    }
62 62
 
63
-	/**
64
-	 * @return TemplateResponse
65
-	 */
66
-	public function getForm(): TemplateResponse {
67
-		$parameters = [
68
-			'location' => $this->config->getSystemValue(self::SETTING_LOCATION),
69
-			'provider' => $this->config->getSystemValue(self::SETTING_PROVIDER),
70
-			'providerWebsite' => $this->config->getSystemValue(self::SETTING_PROVIDER_WEBSITE),
71
-			'providerPrivacyLink' => $this->config->getSystemValue(self::SETTING_PROVIDER_PRIVACY_LINK),
72
-			'adminUsers' => $this->getAdminListValues(),
73
-			'adminContact' => $this->config->getSystemValue(self::SETTING_PROVIDER_ADMIN_CONTACT),
74
-		];
75
-		return new TemplateResponse('settings', 'settings/admin/server-info', $parameters, '');
76
-	}
63
+    /**
64
+     * @return TemplateResponse
65
+     */
66
+    public function getForm(): TemplateResponse {
67
+        $parameters = [
68
+            'location' => $this->config->getSystemValue(self::SETTING_LOCATION),
69
+            'provider' => $this->config->getSystemValue(self::SETTING_PROVIDER),
70
+            'providerWebsite' => $this->config->getSystemValue(self::SETTING_PROVIDER_WEBSITE),
71
+            'providerPrivacyLink' => $this->config->getSystemValue(self::SETTING_PROVIDER_PRIVACY_LINK),
72
+            'adminUsers' => $this->getAdminListValues(),
73
+            'adminContact' => $this->config->getSystemValue(self::SETTING_PROVIDER_ADMIN_CONTACT),
74
+        ];
75
+        return new TemplateResponse('settings', 'settings/admin/server-info', $parameters, '');
76
+    }
77 77
 
78
-	/**
79
-	 * Returns the admin list values.
80
-	 *
81
-	 * @return array[] An array or arrays with the keys 'id' and 'displayName'
82
-	 */
83
-	private function getAdminListValues(): array {
84
-		$adminGroup = $this->groupManager->get('admin');
85
-		$users = $adminGroup->getUsers();
78
+    /**
79
+     * Returns the admin list values.
80
+     *
81
+     * @return array[] An array or arrays with the keys 'id' and 'displayName'
82
+     */
83
+    private function getAdminListValues(): array {
84
+        $adminGroup = $this->groupManager->get('admin');
85
+        $users = $adminGroup->getUsers();
86 86
 
87
-		$users = array_map(function(IUser $user) {
88
-			return [
89
-				'id' => $user->getUID(),
90
-				'displayName' => $user->getDisplayName()
91
-			];
92
-		}, $users);
87
+        $users = array_map(function(IUser $user) {
88
+            return [
89
+                'id' => $user->getUID(),
90
+                'displayName' => $user->getDisplayName()
91
+            ];
92
+        }, $users);
93 93
 
94
-		usort($your_data, function(array $a, array $b) {
95
-			return strcmp($a['displayName'], $b['displayName']);
96
-		});
94
+        usort($your_data, function(array $a, array $b) {
95
+            return strcmp($a['displayName'], $b['displayName']);
96
+        });
97 97
 
98
-		return $users;
99
-	}
98
+        return $users;
99
+    }
100 100
 
101
-	/**
102
-	 * Returns the server info section id.
103
-	 *
104
-	 * @return string
105
-	 */
106
-	public function getSection(): string {
107
-		return 'theming';
108
-	}
101
+    /**
102
+     * Returns the server info section id.
103
+     *
104
+     * @return string
105
+     */
106
+    public function getSection(): string {
107
+        return 'theming';
108
+    }
109 109
 
110
-	/**
111
-	 * Returns the server info settings priority.
112
-	 *
113
-	 * @return int whether the form should be rather on the top or bottom of
114
-	 * the admin section. The forms are arranged in ascending order of the
115
-	 * priority values. It is required to return a value between 0 and 100.
116
-	 */
117
-	public function getPriority(): int {
118
-		return 10;
119
-	}
110
+    /**
111
+     * Returns the server info settings priority.
112
+     *
113
+     * @return int whether the form should be rather on the top or bottom of
114
+     * the admin section. The forms are arranged in ascending order of the
115
+     * priority values. It is required to return a value between 0 and 100.
116
+     */
117
+    public function getPriority(): int {
118
+        return 10;
119
+    }
120 120
 
121 121
 }
Please login to merge, or discard this patch.
lib/private/Settings/Manager.php 1 patch
Indentation   +320 added lines, -320 removed lines patch added patch discarded remove patch
@@ -40,324 +40,324 @@
 block discarded – undo
40 40
 
41 41
 class Manager implements IManager {
42 42
 
43
-	/** @var ILogger */
44
-	private $log;
45
-
46
-	/** @var IL10N */
47
-	private $l;
48
-
49
-	/** @var IURLGenerator */
50
-	private $url;
51
-
52
-	/** @var IServerContainer */
53
-	private $container;
54
-
55
-	public function __construct(
56
-		ILogger $log,
57
-		IL10N $l10n,
58
-		IURLGenerator $url,
59
-		IServerContainer $container
60
-	) {
61
-		$this->log = $log;
62
-		$this->l = $l10n;
63
-		$this->url = $url;
64
-		$this->container = $container;
65
-	}
66
-
67
-	/** @var array */
68
-	protected $sectionClasses = [];
69
-
70
-	/** @var array */
71
-	protected $sections = [];
72
-
73
-	/**
74
-	 * @param string $type 'admin' or 'personal'
75
-	 * @param string $section Class must implement OCP\Settings\ISection
76
-	 *
77
-	 * @return void
78
-	 */
79
-	public function registerSection(string $type, string $section) {
80
-		if (!isset($this->sectionClasses[$type])) {
81
-			$this->sectionClasses[$type] = [];
82
-		}
83
-
84
-		$this->sectionClasses[$type][] = $section;
85
-	}
86
-
87
-	/**
88
-	 * @param string $type 'admin' or 'personal'
89
-	 *
90
-	 * @return ISection[]
91
-	 */
92
-	protected function getSections(string $type): array {
93
-		if (!isset($this->sections[$type])) {
94
-			$this->sections[$type] = [];
95
-		}
96
-
97
-		if (!isset($this->sectionClasses[$type])) {
98
-			return $this->sections[$type];
99
-		}
100
-
101
-		foreach ($this->sectionClasses[$type] as $index => $class) {
102
-			try {
103
-				/** @var ISection $section */
104
-				$section = \OC::$server->query($class);
105
-			} catch (QueryException $e) {
106
-				$this->log->logException($e, ['level' => ILogger::INFO]);
107
-				continue;
108
-			}
109
-
110
-			if (!$section instanceof ISection) {
111
-				$this->log->logException(new \InvalidArgumentException('Invalid settings section registered'), ['level' => ILogger::INFO]);
112
-				continue;
113
-			}
114
-
115
-			$sectionID = $section->getID();
116
-
117
-			if (isset($this->sections[$type][$sectionID])) {
118
-				$this->log->logException(new \InvalidArgumentException('Section with the same ID already registered'), ['level' => ILogger::INFO]);
119
-				continue;
120
-			}
121
-
122
-			$this->sections[$type][$sectionID] = $section;
123
-
124
-			unset($this->sectionClasses[$type][$index]);
125
-		}
126
-
127
-		return $this->sections[$type];
128
-	}
129
-
130
-	/** @var array */
131
-	protected $settingClasses = [];
132
-
133
-	/** @var array */
134
-	protected $settings = [];
135
-
136
-	/**
137
-	 * @param string $type 'admin' or 'personal'
138
-	 * @param string $setting Class must implement OCP\Settings\ISetting
139
-	 *
140
-	 * @return void
141
-	 */
142
-	public function registerSetting(string $type, string $setting) {
143
-		$this->settingClasses[$setting] = $type;
144
-	}
145
-
146
-	/**
147
-	 * @param string $type 'admin' or 'personal'
148
-	 * @param string $section
149
-	 *
150
-	 * @return ISettings[]
151
-	 */
152
-	protected function getSettings(string $type, string $section): array {
153
-		if (!isset($this->settings[$type])) {
154
-			$this->settings[$type] = [];
155
-		}
156
-		if (!isset($this->settings[$type][$section])) {
157
-			$this->settings[$type][$section] = [];
158
-		}
159
-
160
-		foreach ($this->settingClasses as $class => $settingsType) {
161
-			try {
162
-				/** @var ISettings $setting */
163
-				$setting = \OC::$server->query($class);
164
-			} catch (QueryException $e) {
165
-				$this->log->logException($e, ['level' => ILogger::INFO]);
166
-				continue;
167
-			}
168
-
169
-			if (!$setting instanceof ISettings) {
170
-				$this->log->logException(new \InvalidArgumentException('Invalid settings setting registered (' . $class . ')'), ['level' => ILogger::INFO]);
171
-				continue;
172
-			}
173
-
174
-			if (!isset($this->settings[$settingsType][$setting->getSection()])) {
175
-				$this->settings[$settingsType][$setting->getSection()] = [];
176
-			}
177
-			$this->settings[$settingsType][$setting->getSection()][] = $setting;
178
-
179
-			unset($this->settingClasses[$class]);
180
-		}
181
-
182
-		return $this->settings[$type][$section];
183
-	}
184
-
185
-	/**
186
-	 * @inheritdoc
187
-	 */
188
-	public function getAdminSections(): array {
189
-		// built-in sections
190
-		$sections = [
191
-			0 => [new Section('overview', $this->l->t('Overview'), 0, $this->url->imagePath('settings', 'admin.svg'))],
192
-			1 => [new Section('server', $this->l->t('Basic settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))],
193
-			5 => [new Section('sharing', $this->l->t('Sharing'), 0, $this->url->imagePath('core', 'actions/share.svg'))],
194
-			10 => [new Section('security', $this->l->t('Security'), 0, $this->url->imagePath('core', 'actions/password.svg'))],
195
-			30 => [new Section('theming', $this->l->t('Theming'), 0, $this->url->imagePath('settings', 'theming-dark.svg'))],
196
-			50 => [new Section('groupware', $this->l->t('Groupware'), 0, $this->url->imagePath('core', 'places/contacts.svg'))],
197
-			98 => [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))],
198
-		];
199
-
200
-		$appSections = $this->getSections('admin');
201
-
202
-		foreach ($appSections as $section) {
203
-			/** @var ISection $section */
204
-			if (!isset($sections[$section->getPriority()])) {
205
-				$sections[$section->getPriority()] = [];
206
-			}
207
-
208
-			$sections[$section->getPriority()][] = $section;
209
-		}
210
-
211
-		ksort($sections);
212
-
213
-		return $sections;
214
-	}
215
-
216
-	/**
217
-	 * @param string $section
218
-	 *
219
-	 * @return ISection[]
220
-	 */
221
-	private function getBuiltInAdminSettings($section): array {
222
-		$forms = [];
223
-
224
-		if ($section === 'overview') {
225
-			/** @var ISettings $form */
226
-			$form = $this->container->query(Admin\Overview::class);
227
-			$forms[$form->getPriority()] = [$form];
228
-		}
229
-		if ($section === 'server') {
230
-			/** @var ISettings $form */
231
-			$form = $this->container->query(Admin\Server::class);
232
-			$forms[$form->getPriority()] = [$form];
233
-			$form = $this->container->query(Admin\Mail::class);
234
-			$forms[$form->getPriority()] = [$form];
235
-		}
236
-		if ($section === 'security') {
237
-			/** @var ISettings $form */
238
-			$form = $this->container->query(Admin\Security::class);
239
-			$forms[$form->getPriority()] = [$form];
240
-		}
241
-		if ($section === 'theming') {
242
-			$form = $this->container->query(Theming\ServerInfo::class);
243
-			$forms[$form->getPriority()] = [$form];
244
-		}
245
-		if ($section === 'sharing') {
246
-			/** @var ISettings $form */
247
-			$form = $this->container->query(Admin\Sharing::class);
248
-			$forms[$form->getPriority()] = [$form];
249
-		}
250
-
251
-		return $forms;
252
-	}
253
-
254
-	/**
255
-	 * @param string $section
256
-	 *
257
-	 * @return ISection[]
258
-	 */
259
-	private function getBuiltInPersonalSettings($section): array {
260
-		$forms = [];
261
-
262
-		if ($section === 'personal-info') {
263
-			/** @var ISettings $form */
264
-			$form = $this->container->query(Personal\PersonalInfo::class);
265
-			$forms[$form->getPriority()] = [$form];
266
-			$form = new Personal\ServerDevNotice();
267
-			$forms[$form->getPriority()] = [$form];
268
-		}
269
-		if ($section === 'security') {
270
-			/** @var ISettings $form */
271
-			$form = $this->container->query(Personal\Security::class);
272
-			$forms[$form->getPriority()] = [$form];
273
-		}
274
-		if ($section === 'additional') {
275
-			/** @var ISettings $form */
276
-			$form = $this->container->query(Personal\Additional::class);
277
-			$forms[$form->getPriority()] = [$form];
278
-		}
279
-
280
-		return $forms;
281
-	}
282
-
283
-	/**
284
-	 * @inheritdoc
285
-	 */
286
-	public function getAdminSettings($section): array {
287
-		$settings = $this->getBuiltInAdminSettings($section);
288
-		$appSettings = $this->getSettings('admin', $section);
289
-
290
-		foreach ($appSettings as $setting) {
291
-			if (!isset($settings[$setting->getPriority()])) {
292
-				$settings[$setting->getPriority()] = [];
293
-			}
294
-			$settings[$setting->getPriority()][] = $setting;
295
-		}
296
-
297
-		ksort($settings);
298
-		return $settings;
299
-	}
300
-
301
-	/**
302
-	 * @inheritdoc
303
-	 */
304
-	public function getPersonalSections(): array {
305
-		$sections = [
306
-			0 => [new Section('personal-info', $this->l->t('Personal info'), 0, $this->url->imagePath('core', 'actions/info.svg'))],
307
-			5 => [new Section('security', $this->l->t('Security'), 0, $this->url->imagePath('settings', 'password.svg'))],
308
-			15 => [new Section('sync-clients', $this->l->t('Mobile & desktop'), 0, $this->url->imagePath('core', 'clients/phone.svg'))],
309
-		];
310
-
311
-		$legacyForms = \OC_App::getForms('personal');
312
-		if (!empty($legacyForms) && $this->hasLegacyPersonalSettingsToRender($legacyForms)) {
313
-			$sections[98] = [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))];
314
-		}
315
-
316
-		$appSections = $this->getSections('personal');
317
-
318
-		foreach ($appSections as $section) {
319
-			/** @var ISection $section */
320
-			if (!isset($sections[$section->getPriority()])) {
321
-				$sections[$section->getPriority()] = [];
322
-			}
323
-
324
-			$sections[$section->getPriority()][] = $section;
325
-		}
326
-
327
-		ksort($sections);
328
-
329
-		return $sections;
330
-	}
331
-
332
-	/**
333
-	 * @param string[] $forms
334
-	 *
335
-	 * @return bool
336
-	 */
337
-	private function hasLegacyPersonalSettingsToRender(array $forms): bool {
338
-		foreach ($forms as $form) {
339
-			if (trim($form) !== '') {
340
-				return true;
341
-			}
342
-		}
343
-		return false;
344
-	}
345
-
346
-	/**
347
-	 * @inheritdoc
348
-	 */
349
-	public function getPersonalSettings($section): array {
350
-		$settings = $this->getBuiltInPersonalSettings($section);
351
-		$appSettings = $this->getSettings('personal', $section);
352
-
353
-		foreach ($appSettings as $setting) {
354
-			if (!isset($settings[$setting->getPriority()])) {
355
-				$settings[$setting->getPriority()] = [];
356
-			}
357
-			$settings[$setting->getPriority()][] = $setting;
358
-		}
359
-
360
-		ksort($settings);
361
-		return $settings;
362
-	}
43
+    /** @var ILogger */
44
+    private $log;
45
+
46
+    /** @var IL10N */
47
+    private $l;
48
+
49
+    /** @var IURLGenerator */
50
+    private $url;
51
+
52
+    /** @var IServerContainer */
53
+    private $container;
54
+
55
+    public function __construct(
56
+        ILogger $log,
57
+        IL10N $l10n,
58
+        IURLGenerator $url,
59
+        IServerContainer $container
60
+    ) {
61
+        $this->log = $log;
62
+        $this->l = $l10n;
63
+        $this->url = $url;
64
+        $this->container = $container;
65
+    }
66
+
67
+    /** @var array */
68
+    protected $sectionClasses = [];
69
+
70
+    /** @var array */
71
+    protected $sections = [];
72
+
73
+    /**
74
+     * @param string $type 'admin' or 'personal'
75
+     * @param string $section Class must implement OCP\Settings\ISection
76
+     *
77
+     * @return void
78
+     */
79
+    public function registerSection(string $type, string $section) {
80
+        if (!isset($this->sectionClasses[$type])) {
81
+            $this->sectionClasses[$type] = [];
82
+        }
83
+
84
+        $this->sectionClasses[$type][] = $section;
85
+    }
86
+
87
+    /**
88
+     * @param string $type 'admin' or 'personal'
89
+     *
90
+     * @return ISection[]
91
+     */
92
+    protected function getSections(string $type): array {
93
+        if (!isset($this->sections[$type])) {
94
+            $this->sections[$type] = [];
95
+        }
96
+
97
+        if (!isset($this->sectionClasses[$type])) {
98
+            return $this->sections[$type];
99
+        }
100
+
101
+        foreach ($this->sectionClasses[$type] as $index => $class) {
102
+            try {
103
+                /** @var ISection $section */
104
+                $section = \OC::$server->query($class);
105
+            } catch (QueryException $e) {
106
+                $this->log->logException($e, ['level' => ILogger::INFO]);
107
+                continue;
108
+            }
109
+
110
+            if (!$section instanceof ISection) {
111
+                $this->log->logException(new \InvalidArgumentException('Invalid settings section registered'), ['level' => ILogger::INFO]);
112
+                continue;
113
+            }
114
+
115
+            $sectionID = $section->getID();
116
+
117
+            if (isset($this->sections[$type][$sectionID])) {
118
+                $this->log->logException(new \InvalidArgumentException('Section with the same ID already registered'), ['level' => ILogger::INFO]);
119
+                continue;
120
+            }
121
+
122
+            $this->sections[$type][$sectionID] = $section;
123
+
124
+            unset($this->sectionClasses[$type][$index]);
125
+        }
126
+
127
+        return $this->sections[$type];
128
+    }
129
+
130
+    /** @var array */
131
+    protected $settingClasses = [];
132
+
133
+    /** @var array */
134
+    protected $settings = [];
135
+
136
+    /**
137
+     * @param string $type 'admin' or 'personal'
138
+     * @param string $setting Class must implement OCP\Settings\ISetting
139
+     *
140
+     * @return void
141
+     */
142
+    public function registerSetting(string $type, string $setting) {
143
+        $this->settingClasses[$setting] = $type;
144
+    }
145
+
146
+    /**
147
+     * @param string $type 'admin' or 'personal'
148
+     * @param string $section
149
+     *
150
+     * @return ISettings[]
151
+     */
152
+    protected function getSettings(string $type, string $section): array {
153
+        if (!isset($this->settings[$type])) {
154
+            $this->settings[$type] = [];
155
+        }
156
+        if (!isset($this->settings[$type][$section])) {
157
+            $this->settings[$type][$section] = [];
158
+        }
159
+
160
+        foreach ($this->settingClasses as $class => $settingsType) {
161
+            try {
162
+                /** @var ISettings $setting */
163
+                $setting = \OC::$server->query($class);
164
+            } catch (QueryException $e) {
165
+                $this->log->logException($e, ['level' => ILogger::INFO]);
166
+                continue;
167
+            }
168
+
169
+            if (!$setting instanceof ISettings) {
170
+                $this->log->logException(new \InvalidArgumentException('Invalid settings setting registered (' . $class . ')'), ['level' => ILogger::INFO]);
171
+                continue;
172
+            }
173
+
174
+            if (!isset($this->settings[$settingsType][$setting->getSection()])) {
175
+                $this->settings[$settingsType][$setting->getSection()] = [];
176
+            }
177
+            $this->settings[$settingsType][$setting->getSection()][] = $setting;
178
+
179
+            unset($this->settingClasses[$class]);
180
+        }
181
+
182
+        return $this->settings[$type][$section];
183
+    }
184
+
185
+    /**
186
+     * @inheritdoc
187
+     */
188
+    public function getAdminSections(): array {
189
+        // built-in sections
190
+        $sections = [
191
+            0 => [new Section('overview', $this->l->t('Overview'), 0, $this->url->imagePath('settings', 'admin.svg'))],
192
+            1 => [new Section('server', $this->l->t('Basic settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))],
193
+            5 => [new Section('sharing', $this->l->t('Sharing'), 0, $this->url->imagePath('core', 'actions/share.svg'))],
194
+            10 => [new Section('security', $this->l->t('Security'), 0, $this->url->imagePath('core', 'actions/password.svg'))],
195
+            30 => [new Section('theming', $this->l->t('Theming'), 0, $this->url->imagePath('settings', 'theming-dark.svg'))],
196
+            50 => [new Section('groupware', $this->l->t('Groupware'), 0, $this->url->imagePath('core', 'places/contacts.svg'))],
197
+            98 => [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))],
198
+        ];
199
+
200
+        $appSections = $this->getSections('admin');
201
+
202
+        foreach ($appSections as $section) {
203
+            /** @var ISection $section */
204
+            if (!isset($sections[$section->getPriority()])) {
205
+                $sections[$section->getPriority()] = [];
206
+            }
207
+
208
+            $sections[$section->getPriority()][] = $section;
209
+        }
210
+
211
+        ksort($sections);
212
+
213
+        return $sections;
214
+    }
215
+
216
+    /**
217
+     * @param string $section
218
+     *
219
+     * @return ISection[]
220
+     */
221
+    private function getBuiltInAdminSettings($section): array {
222
+        $forms = [];
223
+
224
+        if ($section === 'overview') {
225
+            /** @var ISettings $form */
226
+            $form = $this->container->query(Admin\Overview::class);
227
+            $forms[$form->getPriority()] = [$form];
228
+        }
229
+        if ($section === 'server') {
230
+            /** @var ISettings $form */
231
+            $form = $this->container->query(Admin\Server::class);
232
+            $forms[$form->getPriority()] = [$form];
233
+            $form = $this->container->query(Admin\Mail::class);
234
+            $forms[$form->getPriority()] = [$form];
235
+        }
236
+        if ($section === 'security') {
237
+            /** @var ISettings $form */
238
+            $form = $this->container->query(Admin\Security::class);
239
+            $forms[$form->getPriority()] = [$form];
240
+        }
241
+        if ($section === 'theming') {
242
+            $form = $this->container->query(Theming\ServerInfo::class);
243
+            $forms[$form->getPriority()] = [$form];
244
+        }
245
+        if ($section === 'sharing') {
246
+            /** @var ISettings $form */
247
+            $form = $this->container->query(Admin\Sharing::class);
248
+            $forms[$form->getPriority()] = [$form];
249
+        }
250
+
251
+        return $forms;
252
+    }
253
+
254
+    /**
255
+     * @param string $section
256
+     *
257
+     * @return ISection[]
258
+     */
259
+    private function getBuiltInPersonalSettings($section): array {
260
+        $forms = [];
261
+
262
+        if ($section === 'personal-info') {
263
+            /** @var ISettings $form */
264
+            $form = $this->container->query(Personal\PersonalInfo::class);
265
+            $forms[$form->getPriority()] = [$form];
266
+            $form = new Personal\ServerDevNotice();
267
+            $forms[$form->getPriority()] = [$form];
268
+        }
269
+        if ($section === 'security') {
270
+            /** @var ISettings $form */
271
+            $form = $this->container->query(Personal\Security::class);
272
+            $forms[$form->getPriority()] = [$form];
273
+        }
274
+        if ($section === 'additional') {
275
+            /** @var ISettings $form */
276
+            $form = $this->container->query(Personal\Additional::class);
277
+            $forms[$form->getPriority()] = [$form];
278
+        }
279
+
280
+        return $forms;
281
+    }
282
+
283
+    /**
284
+     * @inheritdoc
285
+     */
286
+    public function getAdminSettings($section): array {
287
+        $settings = $this->getBuiltInAdminSettings($section);
288
+        $appSettings = $this->getSettings('admin', $section);
289
+
290
+        foreach ($appSettings as $setting) {
291
+            if (!isset($settings[$setting->getPriority()])) {
292
+                $settings[$setting->getPriority()] = [];
293
+            }
294
+            $settings[$setting->getPriority()][] = $setting;
295
+        }
296
+
297
+        ksort($settings);
298
+        return $settings;
299
+    }
300
+
301
+    /**
302
+     * @inheritdoc
303
+     */
304
+    public function getPersonalSections(): array {
305
+        $sections = [
306
+            0 => [new Section('personal-info', $this->l->t('Personal info'), 0, $this->url->imagePath('core', 'actions/info.svg'))],
307
+            5 => [new Section('security', $this->l->t('Security'), 0, $this->url->imagePath('settings', 'password.svg'))],
308
+            15 => [new Section('sync-clients', $this->l->t('Mobile & desktop'), 0, $this->url->imagePath('core', 'clients/phone.svg'))],
309
+        ];
310
+
311
+        $legacyForms = \OC_App::getForms('personal');
312
+        if (!empty($legacyForms) && $this->hasLegacyPersonalSettingsToRender($legacyForms)) {
313
+            $sections[98] = [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))];
314
+        }
315
+
316
+        $appSections = $this->getSections('personal');
317
+
318
+        foreach ($appSections as $section) {
319
+            /** @var ISection $section */
320
+            if (!isset($sections[$section->getPriority()])) {
321
+                $sections[$section->getPriority()] = [];
322
+            }
323
+
324
+            $sections[$section->getPriority()][] = $section;
325
+        }
326
+
327
+        ksort($sections);
328
+
329
+        return $sections;
330
+    }
331
+
332
+    /**
333
+     * @param string[] $forms
334
+     *
335
+     * @return bool
336
+     */
337
+    private function hasLegacyPersonalSettingsToRender(array $forms): bool {
338
+        foreach ($forms as $form) {
339
+            if (trim($form) !== '') {
340
+                return true;
341
+            }
342
+        }
343
+        return false;
344
+    }
345
+
346
+    /**
347
+     * @inheritdoc
348
+     */
349
+    public function getPersonalSettings($section): array {
350
+        $settings = $this->getBuiltInPersonalSettings($section);
351
+        $appSettings = $this->getSettings('personal', $section);
352
+
353
+        foreach ($appSettings as $setting) {
354
+            if (!isset($settings[$setting->getPriority()])) {
355
+                $settings[$setting->getPriority()] = [];
356
+            }
357
+            $settings[$setting->getPriority()][] = $setting;
358
+        }
359
+
360
+        ksort($settings);
361
+        return $settings;
362
+    }
363 363
 }
Please login to merge, or discard this patch.