Completed
Pull Request — master (#4890)
by Blizzz
13:28
created
lib/private/Settings/Personal/PersonalInfo.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -127,16 +127,16 @@  discard block
 block discarded – undo
127 127
 
128 128
 		$userLang = $this->config->getUserValue($uid, 'core', 'lang', $this->l10nFactory->findLanguage());
129 129
 		$languageCodes = $this->l10nFactory->findAvailableLanguages();
130
-		foreach($languageCodes as $lang) {
130
+		foreach ($languageCodes as $lang) {
131 131
 			$l = \OC::$server->getL10N('settings', $lang);
132 132
 			// TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version
133 133
 			$potentialName = (string) $l->t('__language_name__');
134
-			if($l->getLanguageCode() === $lang && substr($potentialName, 0, 1) !== '_') {//first check if the language name is in the translation file
134
+			if ($l->getLanguageCode() === $lang && substr($potentialName, 0, 1) !== '_') {//first check if the language name is in the translation file
135 135
 				$ln = array('code' => $lang, 'name' => $potentialName);
136 136
 			} elseif ($lang === 'en') {
137 137
 				$ln = ['code' => $lang, 'name' => 'English (US)'];
138
-			}else{//fallback to language code
139
-				$ln=array('code'=>$lang, 'name'=>$lang);
138
+			} else {//fallback to language code
139
+				$ln = array('code'=>$lang, 'name'=>$lang);
140 140
 			}
141 141
 
142 142
 			// put appropriate languages into appropriate arrays, to print them sorted
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
 			if ($lang === $userLang) {
145 145
 				$userLang = $ln;
146 146
 			} elseif (in_array($lang, $commonLangCodes)) {
147
-				$commonLanguages[array_search($lang, $commonLangCodes)]=$ln;
147
+				$commonLanguages[array_search($lang, $commonLangCodes)] = $ln;
148 148
 			} else {
149
-				$languages[]=$ln;
149
+				$languages[] = $ln;
150 150
 			}
151 151
 		}
152 152
 
Please login to merge, or discard this patch.
settings/Controller/CommonSettingsTrait.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 use OCP\Settings\IIconSection;
29 29
 use OCP\Settings\ISettings;
30 30
 
31
-trait CommonSettingsTrait  {
31
+trait CommonSettingsTrait {
32 32
 	/** @var ISettingsManager */
33 33
 	private $settingsManager;
34 34
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 			'admin' => []
43 43
 		];
44 44
 
45
-		if(\OC_User::isAdminUser(\OC_User::getUser())) {
45
+		if (\OC_User::isAdminUser(\OC_User::getUser())) {
46 46
 			$templateParameters['admin'] = $this->formatAdminSections($currentSection);
47 47
 		}
48 48
 
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 	protected function formatSections($sections, $currentSection, $type) {
55 55
 		$templateParameters = [];
56 56
 		/** @var \OCP\Settings\ISection[] $prioritizedSections */
57
-		foreach($sections as $prioritizedSections) {
57
+		foreach ($sections as $prioritizedSections) {
58 58
 			foreach ($prioritizedSections as $section) {
59
-				if($type === 'admin') {
59
+				if ($type === 'admin') {
60 60
 					$settings = $this->settingsManager->getAdminSettings($section->getID());
61
-				} else if($type === 'personal') {
61
+				} else if ($type === 'personal') {
62 62
 					$settings = $this->settingsManager->getPersonalSettings($section->getID());
63 63
 				}
64 64
 				if (empty($settings)) {
Please login to merge, or discard this patch.
settings/Controller/AdminSettingsController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		// PhpStorm shows this as unused, but is required by CommonSettingsTrait
79 79
 		$settings = $this->settingsManager->getAdminSettings($section);
80 80
 		$formatted = $this->formatSettings($settings);
81
-		if($section === 'additional') {
81
+		if ($section === 'additional') {
82 82
 			$formatted['content'] .= $this->getLegacyForms();
83 83
 		}
84 84
 		return $formatted;
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
 	private function getLegacyForms() {
91 91
 		$forms = \OC_App::getForms('admin');
92 92
 
93
-		$forms = array_map(function ($form) {
93
+		$forms = array_map(function($form) {
94 94
 			if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) {
95
-				$sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]);
95
+				$sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]);
96 96
 				$sectionName = str_replace('</h2>', '', $sectionName);
97 97
 				$anchor = strtolower($sectionName);
98 98
 				$anchor = str_replace(' ', '-', $anchor);
Please login to merge, or discard this patch.
settings/templates/settings/personal/personal.info.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 				</div>
55 55
 			</div>
56 56
 			<span class="icon-checkmark hidden"/>
57
-			<?php if($_['lookupServerUploadEnabled']) { ?>
57
+			<?php if ($_['lookupServerUploadEnabled']) { ?>
58 58
 				<input type="hidden" id="avatarscope" value="<?php p($_['avatarScope']) ?>">
59 59
 			<?php } ?>
60 60
 		</form>
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
 					<span class="icon-password"/>
69 69
 				</h2>
70 70
 				<input type="text" id="displayname" name="displayname"
71
-					<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
71
+					<?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
72 72
 					   value="<?php p($_['displayName']) ?>"
73 73
 					   autocomplete="on" autocapitalize="none" autocorrect="off" />
74
-				<?php if(!$_['displayNameChangeSupported']) { ?>
75
-					<span><?php if(isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
74
+				<?php if (!$_['displayNameChangeSupported']) { ?>
75
+					<span><?php if (isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span>
76 76
 				<?php } ?>
77 77
 				<span class="icon-checkmark hidden"/>
78
-				<?php if($_['lookupServerUploadEnabled']) { ?>
78
+				<?php if ($_['lookupServerUploadEnabled']) { ?>
79 79
 					<input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>">
80 80
 				<?php } ?>
81 81
 			</form>
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
 					<label for="email"><?php p($l->t('Email')); ?></label>
87 87
 					<span class="icon-password"/>
88 88
 				</h2>
89
-				<div class="verify <?php if ($_['email'] === ''  || $_['emailScope'] !== 'public') p('hidden'); ?>">
89
+				<div class="verify <?php if ($_['email'] === '' || $_['emailScope'] !== 'public') p('hidden'); ?>">
90 90
 					<img id="verify-email" title="<?php p($_['emailMessage']); ?>" data-status="<?php p($_['emailVerification']) ?>" src="
91 91
 				<?php
92
-					switch($_['emailVerification']) {
92
+					switch ($_['emailVerification']) {
93 93
 						case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
94 94
 							p(image_path('core', 'actions/verifying.svg'));
95 95
 							break;
@@ -102,23 +102,23 @@  discard block
 block discarded – undo
102 102
 					?>">
103 103
 				</div>
104 104
 				<input type="email" name="email" id="email" value="<?php p($_['email']); ?>"
105
-					<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
105
+					<?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
106 106
 					   placeholder="<?php p($l->t('Your email address')); ?>"
107 107
 					   autocomplete="on" autocapitalize="none" autocorrect="off" />
108
-				<?php if(!$_['displayNameChangeSupported']) { ?>
109
-					<span><?php if(isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span>
108
+				<?php if (!$_['displayNameChangeSupported']) { ?>
109
+					<span><?php if (isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span>
110 110
 				<?php } ?>
111
-				<?php if($_['displayNameChangeSupported']) { ?>
111
+				<?php if ($_['displayNameChangeSupported']) { ?>
112 112
 					<br />
113 113
 					<em><?php p($l->t('For password reset and notifications')); ?></em>
114 114
 				<?php } ?>
115 115
 				<span class="icon-checkmark hidden"/>
116
-				<?php if($_['lookupServerUploadEnabled']) { ?>
116
+				<?php if ($_['lookupServerUploadEnabled']) { ?>
117 117
 					<input type="hidden" id="emailscope" value="<?php p($_['emailScope']) ?>">
118 118
 				<?php } ?>
119 119
 			</form>
120 120
 		</div>
121
-		<?php if($_['lookupServerUploadEnabled']) { ?>
121
+		<?php if ($_['lookupServerUploadEnabled']) { ?>
122 122
 			<div class="personal-settings-setting-box">
123 123
 				<form id="phoneform" class="section">
124 124
 					<h2>
@@ -153,10 +153,10 @@  discard block
 block discarded – undo
153 153
 						<label for="website"><?php p($l->t('Website')); ?></label>
154 154
 						<span class="icon-password"/>
155 155
 					</h2>
156
-					<div class="verify <?php if ($_['website'] === ''  || $_['websiteScope'] !== 'public') p('hidden'); ?>">
156
+					<div class="verify <?php if ($_['website'] === '' || $_['websiteScope'] !== 'public') p('hidden'); ?>">
157 157
 						<img id="verify-website" title="<?php p($_['websiteMessage']); ?>" data-status="<?php p($_['websiteVerification']) ?>" src="
158 158
 				<?php
159
-						switch($_['websiteVerification']) {
159
+						switch ($_['websiteVerification']) {
160 160
 							case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
161 161
 								p(image_path('core', 'actions/verifying.svg'));
162 162
 								break;
@@ -167,13 +167,13 @@  discard block
 block discarded – undo
167 167
 								p(image_path('core', 'actions/verify.svg'));
168 168
 						}
169 169
 						?>"
170
-							<?php if($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
170
+							<?php if ($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
171 171
 						>
172 172
 						<div class="verification-dialog popovermenu bubble menu">
173 173
 							<div class="verification-dialog-content">
174 174
 								<p class="explainVerification"></p>
175 175
 								<p class="verificationCode"></p>
176
-								<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p>
176
+								<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p>
177 177
 							</div>
178 178
 						</div>
179 179
 					</div>
@@ -190,10 +190,10 @@  discard block
 block discarded – undo
190 190
 						<label for="twitter"><?php p($l->t('Twitter')); ?></label>
191 191
 						<span class="icon-password"/>
192 192
 					</h2>
193
-					<div class="verify <?php if ($_['twitter'] === ''  || $_['twitterScope'] !== 'public') p('hidden'); ?>">
193
+					<div class="verify <?php if ($_['twitter'] === '' || $_['twitterScope'] !== 'public') p('hidden'); ?>">
194 194
 						<img id="verify-twitter" title="<?php p($_['twitterMessage']); ?>" data-status="<?php p($_['twitterVerification']) ?>" src="
195 195
 				<?php
196
-						switch($_['twitterVerification']) {
196
+						switch ($_['twitterVerification']) {
197 197
 							case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS:
198 198
 								p(image_path('core', 'actions/verifying.svg'));
199 199
 								break;
@@ -204,13 +204,13 @@  discard block
 block discarded – undo
204 204
 								p(image_path('core', 'actions/verify.svg'));
205 205
 						}
206 206
 						?>"
207
-							<?php if($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
207
+							<?php if ($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?>
208 208
 						>
209 209
 						<div class="verification-dialog popovermenu bubble menu">
210 210
 							<div class="verification-dialog-content">
211 211
 								<p class="explainVerification"></p>
212 212
 								<p class="verificationCode"></p>
213
-								<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p>
213
+								<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p>
214 214
 							</div>
215 215
 						</div>
216 216
 					</div>
@@ -235,19 +235,19 @@  discard block
 block discarded – undo
235 235
 </div>
236 236
 
237 237
 <?php
238
-if($_['passwordChangeSupported']) {
238
+if ($_['passwordChangeSupported']) {
239 239
 	script('jquery-showpassword');
240 240
 	?>
241 241
 	<form id="passwordform" class="section">
242
-		<h2 class="inlineblock"><?php p($l->t('Password'));?></h2>
242
+		<h2 class="inlineblock"><?php p($l->t('Password')); ?></h2>
243 243
 		<div id="password-error-msg" class="msg success inlineblock" style="display: none;">Saved</div>
244 244
 		<br>
245 245
 		<label for="pass1" class="hidden-visually"><?php p($l->t('Current password')); ?>: </label>
246 246
 		<input type="password" id="pass1" name="oldpassword"
247
-			   placeholder="<?php p($l->t('Current password'));?>"
247
+			   placeholder="<?php p($l->t('Current password')); ?>"
248 248
 			   autocomplete="off" autocapitalize="none" autocorrect="off" />
249 249
 		<div class="personal-show-container">
250
-			<label for="pass2" class="hidden-visually"><?php p($l->t('New password'));?>: </label>
250
+			<label for="pass2" class="hidden-visually"><?php p($l->t('New password')); ?>: </label>
251 251
 			<input type="password" id="pass2" name="newpassword"
252 252
 				   placeholder="<?php p($l->t('New password')); ?>"
253 253
 				   data-typetoggle="#personal-show"
@@ -263,44 +263,44 @@  discard block
 block discarded – undo
263 263
 
264 264
 <form id="language" class="section">
265 265
 	<h2>
266
-		<label for="languageinput"><?php p($l->t('Language'));?></label>
266
+		<label for="languageinput"><?php p($l->t('Language')); ?></label>
267 267
 	</h2>
268
-	<select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language'));?>">
269
-		<option value="<?php p($_['activelanguage']['code']);?>">
270
-			<?php p($_['activelanguage']['name']);?>
268
+	<select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language')); ?>">
269
+		<option value="<?php p($_['activelanguage']['code']); ?>">
270
+			<?php p($_['activelanguage']['name']); ?>
271 271
 		</option>
272
-		<?php foreach($_['commonlanguages'] as $language):?>
273
-			<option value="<?php p($language['code']);?>">
274
-				<?php p($language['name']);?>
272
+		<?php foreach ($_['commonlanguages'] as $language):?>
273
+			<option value="<?php p($language['code']); ?>">
274
+				<?php p($language['name']); ?>
275 275
 			</option>
276
-		<?php endforeach;?>
276
+		<?php endforeach; ?>
277 277
 		<optgroup label="––––––––––"></optgroup>
278
-		<?php foreach($_['languages'] as $language):?>
279
-			<option value="<?php p($language['code']);?>">
280
-				<?php p($language['name']);?>
278
+		<?php foreach ($_['languages'] as $language):?>
279
+			<option value="<?php p($language['code']); ?>">
280
+				<?php p($language['name']); ?>
281 281
 			</option>
282
-		<?php endforeach;?>
282
+		<?php endforeach; ?>
283 283
 	</select>
284 284
 	<a href="https://www.transifex.com/nextcloud/nextcloud/"
285 285
 	   target="_blank" rel="noreferrer">
286
-		<em><?php p($l->t('Help translate'));?></em>
286
+		<em><?php p($l->t('Help translate')); ?></em>
287 287
 	</a>
288 288
 </form>
289 289
 
290 290
 
291 291
 <div id="clientsbox" class="section clientsbox">
292
-	<h2><?php p($l->t('Get the apps to sync your files'));?></h2>
292
+	<h2><?php p($l->t('Get the apps to sync your files')); ?></h2>
293 293
 	<a href="<?php p($_['clients']['desktop']); ?>" rel="noreferrer" target="_blank">
294 294
 		<img src="<?php print_unescaped(image_path('core', 'desktopapp.svg')); ?>"
295
-			 alt="<?php p($l->t('Desktop client'));?>" />
295
+			 alt="<?php p($l->t('Desktop client')); ?>" />
296 296
 	</a>
297 297
 	<a href="<?php p($_['clients']['android']); ?>" rel="noreferrer" target="_blank">
298 298
 		<img src="<?php print_unescaped(image_path('core', 'googleplay.png')); ?>"
299
-			 alt="<?php p($l->t('Android app'));?>" />
299
+			 alt="<?php p($l->t('Android app')); ?>" />
300 300
 	</a>
301 301
 	<a href="<?php p($_['clients']['ios']); ?>" rel="noreferrer" target="_blank">
302 302
 		<img src="<?php print_unescaped(image_path('core', 'appstore.svg')); ?>"
303
-			 alt="<?php p($l->t('iOS app'));?>" />
303
+			 alt="<?php p($l->t('iOS app')); ?>" />
304 304
 	</a>
305 305
 
306 306
 	<p>
@@ -316,8 +316,8 @@  discard block
 block discarded – undo
316 316
 			$l->t('If you want to support the project {contributeopen}join development{linkclose} or {contributeopen}spread the word{linkclose}!'))); ?>
317 317
 	</p>
318 318
 
319
-	<?php if(OC_APP::isEnabled('firstrunwizard')) {?>
320
-		<p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again'));?></a></p>
319
+	<?php if (OC_APP::isEnabled('firstrunwizard')) {?>
320
+		<p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again')); ?></a></p>
321 321
 	<?php }?>
322 322
 </div>
323 323
 
Please login to merge, or discard this patch.
settings/templates/settings/frame.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  */
23 23
 
24 24
 style('settings', 'settings');
25
-script('settings', [ 'settings', 'admin', 'log', 'certificates'] );
25
+script('settings', ['settings', 'admin', 'log', 'certificates']);
26 26
 script('core', ['multiselect', 'setupchecks']);
27 27
 script('files', 'jquery.fileupload');
28 28
 
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
 	<ul>
33 33
 		<li class="settings-caption">Personal</li>
34 34
 		<?php
35
-		foreach($_['forms']['personal'] as $form) {
35
+		foreach ($_['forms']['personal'] as $form) {
36 36
 			if (isset($form['anchor'])) {
37 37
 				$anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.PersonalSettings.index', ['section' => $form['anchor']]);
38
-				$class = 'nav-icon-' . $form['anchor'];
38
+				$class = 'nav-icon-'.$form['anchor'];
39 39
 				$sectionName = $form['section-name'];
40 40
 				$active = $form['active'] ? ' class="active"' : '';
41 41
 				?>
@@ -55,16 +55,16 @@  discard block
 block discarded – undo
55 55
 		?>
56 56
 
57 57
 		<?php
58
-		if(!empty($_['forms']['admin'])) {
58
+		if (!empty($_['forms']['admin'])) {
59 59
 			?>
60 60
 			<li class="settings-caption">Administration</li>
61 61
 			<?php
62 62
 		}
63
-		foreach($_['forms']['admin'] as $form) {
63
+		foreach ($_['forms']['admin'] as $form) {
64 64
 			if (isset($form['anchor'])) {
65 65
 
66 66
 				$anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => $form['anchor']]);
67
-				$class = 'nav-icon-' . $form['anchor'];
67
+				$class = 'nav-icon-'.$form['anchor'];
68 68
 				$sectionName = $form['section-name'];
69 69
 				$active = $form['active'] ? ' class="active"' : '';
70 70
 		?>
Please login to merge, or discard this patch.