| @@ -51,6 +51,9 @@ discard block | ||
| 51 | 51 | ]; | 
| 52 | 52 | } | 
| 53 | 53 | |
| 54 | + /** | |
| 55 | + * @param string $type | |
| 56 | + */ | |
| 54 | 57 |  	protected function formatSections($sections, $currentSection, $type) { | 
| 55 | 58 | $templateParameters = []; | 
| 56 | 59 | /** @var \OCP\Settings\ISection[] $prioritizedSections */ | 
| @@ -81,6 +84,9 @@ discard block | ||
| 81 | 84 | return $templateParameters; | 
| 82 | 85 | } | 
| 83 | 86 | |
| 87 | + /** | |
| 88 | + * @param string $currentSections | |
| 89 | + */ | |
| 84 | 90 |  	protected function formatPersonalSections($currentSections) { | 
| 85 | 91 | $sections = $this->settingsManager->getPersonalSections(); | 
| 86 | 92 | $templateParameters = $this->formatSections($sections, $currentSections, 'personal'); | 
| @@ -88,6 +94,9 @@ discard block | ||
| 88 | 94 | return $templateParameters; | 
| 89 | 95 | } | 
| 90 | 96 | |
| 97 | + /** | |
| 98 | + * @param string $currentSections | |
| 99 | + */ | |
| 91 | 100 |  	protected function formatAdminSections($currentSections) { | 
| 92 | 101 | $sections = $this->settingsManager->getAdminSections(); | 
| 93 | 102 | $templateParameters = $this->formatSections($sections, $currentSections, 'admin'); | 
| @@ -111,6 +120,9 @@ discard block | ||
| 111 | 120 | return ['content' => $html]; | 
| 112 | 121 | } | 
| 113 | 122 | |
| 123 | + /** | |
| 124 | + * @param string $section | |
| 125 | + */ | |
| 114 | 126 |  	private function getIndexResponse($section) { | 
| 115 | 127 | $templateParams = []; | 
| 116 | 128 | $templateParams = array_merge($templateParams, $this->getNavigationParameters($section)); | 
| @@ -28,7 +28,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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)) { | 
| @@ -22,7 +22,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ?> | 
| @@ -45,7 +45,7 @@ | ||
| 45 | 45 | * @since 9.1 | 
| 46 | 46 | */ | 
| 47 | 47 |  	public function getForm() { | 
| 48 | - $parameters = [ 'clients' => $this->getClientLinks() ]; | |
| 48 | + $parameters = ['clients' => $this->getClientLinks()]; | |
| 49 | 49 |  		return new TemplateResponse('settings', 'settings/personal/sync-clients', $parameters); | 
| 50 | 50 | } | 
| 51 | 51 | |
| @@ -35,7 +35,7 @@ discard block | ||
| 35 | 35 | /** | 
| 36 | 36 | * @since 9.1.0 | 
| 37 | 37 | */ | 
| 38 | - const KEY_ADMIN_SECTION = 'admin-section'; | |
| 38 | + const KEY_ADMIN_SECTION = 'admin-section'; | |
| 39 | 39 | |
| 40 | 40 | /** | 
| 41 | 41 | * @since 12.0.0 | 
| @@ -45,7 +45,7 @@ discard block | ||
| 45 | 45 | /** | 
| 46 | 46 | * @since 12.0.0 | 
| 47 | 47 | */ | 
| 48 | - const KEY_PERSONAL_SECTION = 'personal-section'; | |
| 48 | + const KEY_PERSONAL_SECTION = 'personal-section'; | |
| 49 | 49 | |
| 50 | 50 | /** | 
| 51 | 51 | * sets up settings according to data specified by an apps info.xml, within | 
| @@ -41,15 +41,15 @@ discard block | ||
| 41 | 41 | ?> | 
| 42 | 42 | |
| 43 | 43 | <div id="quota" class="section"> | 
| 44 | - <div style="width:<?php p($_['usage_relative']);?>%" | |
| 45 | - <?php if($_['usage_relative'] > 80): ?> class="quota-warning" <?php endif; ?>> | |
| 44 | + <div style="width:<?php p($_['usage_relative']); ?>%" | |
| 45 | + <?php if ($_['usage_relative'] > 80): ?> class="quota-warning" <?php endif; ?>> | |
| 46 | 46 | <p id="quotatext"> | 
| 47 | 47 | <?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?> | 
| 48 | 48 |  				<?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong>', | 
| 49 | - [$_['usage'], $_['total_space']]));?> | |
| 49 | + [$_['usage'], $_['total_space']])); ?> | |
| 50 | 50 | <?php else: ?> | 
| 51 | 51 |  				<?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong> (<strong>%s %%</strong>)', | 
| 52 | - [$_['usage'], $_['total_space'], $_['usage_relative']]));?> | |
| 52 | + [$_['usage'], $_['total_space'], $_['usage_relative']])); ?> | |
| 53 | 53 | <?php endif ?> | 
| 54 | 54 | </p> | 
| 55 | 55 | </div> | 
| @@ -83,7 +83,7 @@ discard block | ||
| 83 | 83 | </div> | 
| 84 | 84 | </div> | 
| 85 | 85 | <span class="icon-checkmark hidden"/> | 
| 86 | -			<?php if($_['lookupServerUploadEnabled']) { ?> | |
| 86 | +			<?php if ($_['lookupServerUploadEnabled']) { ?> | |
| 87 | 87 | <input type="hidden" id="avatarscope" value="<?php p($_['avatarScope']) ?>"> | 
| 88 | 88 | <?php } ?> | 
| 89 | 89 | </form> | 
| @@ -97,14 +97,14 @@ discard block | ||
| 97 | 97 | <span class="icon-password"/> | 
| 98 | 98 | </h2> | 
| 99 | 99 | <input type="text" id="displayname" name="displayname" | 
| 100 | -					<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> | |
| 100 | +					<?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> | |
| 101 | 101 | value="<?php p($_['displayName']) ?>" | 
| 102 | 102 | autocomplete="on" autocapitalize="none" autocorrect="off" /> | 
| 103 | -				<?php if(!$_['displayNameChangeSupported']) { ?> | |
| 104 | -					<span><?php if(isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span> | |
| 103 | +				<?php if (!$_['displayNameChangeSupported']) { ?> | |
| 104 | +					<span><?php if (isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span> | |
| 105 | 105 | <?php } ?> | 
| 106 | 106 | <span class="icon-checkmark hidden"/> | 
| 107 | -				<?php if($_['lookupServerUploadEnabled']) { ?> | |
| 107 | +				<?php if ($_['lookupServerUploadEnabled']) { ?> | |
| 108 | 108 | <input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>"> | 
| 109 | 109 | <?php } ?> | 
| 110 | 110 | </form> | 
| @@ -115,10 +115,10 @@ discard block | ||
| 115 | 115 |  					<label for="email"><?php p($l->t('Email')); ?></label> | 
| 116 | 116 | <span class="icon-password"/> | 
| 117 | 117 | </h2> | 
| 118 | -				<div class="verify <?php if ($_['email'] === ''  || $_['emailScope'] !== 'public') p('hidden'); ?>"> | |
| 118 | +				<div class="verify <?php if ($_['email'] === '' || $_['emailScope'] !== 'public') p('hidden'); ?>"> | |
| 119 | 119 | <img id="verify-email" title="<?php p($_['emailMessage']); ?>" data-status="<?php p($_['emailVerification']) ?>" src=" | 
| 120 | 120 | <?php | 
| 121 | -					switch($_['emailVerification']) { | |
| 121 | +					switch ($_['emailVerification']) { | |
| 122 | 122 | case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: | 
| 123 | 123 |  							p(image_path('core', 'actions/verifying.svg')); | 
| 124 | 124 | break; | 
| @@ -131,23 +131,23 @@ discard block | ||
| 131 | 131 | ?>"> | 
| 132 | 132 | </div> | 
| 133 | 133 | <input type="email" name="email" id="email" value="<?php p($_['email']); ?>" | 
| 134 | -					<?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> | |
| 134 | +					<?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> | |
| 135 | 135 |  					   placeholder="<?php p($l->t('Your email address')); ?>" | 
| 136 | 136 | autocomplete="on" autocapitalize="none" autocorrect="off" /> | 
| 137 | -				<?php if(!$_['displayNameChangeSupported']) { ?> | |
| 138 | -					<span><?php if(isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span> | |
| 137 | +				<?php if (!$_['displayNameChangeSupported']) { ?> | |
| 138 | +					<span><?php if (isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span> | |
| 139 | 139 | <?php } ?> | 
| 140 | -				<?php if($_['displayNameChangeSupported']) { ?> | |
| 140 | +				<?php if ($_['displayNameChangeSupported']) { ?> | |
| 141 | 141 | <br /> | 
| 142 | 142 |  					<em><?php p($l->t('For password reset and notifications')); ?></em> | 
| 143 | 143 | <?php } ?> | 
| 144 | 144 | <span class="icon-checkmark hidden"/> | 
| 145 | -				<?php if($_['lookupServerUploadEnabled']) { ?> | |
| 145 | +				<?php if ($_['lookupServerUploadEnabled']) { ?> | |
| 146 | 146 | <input type="hidden" id="emailscope" value="<?php p($_['emailScope']) ?>"> | 
| 147 | 147 | <?php } ?> | 
| 148 | 148 | </form> | 
| 149 | 149 | </div> | 
| 150 | -		<?php if($_['lookupServerUploadEnabled']) { ?> | |
| 150 | +		<?php if ($_['lookupServerUploadEnabled']) { ?> | |
| 151 | 151 | <div class="personal-settings-setting-box"> | 
| 152 | 152 | <form id="phoneform" class="section"> | 
| 153 | 153 | <h2> | 
| @@ -182,10 +182,10 @@ discard block | ||
| 182 | 182 |  						<label for="website"><?php p($l->t('Website')); ?></label> | 
| 183 | 183 | <span class="icon-password"/> | 
| 184 | 184 | </h2> | 
| 185 | -					<div class="verify <?php if ($_['website'] === ''  || $_['websiteScope'] !== 'public') p('hidden'); ?>"> | |
| 185 | +					<div class="verify <?php if ($_['website'] === '' || $_['websiteScope'] !== 'public') p('hidden'); ?>"> | |
| 186 | 186 | <img id="verify-website" title="<?php p($_['websiteMessage']); ?>" data-status="<?php p($_['websiteVerification']) ?>" src=" | 
| 187 | 187 | <?php | 
| 188 | -						switch($_['websiteVerification']) { | |
| 188 | +						switch ($_['websiteVerification']) { | |
| 189 | 189 | case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: | 
| 190 | 190 |  								p(image_path('core', 'actions/verifying.svg')); | 
| 191 | 191 | break; | 
| @@ -196,13 +196,13 @@ discard block | ||
| 196 | 196 |  								p(image_path('core', 'actions/verify.svg')); | 
| 197 | 197 | } | 
| 198 | 198 | ?>" | 
| 199 | -							<?php if($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?> | |
| 199 | +							<?php if ($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?> | |
| 200 | 200 | > | 
| 201 | 201 | <div class="verification-dialog popovermenu bubble menu"> | 
| 202 | 202 | <div class="verification-dialog-content"> | 
| 203 | 203 | <p class="explainVerification"></p> | 
| 204 | 204 | <p class="verificationCode"></p> | 
| 205 | -								<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p> | |
| 205 | +								<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p> | |
| 206 | 206 | </div> | 
| 207 | 207 | </div> | 
| 208 | 208 | </div> | 
| @@ -219,10 +219,10 @@ discard block | ||
| 219 | 219 |  						<label for="twitter"><?php p($l->t('Twitter')); ?></label> | 
| 220 | 220 | <span class="icon-password"/> | 
| 221 | 221 | </h2> | 
| 222 | -					<div class="verify <?php if ($_['twitter'] === ''  || $_['twitterScope'] !== 'public') p('hidden'); ?>"> | |
| 222 | +					<div class="verify <?php if ($_['twitter'] === '' || $_['twitterScope'] !== 'public') p('hidden'); ?>"> | |
| 223 | 223 | <img id="verify-twitter" title="<?php p($_['twitterMessage']); ?>" data-status="<?php p($_['twitterVerification']) ?>" src=" | 
| 224 | 224 | <?php | 
| 225 | -						switch($_['twitterVerification']) { | |
| 225 | +						switch ($_['twitterVerification']) { | |
| 226 | 226 | case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: | 
| 227 | 227 |  								p(image_path('core', 'actions/verifying.svg')); | 
| 228 | 228 | break; | 
| @@ -233,13 +233,13 @@ discard block | ||
| 233 | 233 |  								p(image_path('core', 'actions/verify.svg')); | 
| 234 | 234 | } | 
| 235 | 235 | ?>" | 
| 236 | -							<?php if($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?> | |
| 236 | +							<?php if ($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?> | |
| 237 | 237 | > | 
| 238 | 238 | <div class="verification-dialog popovermenu bubble menu"> | 
| 239 | 239 | <div class="verification-dialog-content"> | 
| 240 | 240 | <p class="explainVerification"></p> | 
| 241 | 241 | <p class="verificationCode"></p> | 
| 242 | -								<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p> | |
| 242 | +								<p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p> | |
| 243 | 243 | </div> | 
| 244 | 244 | </div> | 
| 245 | 245 | </div> | 
| @@ -264,19 +264,19 @@ discard block | ||
| 264 | 264 | </div> | 
| 265 | 265 | |
| 266 | 266 | <?php | 
| 267 | -if($_['passwordChangeSupported']) { | |
| 267 | +if ($_['passwordChangeSupported']) { | |
| 268 | 268 |  	script('jquery-showpassword'); | 
| 269 | 269 | ?> | 
| 270 | 270 | <form id="passwordform" class="section"> | 
| 271 | -		<h2 class="inlineblock"><?php p($l->t('Password'));?></h2> | |
| 271 | +		<h2 class="inlineblock"><?php p($l->t('Password')); ?></h2> | |
| 272 | 272 | <div id="password-error-msg" class="msg success inlineblock" style="display: none;">Saved</div> | 
| 273 | 273 | <br> | 
| 274 | 274 |  		<label for="pass1" class="hidden-visually"><?php p($l->t('Current password')); ?>: </label> | 
| 275 | 275 | <input type="password" id="pass1" name="oldpassword" | 
| 276 | -			   placeholder="<?php p($l->t('Current password'));?>" | |
| 276 | +			   placeholder="<?php p($l->t('Current password')); ?>" | |
| 277 | 277 | autocomplete="off" autocapitalize="none" autocorrect="off" /> | 
| 278 | 278 | <div class="personal-show-container"> | 
| 279 | -			<label for="pass2" class="hidden-visually"><?php p($l->t('New password'));?>: </label> | |
| 279 | +			<label for="pass2" class="hidden-visually"><?php p($l->t('New password')); ?>: </label> | |
| 280 | 280 | <input type="password" id="pass2" name="newpassword" | 
| 281 | 281 |  				   placeholder="<?php p($l->t('New password')); ?>" | 
| 282 | 282 | data-typetoggle="#personal-show" | 
| @@ -292,26 +292,26 @@ discard block | ||
| 292 | 292 | |
| 293 | 293 | <form id="language" class="section"> | 
| 294 | 294 | <h2> | 
| 295 | -		<label for="languageinput"><?php p($l->t('Language'));?></label> | |
| 295 | +		<label for="languageinput"><?php p($l->t('Language')); ?></label> | |
| 296 | 296 | </h2> | 
| 297 | -	<select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language'));?>"> | |
| 298 | - <option value="<?php p($_['activelanguage']['code']);?>"> | |
| 299 | - <?php p($_['activelanguage']['name']);?> | |
| 297 | +	<select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language')); ?>"> | |
| 298 | + <option value="<?php p($_['activelanguage']['code']); ?>"> | |
| 299 | + <?php p($_['activelanguage']['name']); ?> | |
| 300 | 300 | </option> | 
| 301 | - <?php foreach($_['commonlanguages'] as $language):?> | |
| 302 | - <option value="<?php p($language['code']);?>"> | |
| 303 | - <?php p($language['name']);?> | |
| 301 | + <?php foreach ($_['commonlanguages'] as $language):?> | |
| 302 | + <option value="<?php p($language['code']); ?>"> | |
| 303 | + <?php p($language['name']); ?> | |
| 304 | 304 | </option> | 
| 305 | - <?php endforeach;?> | |
| 305 | + <?php endforeach; ?> | |
| 306 | 306 | <optgroup label="––––––––––"></optgroup> | 
| 307 | - <?php foreach($_['languages'] as $language):?> | |
| 308 | - <option value="<?php p($language['code']);?>"> | |
| 309 | - <?php p($language['name']);?> | |
| 307 | + <?php foreach ($_['languages'] as $language):?> | |
| 308 | + <option value="<?php p($language['code']); ?>"> | |
| 309 | + <?php p($language['name']); ?> | |
| 310 | 310 | </option> | 
| 311 | - <?php endforeach;?> | |
| 311 | + <?php endforeach; ?> | |
| 312 | 312 | </select> | 
| 313 | 313 | <a href="https://www.transifex.com/nextcloud/nextcloud/" | 
| 314 | 314 | target="_blank" rel="noreferrer"> | 
| 315 | -		<em><?php p($l->t('Help translate'));?></em> | |
| 315 | +		<em><?php p($l->t('Help translate')); ?></em> | |
| 316 | 316 | </a> | 
| 317 | 317 | </form> | 
| @@ -26,18 +26,18 @@ discard block | ||
| 26 | 26 | ?> | 
| 27 | 27 | |
| 28 | 28 | <div id="clientsbox" class="section clientsbox"> | 
| 29 | -	<h2><?php p($l->t('Get the apps to sync your files'));?></h2> | |
| 29 | +	<h2><?php p($l->t('Get the apps to sync your files')); ?></h2> | |
| 30 | 30 | <a href="<?php p($_['clients']['desktop']); ?>" rel="noreferrer" target="_blank"> | 
| 31 | 31 |  		<img src="<?php print_unescaped(image_path('core', 'desktopapp.svg')); ?>" | 
| 32 | -			 alt="<?php p($l->t('Desktop client'));?>" /> | |
| 32 | +			 alt="<?php p($l->t('Desktop client')); ?>" /> | |
| 33 | 33 | </a> | 
| 34 | 34 | <a href="<?php p($_['clients']['android']); ?>" rel="noreferrer" target="_blank"> | 
| 35 | 35 |  		<img src="<?php print_unescaped(image_path('core', 'googleplay.png')); ?>" | 
| 36 | -			 alt="<?php p($l->t('Android app'));?>" /> | |
| 36 | +			 alt="<?php p($l->t('Android app')); ?>" /> | |
| 37 | 37 | </a> | 
| 38 | 38 | <a href="<?php p($_['clients']['ios']); ?>" rel="noreferrer" target="_blank"> | 
| 39 | 39 |  		<img src="<?php print_unescaped(image_path('core', 'appstore.svg')); ?>" | 
| 40 | -			 alt="<?php p($l->t('iOS app'));?>" /> | |
| 40 | +			 alt="<?php p($l->t('iOS app')); ?>" /> | |
| 41 | 41 | </a> | 
| 42 | 42 | |
| 43 | 43 | <p> | 
| @@ -53,7 +53,7 @@ discard block | ||
| 53 | 53 |  			$l->t('If you want to support the project {contributeopen}join development{linkclose} or {contributeopen}spread the word{linkclose}!'))); ?> | 
| 54 | 54 | </p> | 
| 55 | 55 | |
| 56 | -	<?php if(OC_APP::isEnabled('firstrunwizard')) {?> | |
| 57 | -		<p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again'));?></a></p> | |
| 56 | +	<?php if (OC_APP::isEnabled('firstrunwizard')) {?> | |
| 57 | +		<p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again')); ?></a></p> | |
| 58 | 58 | <?php }?> | 
| 59 | 59 | </div> | 
| @@ -265,6 +265,9 @@ discard block | ||
| 265 | 265 | return $this->mapper->has($table, $className); | 
| 266 | 266 | } | 
| 267 | 267 | |
| 268 | + /** | |
| 269 | + * @param string $type | |
| 270 | + */ | |
| 268 | 271 |  	private function setupSettingsEntry($settingsClassName, $type) { | 
| 269 | 272 |  		if (!class_exists($settingsClassName)) { | 
| 270 | 273 |  			$this->log->debug('Could not find ' . $type . ' section class ' . $settingsClassName); | 
| @@ -294,6 +297,9 @@ discard block | ||
| 294 | 297 | } | 
| 295 | 298 | } | 
| 296 | 299 | |
| 300 | + /** | |
| 301 | + * @param string $type | |
| 302 | + */ | |
| 297 | 303 |  	private function getSectionTableForType($type) { | 
| 298 | 304 |  		if($type === 'admin') { | 
| 299 | 305 | return Mapper::TABLE_ADMIN_SECTIONS; | 
| @@ -188,7 +188,7 @@ discard block | ||
| 188 | 188 | */ | 
| 189 | 189 |  	private function setupSectionEntry($sectionClassName, $type) { | 
| 190 | 190 |  		if (!class_exists($sectionClassName)) { | 
| 191 | -			$this->log->debug('Could not find ' . ucfirst($type) . ' section class ' . $sectionClassName); | |
| 191 | +			$this->log->debug('Could not find '.ucfirst($type).' section class '.$sectionClassName); | |
| 192 | 192 | return; | 
| 193 | 193 | } | 
| 194 | 194 |  		try { | 
| @@ -200,13 +200,13 @@ discard block | ||
| 200 | 200 | |
| 201 | 201 |  		if (!$section instanceof ISection) { | 
| 202 | 202 | $this->log->error( | 
| 203 | -				ucfirst($type) .' section instance must implement \OCP\ISection. Invalid class: {class}', | |
| 203 | +				ucfirst($type).' section instance must implement \OCP\ISection. Invalid class: {class}', | |
| 204 | 204 | ['class' => $sectionClassName] | 
| 205 | 205 | ); | 
| 206 | 206 | return; | 
| 207 | 207 | } | 
| 208 | 208 | $table = $this->getSectionTableForType($type); | 
| 209 | -		if(!$this->hasSection(get_class($section), $table)) { | |
| 209 | +		if (!$this->hasSection(get_class($section), $table)) { | |
| 210 | 210 | $this->addSection($section, $table); | 
| 211 | 211 |  		} else { | 
| 212 | 212 | $this->updateSection($section, $table); | 
| @@ -272,7 +272,7 @@ discard block | ||
| 272 | 272 | |
| 273 | 273 |  	private function setupSettingsEntry($settingsClassName, $type) { | 
| 274 | 274 |  		if (!class_exists($settingsClassName)) { | 
| 275 | -			$this->log->debug('Could not find ' . $type . ' section class ' . $settingsClassName); | |
| 275 | +			$this->log->debug('Could not find '.$type.' section class '.$settingsClassName); | |
| 276 | 276 | return; | 
| 277 | 277 | } | 
| 278 | 278 | |
| @@ -286,7 +286,7 @@ discard block | ||
| 286 | 286 | |
| 287 | 287 |  		if (!$settings instanceof ISettings) { | 
| 288 | 288 | $this->log->error( | 
| 289 | -				ucfirst($type) . ' section instance must implement \OCP\Settings\ISettings. Invalid class: {class}', | |
| 289 | +				ucfirst($type).' section instance must implement \OCP\Settings\ISettings. Invalid class: {class}', | |
| 290 | 290 | ['class' => $settingsClassName] | 
| 291 | 291 | ); | 
| 292 | 292 | return; | 
| @@ -300,18 +300,18 @@ discard block | ||
| 300 | 300 | } | 
| 301 | 301 | |
| 302 | 302 |  	private function getSectionTableForType($type) { | 
| 303 | -		if($type === 'admin') { | |
| 303 | +		if ($type === 'admin') { | |
| 304 | 304 | return Mapper::TABLE_ADMIN_SECTIONS; | 
| 305 | -		} else if($type === 'personal') { | |
| 305 | +		} else if ($type === 'personal') { | |
| 306 | 306 | return Mapper::TABLE_PERSONAL_SECTIONS; | 
| 307 | 307 | } | 
| 308 | 308 |  		throw new \InvalidArgumentException('"admin" or "personal" expected'); | 
| 309 | 309 | } | 
| 310 | 310 | |
| 311 | 311 |  	private function getSettingsTableForType($type) { | 
| 312 | -		if($type === 'admin') { | |
| 312 | +		if ($type === 'admin') { | |
| 313 | 313 | return Mapper::TABLE_ADMIN_SETTINGS; | 
| 314 | -		} else if($type === 'personal') { | |
| 314 | +		} else if ($type === 'personal') { | |
| 315 | 315 | return Mapper::TABLE_PERSONAL_SETTINGS; | 
| 316 | 316 | } | 
| 317 | 317 |  		throw new \InvalidArgumentException('"admin" or "personal" expected'); | 
| @@ -418,12 +418,12 @@ discard block | ||
| 418 | 418 | ); | 
| 419 | 419 | $forms[$form->getPriority()] = [$form]; | 
| 420 | 420 | } | 
| 421 | -			if($section === 'security') { | |
| 421 | +			if ($section === 'security') { | |
| 422 | 422 | /** @var ISettings $form */ | 
| 423 | 423 | $form = new Personal\Security(); | 
| 424 | 424 | $forms[$form->getPriority()] = [$form]; | 
| 425 | 425 | } | 
| 426 | -			if($section === 'sync-clients') { | |
| 426 | +			if ($section === 'sync-clients') { | |
| 427 | 427 | /** @var ISettings $form */ | 
| 428 | 428 | $form = new Personal\SyncClients($this->config, $this->defaults); | 
| 429 | 429 | $forms[$form->getPriority()] = [$form]; | 
| @@ -104,10 +104,10 @@ discard block | ||
| 104 | 104 | * @return array[] [['class' => string, 'priority' => int], ...] | 
| 105 | 105 | */ | 
| 106 | 106 |  	public function getSectionsFromDB($type) { | 
| 107 | -		if($type === 'admin') { | |
| 107 | +		if ($type === 'admin') { | |
| 108 | 108 | $sectionsTable = self::TABLE_ADMIN_SECTIONS; | 
| 109 | 109 | $settingsTable = self::TABLE_ADMIN_SETTINGS; | 
| 110 | -		} else if($type === 'personal') { | |
| 110 | +		} else if ($type === 'personal') { | |
| 111 | 111 | $sectionsTable = self::TABLE_PERSONAL_SECTIONS; | 
| 112 | 112 | $settingsTable = self::TABLE_PERSONAL_SETTINGS; | 
| 113 | 113 |  		} else { | 
| @@ -120,8 +120,8 @@ discard block | ||
| 120 | 120 | ->from($settingsTable, 'f') | 
| 121 | 121 |  			->where($query->expr()->eq('s.id', 'f.section')); | 
| 122 | 122 | $result = $query->execute(); | 
| 123 | -		return array_map(function ($row) { | |
| 124 | - $row['priority'] = (int)$row['priority']; | |
| 123 | +		return array_map(function($row) { | |
| 124 | + $row['priority'] = (int) $row['priority']; | |
| 125 | 125 | return $row; | 
| 126 | 126 | }, $result->fetchAll()); | 
| 127 | 127 | } | 
| @@ -132,7 +132,7 @@ discard block | ||
| 132 | 132 | */ | 
| 133 | 133 |  	public function add($table, array $values) { | 
| 134 | 134 | $query = $this->dbc->getQueryBuilder(); | 
| 135 | -		$values = array_map(function ($value) use ($query) { | |
| 135 | +		$values = array_map(function($value) use ($query) { | |
| 136 | 136 | return $query->createNamedParameter($value); | 
| 137 | 137 | }, $values); | 
| 138 | 138 | $query->insert($table)->values($values); | 
| @@ -153,7 +153,7 @@ discard block | ||
| 153 | 153 | $data = $resultStatement->fetchAll(); | 
| 154 | 154 | $resultStatement->closeCursor(); | 
| 155 | 155 | |
| 156 | -		return array_map(function ($row) { | |
| 156 | +		return array_map(function($row) { | |
| 157 | 157 | return $row['class']; | 
| 158 | 158 | }, $data); | 
| 159 | 159 | } | 
| @@ -176,7 +176,7 @@ discard block | ||
| 176 | 176 | $row = $result->fetch(); | 
| 177 | 177 | $result->closeCursor(); | 
| 178 | 178 | |
| 179 | - return (bool)$row; | |
| 179 | + return (bool) $row; | |
| 180 | 180 | } | 
| 181 | 181 | |
| 182 | 182 | /** | 
| @@ -67,7 +67,7 @@ discard block | ||
| 67 | 67 |  	protected function getSettings($section) { | 
| 68 | 68 | $settings = $this->settingsManager->getPersonalSettings($section); | 
| 69 | 69 | $formatted = $this->formatSettings($settings); | 
| 70 | -		if($section === 'additional') { | |
| 70 | +		if ($section === 'additional') { | |
| 71 | 71 | $formatted['content'] .= $this->getLegacyForms(); | 
| 72 | 72 | } | 
| 73 | 73 | return $formatted; | 
| @@ -79,9 +79,9 @@ discard block | ||
| 79 | 79 |  	private function getLegacyForms() { | 
| 80 | 80 |  		$forms = \OC_App::getForms('personal'); | 
| 81 | 81 | |
| 82 | -		$forms = array_map(function ($form) { | |
| 82 | +		$forms = array_map(function($form) { | |
| 83 | 83 |  			if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) { | 
| 84 | -				$sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]); | |
| 84 | +				$sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]); | |
| 85 | 85 |  				$sectionName = str_replace('</h2>', '', $sectionName); | 
| 86 | 86 | $anchor = strtolower($sectionName); | 
| 87 | 87 |  				$anchor = str_replace(' ', '-', $anchor); |