Completed
Pull Request — master (#7487)
by Björn
17:26
created
lib/private/Template/JSConfigHelper.php 2 patches
Indentation   +210 added lines, -210 removed lines patch added patch discarded remove patch
@@ -39,238 +39,238 @@
 block discarded – undo
39 39
 
40 40
 class JSConfigHelper {
41 41
 
42
-	/** @var IL10N */
43
-	private $l;
42
+    /** @var IL10N */
43
+    private $l;
44 44
 
45
-	/** @var Defaults */
46
-	private $defaults;
45
+    /** @var Defaults */
46
+    private $defaults;
47 47
 
48
-	/** @var IAppManager */
49
-	private $appManager;
48
+    /** @var IAppManager */
49
+    private $appManager;
50 50
 
51
-	/** @var ISession */
52
-	private $session;
51
+    /** @var ISession */
52
+    private $session;
53 53
 
54
-	/** @var IUser|null */
55
-	private $currentUser;
54
+    /** @var IUser|null */
55
+    private $currentUser;
56 56
 
57
-	/** @var IConfig */
58
-	private $config;
57
+    /** @var IConfig */
58
+    private $config;
59 59
 
60
-	/** @var IGroupManager */
61
-	private $groupManager;
60
+    /** @var IGroupManager */
61
+    private $groupManager;
62 62
 
63
-	/** @var IniGetWrapper */
64
-	private $iniWrapper;
63
+    /** @var IniGetWrapper */
64
+    private $iniWrapper;
65 65
 
66
-	/** @var IURLGenerator */
67
-	private $urlGenerator;
66
+    /** @var IURLGenerator */
67
+    private $urlGenerator;
68 68
 
69
-	/**
70
-	 * @param IL10N $l
71
-	 * @param Defaults $defaults
72
-	 * @param IAppManager $appManager
73
-	 * @param ISession $session
74
-	 * @param IUser|null $currentUser
75
-	 * @param IConfig $config
76
-	 * @param IGroupManager $groupManager
77
-	 * @param IniGetWrapper $iniWrapper
78
-	 * @param IURLGenerator $urlGenerator
79
-	 */
80
-	public function __construct(IL10N $l,
81
-								Defaults $defaults,
82
-								IAppManager $appManager,
83
-								ISession $session,
84
-								$currentUser,
85
-								IConfig $config,
86
-								IGroupManager $groupManager,
87
-								IniGetWrapper $iniWrapper,
88
-								IURLGenerator $urlGenerator) {
89
-		$this->l = $l;
90
-		$this->defaults = $defaults;
91
-		$this->appManager = $appManager;
92
-		$this->session = $session;
93
-		$this->currentUser = $currentUser;
94
-		$this->config = $config;
95
-		$this->groupManager = $groupManager;
96
-		$this->iniWrapper = $iniWrapper;
97
-		$this->urlGenerator = $urlGenerator;
98
-	}
69
+    /**
70
+     * @param IL10N $l
71
+     * @param Defaults $defaults
72
+     * @param IAppManager $appManager
73
+     * @param ISession $session
74
+     * @param IUser|null $currentUser
75
+     * @param IConfig $config
76
+     * @param IGroupManager $groupManager
77
+     * @param IniGetWrapper $iniWrapper
78
+     * @param IURLGenerator $urlGenerator
79
+     */
80
+    public function __construct(IL10N $l,
81
+                                Defaults $defaults,
82
+                                IAppManager $appManager,
83
+                                ISession $session,
84
+                                $currentUser,
85
+                                IConfig $config,
86
+                                IGroupManager $groupManager,
87
+                                IniGetWrapper $iniWrapper,
88
+                                IURLGenerator $urlGenerator) {
89
+        $this->l = $l;
90
+        $this->defaults = $defaults;
91
+        $this->appManager = $appManager;
92
+        $this->session = $session;
93
+        $this->currentUser = $currentUser;
94
+        $this->config = $config;
95
+        $this->groupManager = $groupManager;
96
+        $this->iniWrapper = $iniWrapper;
97
+        $this->urlGenerator = $urlGenerator;
98
+    }
99 99
 
100
-	public function getConfig() {
100
+    public function getConfig() {
101 101
 
102
-		if ($this->currentUser !== null) {
103
-			$uid = $this->currentUser->getUID();
104
-			$userBackend = $this->currentUser->getBackendClassName();
105
-		} else {
106
-			$uid = null;
107
-			$userBackend = '';
108
-		}
102
+        if ($this->currentUser !== null) {
103
+            $uid = $this->currentUser->getUID();
104
+            $userBackend = $this->currentUser->getBackendClassName();
105
+        } else {
106
+            $uid = null;
107
+            $userBackend = '';
108
+        }
109 109
 
110
-		// Get the config
111
-		$apps_paths = [];
110
+        // Get the config
111
+        $apps_paths = [];
112 112
 
113
-		if ($this->currentUser === null) {
114
-			$apps = $this->appManager->getInstalledApps();
115
-		} else {
116
-			$apps = $this->appManager->getEnabledAppsForUser($this->currentUser);
117
-		}
113
+        if ($this->currentUser === null) {
114
+            $apps = $this->appManager->getInstalledApps();
115
+        } else {
116
+            $apps = $this->appManager->getEnabledAppsForUser($this->currentUser);
117
+        }
118 118
 
119
-		foreach($apps as $app) {
120
-			$apps_paths[$app] = \OC_App::getAppWebPath($app);
121
-		}
119
+        foreach($apps as $app) {
120
+            $apps_paths[$app] = \OC_App::getAppWebPath($app);
121
+        }
122 122
 
123 123
 
124
-		$enableLinkPasswordByDefault = $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no');
125
-		$enableLinkPasswordByDefault = ($enableLinkPasswordByDefault === 'yes') ? true : false;
126
-		$defaultExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes';
127
-		$defaultExpireDate = $enforceDefaultExpireDate = null;
128
-		if ($defaultExpireDateEnabled) {
129
-			$defaultExpireDate = (int) $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7');
130
-			$enforceDefaultExpireDate = $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'no') === 'yes';
131
-		}
132
-		$outgoingServer2serverShareEnabled = $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes';
124
+        $enableLinkPasswordByDefault = $this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no');
125
+        $enableLinkPasswordByDefault = ($enableLinkPasswordByDefault === 'yes') ? true : false;
126
+        $defaultExpireDateEnabled = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes';
127
+        $defaultExpireDate = $enforceDefaultExpireDate = null;
128
+        if ($defaultExpireDateEnabled) {
129
+            $defaultExpireDate = (int) $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7');
130
+            $enforceDefaultExpireDate = $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'no') === 'yes';
131
+        }
132
+        $outgoingServer2serverShareEnabled = $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes';
133 133
 
134
-		$countOfDataLocation = 0;
135
-		$dataLocation = str_replace(\OC::$SERVERROOT .'/', '', $this->config->getSystemValue('datadirectory', ''), $countOfDataLocation);
136
-		if($countOfDataLocation !== 1 || !$this->groupManager->isAdmin($uid)) {
137
-			$dataLocation = false;
138
-		}
134
+        $countOfDataLocation = 0;
135
+        $dataLocation = str_replace(\OC::$SERVERROOT .'/', '', $this->config->getSystemValue('datadirectory', ''), $countOfDataLocation);
136
+        if($countOfDataLocation !== 1 || !$this->groupManager->isAdmin($uid)) {
137
+            $dataLocation = false;
138
+        }
139 139
 
140
-		if ($this->currentUser instanceof IUser) {
141
-			$lastConfirmTimestamp = $this->session->get('last-password-confirm');
142
-			if (!is_int($lastConfirmTimestamp)) {
143
-				$lastConfirmTimestamp = 0;
144
-			}
145
-		} else {
146
-			$lastConfirmTimestamp = 0;
147
-		}
140
+        if ($this->currentUser instanceof IUser) {
141
+            $lastConfirmTimestamp = $this->session->get('last-password-confirm');
142
+            if (!is_int($lastConfirmTimestamp)) {
143
+                $lastConfirmTimestamp = 0;
144
+            }
145
+        } else {
146
+            $lastConfirmTimestamp = 0;
147
+        }
148 148
 
149
-		$array = [
150
-			"oc_debug" => $this->config->getSystemValue('debug', false) ? 'true' : 'false',
151
-			"oc_isadmin" => $this->groupManager->isAdmin($uid) ? 'true' : 'false',
152
-			"backendAllowsPasswordConfirmation" => $userBackend === 'user_saml'? 'false' : 'true',
153
-			"oc_dataURL" => is_string($dataLocation) ? "\"".$dataLocation."\"" : 'false',
154
-			"oc_webroot" => "\"".\OC::$WEBROOT."\"",
155
-			"oc_appswebroots" =>  str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution
156
-			"datepickerFormatDate" => json_encode($this->l->l('jsdate', null)),
157
-			'nc_lastLogin' => $lastConfirmTimestamp,
158
-			"dayNames" =>  json_encode([
159
-				(string)$this->l->t('Sunday'),
160
-				(string)$this->l->t('Monday'),
161
-				(string)$this->l->t('Tuesday'),
162
-				(string)$this->l->t('Wednesday'),
163
-				(string)$this->l->t('Thursday'),
164
-				(string)$this->l->t('Friday'),
165
-				(string)$this->l->t('Saturday')
166
-			]),
167
-			"dayNamesShort" =>  json_encode([
168
-				(string)$this->l->t('Sun.'),
169
-				(string)$this->l->t('Mon.'),
170
-				(string)$this->l->t('Tue.'),
171
-				(string)$this->l->t('Wed.'),
172
-				(string)$this->l->t('Thu.'),
173
-				(string)$this->l->t('Fri.'),
174
-				(string)$this->l->t('Sat.')
175
-			]),
176
-			"dayNamesMin" =>  json_encode([
177
-				(string)$this->l->t('Su'),
178
-				(string)$this->l->t('Mo'),
179
-				(string)$this->l->t('Tu'),
180
-				(string)$this->l->t('We'),
181
-				(string)$this->l->t('Th'),
182
-				(string)$this->l->t('Fr'),
183
-				(string)$this->l->t('Sa')
184
-			]),
185
-			"monthNames" => json_encode([
186
-				(string)$this->l->t('January'),
187
-				(string)$this->l->t('February'),
188
-				(string)$this->l->t('March'),
189
-				(string)$this->l->t('April'),
190
-				(string)$this->l->t('May'),
191
-				(string)$this->l->t('June'),
192
-				(string)$this->l->t('July'),
193
-				(string)$this->l->t('August'),
194
-				(string)$this->l->t('September'),
195
-				(string)$this->l->t('October'),
196
-				(string)$this->l->t('November'),
197
-				(string)$this->l->t('December')
198
-			]),
199
-			"monthNamesShort" => json_encode([
200
-				(string)$this->l->t('Jan.'),
201
-				(string)$this->l->t('Feb.'),
202
-				(string)$this->l->t('Mar.'),
203
-				(string)$this->l->t('Apr.'),
204
-				(string)$this->l->t('May.'),
205
-				(string)$this->l->t('Jun.'),
206
-				(string)$this->l->t('Jul.'),
207
-				(string)$this->l->t('Aug.'),
208
-				(string)$this->l->t('Sep.'),
209
-				(string)$this->l->t('Oct.'),
210
-				(string)$this->l->t('Nov.'),
211
-				(string)$this->l->t('Dec.')
212
-			]),
213
-			"firstDay" => json_encode($this->l->l('firstday', null)) ,
214
-			"oc_config" => json_encode([
215
-				'session_lifetime'	=> min($this->config->getSystemValue('session_lifetime', $this->iniWrapper->getNumeric('session.gc_maxlifetime')), $this->iniWrapper->getNumeric('session.gc_maxlifetime')),
216
-				'session_keepalive'	=> $this->config->getSystemValue('session_keepalive', true),
217
-				'version'			=> implode('.', \OCP\Util::getVersion()),
218
-				'versionstring'		=> \OC_Util::getVersionString(),
219
-				'enable_avatars'	=> true, // here for legacy reasons - to not crash existing code that relies on this value
220
-				'lost_password_link'=> $this->config->getSystemValue('lost_password_link', null),
221
-				'modRewriteWorking'	=> ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true'),
222
-				'sharing.maxAutocompleteResults' => intval($this->config->getSystemValue('sharing.maxAutocompleteResults', 0)),
223
-				'sharing.minSearchStringLength' => intval($this->config->getSystemValue('sharing.minSearchStringLength', 0)),
224
-				'blacklist_files_regex' => \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX,
225
-			]),
226
-			"oc_appconfig" => json_encode([
227
-				'core' => [
228
-					'defaultExpireDateEnabled' => $defaultExpireDateEnabled,
229
-					'defaultExpireDate' => $defaultExpireDate,
230
-					'defaultExpireDateEnforced' => $enforceDefaultExpireDate,
231
-					'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(),
232
-					'enableLinkPasswordByDefault' => $enableLinkPasswordByDefault,
233
-					'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(),
234
-					'resharingAllowed' => \OC\Share\Share::isResharingAllowed(),
235
-					'remoteShareAllowed' => $outgoingServer2serverShareEnabled,
236
-					'federatedCloudShareDoc' => $this->urlGenerator->linkToDocs('user-sharing-federated'),
237
-					'allowGroupSharing' => \OC::$server->getShareManager()->allowGroupSharing()
238
-				]
239
-			]),
240
-			"oc_defaults" => json_encode([
241
-				'entity' => $this->defaults->getEntity(),
242
-				'name' => $this->defaults->getName(),
243
-				'title' => $this->defaults->getTitle(),
244
-				'baseUrl' => $this->defaults->getBaseUrl(),
245
-				'syncClientUrl' => $this->defaults->getSyncClientUrl(),
246
-				'docBaseUrl' => $this->defaults->getDocBaseUrl(),
247
-				'docPlaceholderUrl' => $this->defaults->buildDocLinkToKey('PLACEHOLDER'),
248
-				'slogan' => $this->defaults->getSlogan(),
249
-				'logoClaim' => '',
250
-				'shortFooter' => $this->defaults->getShortFooter(),
251
-				'longFooter' => $this->defaults->getLongFooter(),
252
-				'folder' => \OC_Util::getTheme(),
253
-			]),
254
-		];
149
+        $array = [
150
+            "oc_debug" => $this->config->getSystemValue('debug', false) ? 'true' : 'false',
151
+            "oc_isadmin" => $this->groupManager->isAdmin($uid) ? 'true' : 'false',
152
+            "backendAllowsPasswordConfirmation" => $userBackend === 'user_saml'? 'false' : 'true',
153
+            "oc_dataURL" => is_string($dataLocation) ? "\"".$dataLocation."\"" : 'false',
154
+            "oc_webroot" => "\"".\OC::$WEBROOT."\"",
155
+            "oc_appswebroots" =>  str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution
156
+            "datepickerFormatDate" => json_encode($this->l->l('jsdate', null)),
157
+            'nc_lastLogin' => $lastConfirmTimestamp,
158
+            "dayNames" =>  json_encode([
159
+                (string)$this->l->t('Sunday'),
160
+                (string)$this->l->t('Monday'),
161
+                (string)$this->l->t('Tuesday'),
162
+                (string)$this->l->t('Wednesday'),
163
+                (string)$this->l->t('Thursday'),
164
+                (string)$this->l->t('Friday'),
165
+                (string)$this->l->t('Saturday')
166
+            ]),
167
+            "dayNamesShort" =>  json_encode([
168
+                (string)$this->l->t('Sun.'),
169
+                (string)$this->l->t('Mon.'),
170
+                (string)$this->l->t('Tue.'),
171
+                (string)$this->l->t('Wed.'),
172
+                (string)$this->l->t('Thu.'),
173
+                (string)$this->l->t('Fri.'),
174
+                (string)$this->l->t('Sat.')
175
+            ]),
176
+            "dayNamesMin" =>  json_encode([
177
+                (string)$this->l->t('Su'),
178
+                (string)$this->l->t('Mo'),
179
+                (string)$this->l->t('Tu'),
180
+                (string)$this->l->t('We'),
181
+                (string)$this->l->t('Th'),
182
+                (string)$this->l->t('Fr'),
183
+                (string)$this->l->t('Sa')
184
+            ]),
185
+            "monthNames" => json_encode([
186
+                (string)$this->l->t('January'),
187
+                (string)$this->l->t('February'),
188
+                (string)$this->l->t('March'),
189
+                (string)$this->l->t('April'),
190
+                (string)$this->l->t('May'),
191
+                (string)$this->l->t('June'),
192
+                (string)$this->l->t('July'),
193
+                (string)$this->l->t('August'),
194
+                (string)$this->l->t('September'),
195
+                (string)$this->l->t('October'),
196
+                (string)$this->l->t('November'),
197
+                (string)$this->l->t('December')
198
+            ]),
199
+            "monthNamesShort" => json_encode([
200
+                (string)$this->l->t('Jan.'),
201
+                (string)$this->l->t('Feb.'),
202
+                (string)$this->l->t('Mar.'),
203
+                (string)$this->l->t('Apr.'),
204
+                (string)$this->l->t('May.'),
205
+                (string)$this->l->t('Jun.'),
206
+                (string)$this->l->t('Jul.'),
207
+                (string)$this->l->t('Aug.'),
208
+                (string)$this->l->t('Sep.'),
209
+                (string)$this->l->t('Oct.'),
210
+                (string)$this->l->t('Nov.'),
211
+                (string)$this->l->t('Dec.')
212
+            ]),
213
+            "firstDay" => json_encode($this->l->l('firstday', null)) ,
214
+            "oc_config" => json_encode([
215
+                'session_lifetime'	=> min($this->config->getSystemValue('session_lifetime', $this->iniWrapper->getNumeric('session.gc_maxlifetime')), $this->iniWrapper->getNumeric('session.gc_maxlifetime')),
216
+                'session_keepalive'	=> $this->config->getSystemValue('session_keepalive', true),
217
+                'version'			=> implode('.', \OCP\Util::getVersion()),
218
+                'versionstring'		=> \OC_Util::getVersionString(),
219
+                'enable_avatars'	=> true, // here for legacy reasons - to not crash existing code that relies on this value
220
+                'lost_password_link'=> $this->config->getSystemValue('lost_password_link', null),
221
+                'modRewriteWorking'	=> ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true'),
222
+                'sharing.maxAutocompleteResults' => intval($this->config->getSystemValue('sharing.maxAutocompleteResults', 0)),
223
+                'sharing.minSearchStringLength' => intval($this->config->getSystemValue('sharing.minSearchStringLength', 0)),
224
+                'blacklist_files_regex' => \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX,
225
+            ]),
226
+            "oc_appconfig" => json_encode([
227
+                'core' => [
228
+                    'defaultExpireDateEnabled' => $defaultExpireDateEnabled,
229
+                    'defaultExpireDate' => $defaultExpireDate,
230
+                    'defaultExpireDateEnforced' => $enforceDefaultExpireDate,
231
+                    'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(),
232
+                    'enableLinkPasswordByDefault' => $enableLinkPasswordByDefault,
233
+                    'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(),
234
+                    'resharingAllowed' => \OC\Share\Share::isResharingAllowed(),
235
+                    'remoteShareAllowed' => $outgoingServer2serverShareEnabled,
236
+                    'federatedCloudShareDoc' => $this->urlGenerator->linkToDocs('user-sharing-federated'),
237
+                    'allowGroupSharing' => \OC::$server->getShareManager()->allowGroupSharing()
238
+                ]
239
+            ]),
240
+            "oc_defaults" => json_encode([
241
+                'entity' => $this->defaults->getEntity(),
242
+                'name' => $this->defaults->getName(),
243
+                'title' => $this->defaults->getTitle(),
244
+                'baseUrl' => $this->defaults->getBaseUrl(),
245
+                'syncClientUrl' => $this->defaults->getSyncClientUrl(),
246
+                'docBaseUrl' => $this->defaults->getDocBaseUrl(),
247
+                'docPlaceholderUrl' => $this->defaults->buildDocLinkToKey('PLACEHOLDER'),
248
+                'slogan' => $this->defaults->getSlogan(),
249
+                'logoClaim' => '',
250
+                'shortFooter' => $this->defaults->getShortFooter(),
251
+                'longFooter' => $this->defaults->getLongFooter(),
252
+                'folder' => \OC_Util::getTheme(),
253
+            ]),
254
+        ];
255 255
 
256
-		if ($this->currentUser !== null) {
257
-			$array['oc_userconfig'] = json_encode([
258
-				'avatar' => [
259
-					'version' => (int)$this->config->getUserValue($uid, 'avatar', 'version', 0),
260
-				]
261
-			]);
262
-		}
256
+        if ($this->currentUser !== null) {
257
+            $array['oc_userconfig'] = json_encode([
258
+                'avatar' => [
259
+                    'version' => (int)$this->config->getUserValue($uid, 'avatar', 'version', 0),
260
+                ]
261
+            ]);
262
+        }
263 263
 
264
-		// Allow hooks to modify the output values
265
-		\OC_Hook::emit('\OCP\Config', 'js', array('array' => &$array));
264
+        // Allow hooks to modify the output values
265
+        \OC_Hook::emit('\OCP\Config', 'js', array('array' => &$array));
266 266
 
267
-		$result = '';
267
+        $result = '';
268 268
 
269
-		// Echo it
270
-		foreach ($array as  $setting => $value) {
271
-			$result .= 'var '. $setting . '='. $value . ';' . PHP_EOL;
272
-		}
269
+        // Echo it
270
+        foreach ($array as  $setting => $value) {
271
+            $result .= 'var '. $setting . '='. $value . ';' . PHP_EOL;
272
+        }
273 273
 
274
-		return $result;
275
-	}
274
+        return $result;
275
+    }
276 276
 }
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 			$apps = $this->appManager->getEnabledAppsForUser($this->currentUser);
117 117
 		}
118 118
 
119
-		foreach($apps as $app) {
119
+		foreach ($apps as $app) {
120 120
 			$apps_paths[$app] = \OC_App::getAppWebPath($app);
121 121
 		}
122 122
 
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 		$outgoingServer2serverShareEnabled = $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes';
133 133
 
134 134
 		$countOfDataLocation = 0;
135
-		$dataLocation = str_replace(\OC::$SERVERROOT .'/', '', $this->config->getSystemValue('datadirectory', ''), $countOfDataLocation);
136
-		if($countOfDataLocation !== 1 || !$this->groupManager->isAdmin($uid)) {
135
+		$dataLocation = str_replace(\OC::$SERVERROOT.'/', '', $this->config->getSystemValue('datadirectory', ''), $countOfDataLocation);
136
+		if ($countOfDataLocation !== 1 || !$this->groupManager->isAdmin($uid)) {
137 137
 			$dataLocation = false;
138 138
 		}
139 139
 
@@ -149,68 +149,68 @@  discard block
 block discarded – undo
149 149
 		$array = [
150 150
 			"oc_debug" => $this->config->getSystemValue('debug', false) ? 'true' : 'false',
151 151
 			"oc_isadmin" => $this->groupManager->isAdmin($uid) ? 'true' : 'false',
152
-			"backendAllowsPasswordConfirmation" => $userBackend === 'user_saml'? 'false' : 'true',
152
+			"backendAllowsPasswordConfirmation" => $userBackend === 'user_saml' ? 'false' : 'true',
153 153
 			"oc_dataURL" => is_string($dataLocation) ? "\"".$dataLocation."\"" : 'false',
154 154
 			"oc_webroot" => "\"".\OC::$WEBROOT."\"",
155 155
 			"oc_appswebroots" =>  str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution
156 156
 			"datepickerFormatDate" => json_encode($this->l->l('jsdate', null)),
157 157
 			'nc_lastLogin' => $lastConfirmTimestamp,
158 158
 			"dayNames" =>  json_encode([
159
-				(string)$this->l->t('Sunday'),
160
-				(string)$this->l->t('Monday'),
161
-				(string)$this->l->t('Tuesday'),
162
-				(string)$this->l->t('Wednesday'),
163
-				(string)$this->l->t('Thursday'),
164
-				(string)$this->l->t('Friday'),
165
-				(string)$this->l->t('Saturday')
159
+				(string) $this->l->t('Sunday'),
160
+				(string) $this->l->t('Monday'),
161
+				(string) $this->l->t('Tuesday'),
162
+				(string) $this->l->t('Wednesday'),
163
+				(string) $this->l->t('Thursday'),
164
+				(string) $this->l->t('Friday'),
165
+				(string) $this->l->t('Saturday')
166 166
 			]),
167 167
 			"dayNamesShort" =>  json_encode([
168
-				(string)$this->l->t('Sun.'),
169
-				(string)$this->l->t('Mon.'),
170
-				(string)$this->l->t('Tue.'),
171
-				(string)$this->l->t('Wed.'),
172
-				(string)$this->l->t('Thu.'),
173
-				(string)$this->l->t('Fri.'),
174
-				(string)$this->l->t('Sat.')
168
+				(string) $this->l->t('Sun.'),
169
+				(string) $this->l->t('Mon.'),
170
+				(string) $this->l->t('Tue.'),
171
+				(string) $this->l->t('Wed.'),
172
+				(string) $this->l->t('Thu.'),
173
+				(string) $this->l->t('Fri.'),
174
+				(string) $this->l->t('Sat.')
175 175
 			]),
176 176
 			"dayNamesMin" =>  json_encode([
177
-				(string)$this->l->t('Su'),
178
-				(string)$this->l->t('Mo'),
179
-				(string)$this->l->t('Tu'),
180
-				(string)$this->l->t('We'),
181
-				(string)$this->l->t('Th'),
182
-				(string)$this->l->t('Fr'),
183
-				(string)$this->l->t('Sa')
177
+				(string) $this->l->t('Su'),
178
+				(string) $this->l->t('Mo'),
179
+				(string) $this->l->t('Tu'),
180
+				(string) $this->l->t('We'),
181
+				(string) $this->l->t('Th'),
182
+				(string) $this->l->t('Fr'),
183
+				(string) $this->l->t('Sa')
184 184
 			]),
185 185
 			"monthNames" => json_encode([
186
-				(string)$this->l->t('January'),
187
-				(string)$this->l->t('February'),
188
-				(string)$this->l->t('March'),
189
-				(string)$this->l->t('April'),
190
-				(string)$this->l->t('May'),
191
-				(string)$this->l->t('June'),
192
-				(string)$this->l->t('July'),
193
-				(string)$this->l->t('August'),
194
-				(string)$this->l->t('September'),
195
-				(string)$this->l->t('October'),
196
-				(string)$this->l->t('November'),
197
-				(string)$this->l->t('December')
186
+				(string) $this->l->t('January'),
187
+				(string) $this->l->t('February'),
188
+				(string) $this->l->t('March'),
189
+				(string) $this->l->t('April'),
190
+				(string) $this->l->t('May'),
191
+				(string) $this->l->t('June'),
192
+				(string) $this->l->t('July'),
193
+				(string) $this->l->t('August'),
194
+				(string) $this->l->t('September'),
195
+				(string) $this->l->t('October'),
196
+				(string) $this->l->t('November'),
197
+				(string) $this->l->t('December')
198 198
 			]),
199 199
 			"monthNamesShort" => json_encode([
200
-				(string)$this->l->t('Jan.'),
201
-				(string)$this->l->t('Feb.'),
202
-				(string)$this->l->t('Mar.'),
203
-				(string)$this->l->t('Apr.'),
204
-				(string)$this->l->t('May.'),
205
-				(string)$this->l->t('Jun.'),
206
-				(string)$this->l->t('Jul.'),
207
-				(string)$this->l->t('Aug.'),
208
-				(string)$this->l->t('Sep.'),
209
-				(string)$this->l->t('Oct.'),
210
-				(string)$this->l->t('Nov.'),
211
-				(string)$this->l->t('Dec.')
200
+				(string) $this->l->t('Jan.'),
201
+				(string) $this->l->t('Feb.'),
202
+				(string) $this->l->t('Mar.'),
203
+				(string) $this->l->t('Apr.'),
204
+				(string) $this->l->t('May.'),
205
+				(string) $this->l->t('Jun.'),
206
+				(string) $this->l->t('Jul.'),
207
+				(string) $this->l->t('Aug.'),
208
+				(string) $this->l->t('Sep.'),
209
+				(string) $this->l->t('Oct.'),
210
+				(string) $this->l->t('Nov.'),
211
+				(string) $this->l->t('Dec.')
212 212
 			]),
213
-			"firstDay" => json_encode($this->l->l('firstday', null)) ,
213
+			"firstDay" => json_encode($this->l->l('firstday', null)),
214 214
 			"oc_config" => json_encode([
215 215
 				'session_lifetime'	=> min($this->config->getSystemValue('session_lifetime', $this->iniWrapper->getNumeric('session.gc_maxlifetime')), $this->iniWrapper->getNumeric('session.gc_maxlifetime')),
216 216
 				'session_keepalive'	=> $this->config->getSystemValue('session_keepalive', true),
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 		if ($this->currentUser !== null) {
257 257
 			$array['oc_userconfig'] = json_encode([
258 258
 				'avatar' => [
259
-					'version' => (int)$this->config->getUserValue($uid, 'avatar', 'version', 0),
259
+					'version' => (int) $this->config->getUserValue($uid, 'avatar', 'version', 0),
260 260
 				]
261 261
 			]);
262 262
 		}
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 
269 269
 		// Echo it
270 270
 		foreach ($array as  $setting => $value) {
271
-			$result .= 'var '. $setting . '='. $value . ';' . PHP_EOL;
271
+			$result .= 'var '.$setting.'='.$value.';'.PHP_EOL;
272 272
 		}
273 273
 
274 274
 		return $result;
Please login to merge, or discard this patch.