Completed
Pull Request — master (#1537)
by José
29:27
created
plugin/google_maps/src/GoogleMapsPluginPlugin.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
     /**
45 45
      * Install the plugin
46
-     * @return void
46
+     * @return boolean
47 47
      */
48 48
     public function install()
49 49
     {
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
     /**
54 54
      * Uninstall the plugin
55
-     * @return void
55
+     * @return boolean
56 56
      */
57 57
     public function uninstall()
58 58
     {
Please login to merge, or discard this patch.
plugin/google_maps/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,6 +5,6 @@
 block discarded – undo
5 5
  * @author Imanol Losada Oriol <[email protected]>
6 6
  * @package chamilo.plugin.skype
7 7
  */
8
-require_once __DIR__ . '/config.php';
8
+require_once __DIR__.'/config.php';
9 9
 
10 10
 Skype::create()->install();
Please login to merge, or discard this patch.
plugin/google_maps/install.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,6 +5,6 @@
 block discarded – undo
5 5
  * @author Imanol Losada Oriol <[email protected]>
6 6
  * @package chamilo.plugin.skype
7 7
  */
8
-require_once __DIR__ . '/config.php';
8
+require_once __DIR__.'/config.php';
9 9
 
10 10
 Skype::create()->install();
Please login to merge, or discard this patch.
plugin/google_maps/uninstall.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,6 +5,6 @@
 block discarded – undo
5 5
  * @author Imanol Losada Oriol <[email protected]>
6 6
  * @package chamilo.plugin.skype
7 7
  */
8
-require_once __DIR__ . '/config.php';
8
+require_once __DIR__.'/config.php';
9 9
 
10 10
 Skype::create()->install();
Please login to merge, or discard this patch.
main/admin/user_edit.php 2 patches
Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 $geolocalization = $gMapsPlugin->get('enable_api') === 'true';
73 73
 
74 74
 if ($geolocalization) {
75
-	$gmapsApiKey = $gMapsPlugin->get('api_key');
76
-	$htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='. $gmapsApiKey . '" ></script>';
75
+    $gmapsApiKey = $gMapsPlugin->get('api_key');
76
+    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='. $gmapsApiKey . '" ></script>';
77 77
 }
78 78
 
79 79
 $htmlHeadXtra[] = api_get_css_asset('cropper/dist/cropper.min.css');
@@ -117,27 +117,27 @@  discard block
 block discarded – undo
117 117
 $form->addElement('hidden', 'user_id', $user_id);
118 118
 
119 119
 if (api_is_western_name_order()) {
120
-	// Firstname
121
-	$form->addElement('text', 'firstname', get_lang('FirstName'));
122
-	$form->applyFilter('firstname', 'html_filter');
123
-	$form->applyFilter('firstname', 'trim');
124
-	$form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
125
-	// Lastname
126
-	$form->addElement('text', 'lastname', get_lang('LastName'));
127
-	$form->applyFilter('lastname', 'html_filter');
128
-	$form->applyFilter('lastname', 'trim');
129
-	$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
120
+    // Firstname
121
+    $form->addElement('text', 'firstname', get_lang('FirstName'));
122
+    $form->applyFilter('firstname', 'html_filter');
123
+    $form->applyFilter('firstname', 'trim');
124
+    $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
125
+    // Lastname
126
+    $form->addElement('text', 'lastname', get_lang('LastName'));
127
+    $form->applyFilter('lastname', 'html_filter');
128
+    $form->applyFilter('lastname', 'trim');
129
+    $form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
130 130
 } else {
131
-	// Lastname
132
-	$form->addElement('text', 'lastname', get_lang('LastName'));
133
-	$form->applyFilter('lastname', 'html_filter');
134
-	$form->applyFilter('lastname', 'trim');
135
-	$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
136
-	// Firstname
137
-	$form->addElement('text', 'firstname', get_lang('FirstName'));
138
-	$form->applyFilter('firstname', 'html_filter');
139
-	$form->applyFilter('firstname', 'trim');
140
-	$form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
131
+    // Lastname
132
+    $form->addElement('text', 'lastname', get_lang('LastName'));
133
+    $form->applyFilter('lastname', 'html_filter');
134
+    $form->applyFilter('lastname', 'trim');
135
+    $form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
136
+    // Firstname
137
+    $form->addElement('text', 'firstname', get_lang('FirstName'));
138
+    $form->applyFilter('firstname', 'html_filter');
139
+    $form->applyFilter('firstname', 'trim');
140
+    $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
141 141
 }
142 142
 
143 143
 // Official code
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
 // OpenID
161 161
 if (api_get_setting('openid_authentication') == 'true') {
162
-	$form->addElement('text', 'openid', get_lang('OpenIDURL'));
162
+    $form->addElement('text', 'openid', get_lang('OpenIDURL'));
163 163
 }
164 164
 
165 165
 // Phone
@@ -174,18 +174,18 @@  discard block
 block discarded – undo
174 174
 $allowed_picture_types = api_get_supported_image_extensions(false);
175 175
 
176 176
 $form->addRule(
177
-	'picture',
178
-	get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')',
179
-	'filetype',
180
-	$allowed_picture_types
177
+    'picture',
178
+    get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')',
179
+    'filetype',
180
+    $allowed_picture_types
181 181
 );
182 182
 if (strlen($user_data['picture_uri']) > 0) {
183
-	$form->addElement('checkbox', 'delete_picture', '', get_lang('DelImage'));
183
+    $form->addElement('checkbox', 'delete_picture', '', get_lang('DelImage'));
184 184
 }
185 185
 
186 186
 // Username
187 187
 if (api_get_setting('login_is_email') != 'true') {
188
-	$form->addElement('text', 'username', get_lang('LoginName'), array('maxlength' => USERNAME_MAX_LENGTH));
188
+    $form->addElement('text', 'username', get_lang('LoginName'), array('maxlength' => USERNAME_MAX_LENGTH));
189 189
     $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
190 190
     $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
191 191
     $form->addRule('username', get_lang('OnlyLettersAndNumbersAllowed'), 'username');
@@ -257,15 +257,15 @@  discard block
 block discarded – undo
257 257
 
258 258
 // Platform admin
259 259
 if (api_is_platform_admin()) {
260
-	$group = array();
261
-	$group[] =$form->createElement('radio', 'platform_admin', null, get_lang('Yes'), 1);
262
-	$group[] =$form->createElement('radio', 'platform_admin', null, get_lang('No'), 0);
260
+    $group = array();
261
+    $group[] =$form->createElement('radio', 'platform_admin', null, get_lang('Yes'), 1);
262
+    $group[] =$form->createElement('radio', 'platform_admin', null, get_lang('No'), 0);
263 263
 
264
-	$user_data['status'] == 1 ? $display = 'block':$display = 'none';
264
+    $user_data['status'] == 1 ? $display = 'block':$display = 'none';
265 265
 
266
-	$form->addElement('html', '<div id="id_platform_admin" style="display:'.$display.'">');
267
-	$form->addGroup($group, 'admin', get_lang('PlatformAdmin'), null, false);
268
-	$form->addElement('html', '</div>');
266
+    $form->addElement('html', '<div id="id_platform_admin" style="display:'.$display.'">');
267
+    $form->addGroup($group, 'admin', get_lang('PlatformAdmin'), null, false);
268
+    $form->addElement('html', '</div>');
269 269
 }
270 270
 
271 271
 //Language
@@ -283,16 +283,16 @@  discard block
 block discarded – undo
283 283
 $form->addElement('label', get_lang('RegistrationDate'), $date);
284 284
 
285 285
 if (!$user_data['platform_admin']) {
286
-	// Expiration Date
287
-	$form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
288
-	$group = array ();
289
-	$group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('Enabled'), 1);
290
-	$group[] = $form->createElement('DateTimePicker', 'expiration_date', null, array('onchange' => 'javascript: enable_expiration_date();'));
291
-	$form->addGroup($group, 'max_member_group', null, null, false);
292
-
293
-	// Active account or inactive account
294
-	$form->addElement('radio', 'active', get_lang('ActiveAccount'), get_lang('Active'), 1);
295
-	$form->addElement('radio', 'active', '', get_lang('Inactive'), 0);
286
+    // Expiration Date
287
+    $form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
288
+    $group = array ();
289
+    $group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('Enabled'), 1);
290
+    $group[] = $form->createElement('DateTimePicker', 'expiration_date', null, array('onchange' => 'javascript: enable_expiration_date();'));
291
+    $form->addGroup($group, 'max_member_group', null, null, false);
292
+
293
+    // Active account or inactive account
294
+    $form->addElement('radio', 'active', get_lang('ActiveAccount'), get_lang('Active'), 1);
295
+    $form->addElement('radio', 'active', '', get_lang('Inactive'), 0);
296 296
 }
297 297
 $studentBossList = UserManager::getStudentBossList($user_data['user_id']);
298 298
 
@@ -334,18 +334,18 @@  discard block
 block discarded – undo
334 334
 $expiration_date = $user_data['expiration_date'];
335 335
 
336 336
 if (empty($expiration_date)) {
337
-	$user_data['radio_expiration_date'] = 0;
338
-	$user_data['expiration_date'] = api_get_local_time();
337
+    $user_data['radio_expiration_date'] = 0;
338
+    $user_data['expiration_date'] = api_get_local_time();
339 339
 } else {
340
-	$user_data['radio_expiration_date'] = 1;
341
-	$user_data['expiration_date'] = api_get_local_time($expiration_date);
340
+    $user_data['radio_expiration_date'] = 1;
341
+    $user_data['expiration_date'] = api_get_local_time($expiration_date);
342 342
 }
343 343
 $form->setDefaults($user_data);
344 344
 
345 345
 $error_drh = false;
346 346
 // Validate form
347 347
 if ($form->validate()) {
348
-	$user = $form->getSubmitValues(1);
348
+    $user = $form->getSubmitValues(1);
349 349
     $reset_password = intval($user['reset_password']);
350 350
     if ($reset_password == 2 && empty($user['password'])) {
351 351
         Display::addFlash(Display::return_message(get_lang('PasswordIsTooShort')));
@@ -353,48 +353,48 @@  discard block
 block discarded – undo
353 353
         exit();
354 354
     }
355 355
 
356
-	$is_user_subscribed_in_course = CourseManager::is_user_subscribed_in_course($user['user_id']);
356
+    $is_user_subscribed_in_course = CourseManager::is_user_subscribed_in_course($user['user_id']);
357 357
 
358
-	if ($user['status'] == DRH && $is_user_subscribed_in_course) {
359
-		$error_drh = true;
360
-	} else {
361
-		$picture_element = $form->getElement('picture');
362
-		$picture = $picture_element->getValue();
358
+    if ($user['status'] == DRH && $is_user_subscribed_in_course) {
359
+        $error_drh = true;
360
+    } else {
361
+        $picture_element = $form->getElement('picture');
362
+        $picture = $picture_element->getValue();
363 363
 
364
-		$picture_uri = $user_data['picture_uri'];
365
-		if (isset($user['delete_picture']) && $user['delete_picture']) {
366
-			$picture_uri = UserManager::delete_user_picture($user_id);
367
-		} elseif (!empty($picture['name'])) {
364
+        $picture_uri = $user_data['picture_uri'];
365
+        if (isset($user['delete_picture']) && $user['delete_picture']) {
366
+            $picture_uri = UserManager::delete_user_picture($user_id);
367
+        } elseif (!empty($picture['name'])) {
368 368
             $picture_uri = UserManager::update_user_picture(
369 369
                 $user_id,
370 370
                 $_FILES['picture']['name'],
371 371
                 $_FILES['picture']['tmp_name'],
372 372
                 $user['picture_crop_result']
373 373
             );
374
-		}
374
+        }
375 375
 
376
-		$lastname = $user['lastname'];
377
-		$firstname = $user['firstname'];
376
+        $lastname = $user['lastname'];
377
+        $firstname = $user['firstname'];
378 378
         $password = $user['password'];
379 379
         $auth_source = isset($user['auth_source']) ? $user['auth_source'] : $userInfo['auth_source'];
380
-		$official_code = $user['official_code'];
381
-		$email = $user['email'];
382
-		$phone = $user['phone'];
383
-		$username = isset($user['username']) ? $user['username'] : $userInfo['username'];
384
-		$status = intval($user['status']);
385
-		$platform_admin = intval($user['platform_admin']);
386
-		$send_mail = intval($user['send_mail']);
387
-		$reset_password = intval($user['reset_password']);
388
-		$hr_dept_id = isset($user['hr_dept_id']) ? intval($user['hr_dept_id']) : null;
389
-		$language = $user['language'];
390
-
391
-		if ($user['radio_expiration_date'] == '1' && !$user_data['platform_admin']) {
380
+        $official_code = $user['official_code'];
381
+        $email = $user['email'];
382
+        $phone = $user['phone'];
383
+        $username = isset($user['username']) ? $user['username'] : $userInfo['username'];
384
+        $status = intval($user['status']);
385
+        $platform_admin = intval($user['platform_admin']);
386
+        $send_mail = intval($user['send_mail']);
387
+        $reset_password = intval($user['reset_password']);
388
+        $hr_dept_id = isset($user['hr_dept_id']) ? intval($user['hr_dept_id']) : null;
389
+        $language = $user['language'];
390
+
391
+        if ($user['radio_expiration_date'] == '1' && !$user_data['platform_admin']) {
392 392
             $expiration_date = $user['expiration_date'];
393
-		} else {
394
-			$expiration_date = null;
395
-		}
393
+        } else {
394
+            $expiration_date = null;
395
+        }
396 396
 
397
-		$active = $user_data['platform_admin'] ? 1 : intval($user['active']);
397
+        $active = $user_data['platform_admin'] ? 1 : intval($user['active']);
398 398
 
399 399
         //If the user is set to admin the status will be overwrite by COURSEMANAGER = 1
400 400
         if ($platform_admin == 1) {
@@ -426,40 +426,40 @@  discard block
 block discarded – undo
426 426
             null,
427 427
             $send_mail,
428 428
             $reset_password,
429
-			$user['address']
429
+            $user['address']
430 430
         );
431 431
 
432 432
         if (isset($user['student_boss'])) {
433 433
             UserManager::subscribeUserToBossList($user_id, $user['student_boss']);
434 434
         }
435 435
 
436
-		if (api_get_setting('openid_authentication') == 'true' && !empty($user['openid'])) {
437
-			$up = UserManager::update_openid($user_id, $user['openid']);
438
-		}
436
+        if (api_get_setting('openid_authentication') == 'true' && !empty($user['openid'])) {
437
+            $up = UserManager::update_openid($user_id, $user['openid']);
438
+        }
439 439
         $currentUserId = api_get_user_id();
440 440
 
441 441
         $userObj = api_get_user_entity($user_id);
442 442
 
443 443
         UserManager::add_user_as_admin($userObj);
444 444
 
445
-		if ($user_id != $currentUserId) {
446
-			if ($platform_admin == 1) {
447
-				$userObj = api_get_user_entity($user_id);
445
+        if ($user_id != $currentUserId) {
446
+            if ($platform_admin == 1) {
447
+                $userObj = api_get_user_entity($user_id);
448 448
                 UserManager::add_user_as_admin($userObj);
449
-			} else {
449
+            } else {
450 450
                 UserManager::remove_user_admin($user_id);
451
-			}
452
-		}
451
+            }
452
+        }
453 453
 
454 454
         $extraFieldValue = new ExtraFieldValue('user');
455 455
         $extraFieldValue->saveFieldValues($user);
456 456
 
457
-		$tok = Security::get_token();
457
+        $tok = Security::get_token();
458 458
 
459 459
         Display::addFlash(Display::return_message(get_lang('UserUpdated')));
460
-		header('Location: user_list.php?sec_token='.$tok);
461
-		exit();
462
-	}
460
+        header('Location: user_list.php?sec_token='.$tok);
461
+        exit();
462
+    }
463 463
 }
464 464
 
465 465
 if ($error_drh) {
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 if ($geolocalization) {
75 75
 	$gmapsApiKey = $gMapsPlugin->get('api_key');
76
-	$htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='. $gmapsApiKey . '" ></script>';
76
+	$htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='.$gmapsApiKey.'" ></script>';
77 77
 }
78 78
 
79 79
 $htmlHeadXtra[] = api_get_css_asset('cropper/dist/cropper.min.css');
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 }
154 154
 
155 155
 if (api_get_setting('login_is_email') == 'true') {
156
-    $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
156
+    $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
157 157
     $form->addRule('email', get_lang('UserTaken'), 'username_available', $user_data['username']);
158 158
 }
159 159
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 if (api_get_setting('login_is_email') != 'true') {
188 188
 	$form->addElement('text', 'username', get_lang('LoginName'), array('maxlength' => USERNAME_MAX_LENGTH));
189 189
     $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
190
-    $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
190
+    $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
191 191
     $form->addRule('username', get_lang('OnlyLettersAndNumbersAllowed'), 'username');
192 192
     $form->addRule('username', get_lang('UserTaken'), 'username_available', $user_data['username']);
193 193
 }
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 }
225 225
 $form->addElement('radio', 'reset_password', null, get_lang('AutoGeneratePassword'), 1);
226 226
 $group = array();
227
-$group[] =$form->createElement('radio', 'reset_password', null, get_lang('EnterPassword'), 2);
227
+$group[] = $form->createElement('radio', 'reset_password', null, get_lang('EnterPassword'), 2);
228 228
 $group[] = $form->createElement(
229 229
     'password',
230 230
     'password',
@@ -258,10 +258,10 @@  discard block
 block discarded – undo
258 258
 // Platform admin
259 259
 if (api_is_platform_admin()) {
260 260
 	$group = array();
261
-	$group[] =$form->createElement('radio', 'platform_admin', null, get_lang('Yes'), 1);
262
-	$group[] =$form->createElement('radio', 'platform_admin', null, get_lang('No'), 0);
261
+	$group[] = $form->createElement('radio', 'platform_admin', null, get_lang('Yes'), 1);
262
+	$group[] = $form->createElement('radio', 'platform_admin', null, get_lang('No'), 0);
263 263
 
264
-	$user_data['status'] == 1 ? $display = 'block':$display = 'none';
264
+	$user_data['status'] == 1 ? $display = 'block' : $display = 'none';
265 265
 
266 266
 	$form->addElement('html', '<div id="id_platform_admin" style="display:'.$display.'">');
267 267
 	$form->addGroup($group, 'admin', get_lang('PlatformAdmin'), null, false);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 if (!$user_data['platform_admin']) {
286 286
 	// Expiration Date
287 287
 	$form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
288
-	$group = array ();
288
+	$group = array();
289 289
 	$group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('Enabled'), 1);
290 290
 	$group[] = $form->createElement('DateTimePicker', 'expiration_date', null, array('onchange' => 'javascript: enable_expiration_date();'));
291 291
 	$form->addGroup($group, 'max_member_group', null, null, false);
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 if ($studentBoss) {
304 304
     foreach ($studentBoss as $bossId => $userData) {
305 305
         $bossInfo = api_get_user_info($userData['user_id']);
306
-        $studentBossToSelect[$bossInfo['user_id']] =  $bossInfo['complete_name_with_username'];
306
+        $studentBossToSelect[$bossInfo['user_id']] = $bossInfo['complete_name_with_username'];
307 307
     }
308 308
 }
309 309
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 $jquery_ready_content = $returnParams['jquery_ready_content'];
321 321
 
322 322
 // the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
323
-$htmlHeadXtra[] ='<script>
323
+$htmlHeadXtra[] = '<script>
324 324
 $(document).ready(function(){
325 325
 	'.$jquery_ready_content.'
326 326
 });
Please login to merge, or discard this patch.
main/auth/profile.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
 if ($geolocalization) {
35 35
     $gmapsApiKey = $gMapsPlugin->get('api_key');
36
-    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='. $gmapsApiKey . '" ></script>';
36
+    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='.$gmapsApiKey.'" ></script>';
37 37
 }
38 38
 
39 39
 $htmlHeadXtra[] = api_get_password_checker_js('#username', '#password1');
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
119 119
 if (api_is_western_name_order()) {
120 120
     //    FIRST NAME and LAST NAME
121 121
     $form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40));
122
-    $form->addElement('text', 'lastname',  get_lang('LastName'),  array('size' => 40));
122
+    $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40));
123 123
 } else {
124 124
     //    LAST NAME and FIRST NAME
125
-    $form->addElement('text', 'lastname',  get_lang('LastName'),  array('size' => 40));
125
+    $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40));
126 126
     $form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40));
127 127
 }
128 128
 if (api_get_setting('profile', 'name') !== 'true') {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 $form->applyFilter(array('lastname', 'firstname'), 'stripslashes');
132 132
 $form->applyFilter(array('lastname', 'firstname'), 'trim');
133 133
 $form->applyFilter(array('lastname', 'firstname'), 'html_filter');
134
-$form->addRule('lastname' , get_lang('ThisFieldIsRequired'), 'required');
134
+$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
135 135
 $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
136 136
 
137 137
 //    USERNAME
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     $form->freeze('email');
177 177
 }
178 178
 
179
-if (api_get_setting('registration', 'email') == 'true' &&  api_get_setting('profile', 'email') == 'true') {
179
+if (api_get_setting('registration', 'email') == 'true' && api_get_setting('profile', 'email') == 'true') {
180 180
     $form->applyFilter('email', 'stripslashes');
181 181
     $form->applyFilter('email', 'trim');
182 182
     $form->addRule('email', get_lang('ThisFieldIsRequired'), 'required');
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 
329 329
 // the $jquery_ready_content variable collects all functions that
330 330
 // will be load in the $(document).ready javascript function
331
-$htmlHeadXtra[] ='<script>
331
+$htmlHeadXtra[] = '<script>
332 332
 $(document).ready(function(){
333 333
     '.$jquery_ready_content.'
334 334
 });
Please login to merge, or discard this patch.
main/auth/inscription.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
 if ($geolocalization) {
37 37
     $gmapsApiKey = $gMapsPlugin->get('api_key');
38
-    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='. $gmapsApiKey . '" ></script>';
38
+    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='.$gmapsApiKey.'" ></script>';
39 39
 }
40 40
 
41 41
 $htmlHeadXtra[] = api_get_password_checker_js('#username', '#pass1');
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         if (api_get_setting('registration', 'email') != 'true') {
97 97
             $form->addRule('email', get_lang('ThisFieldIsRequired'), 'required');
98 98
         }
99
-        $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
99
+        $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
100 100
         $form->addRule('email', get_lang('UserTaken'), 'username_available');
101 101
     }
102 102
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         );
138 138
         $form->applyFilter('username', 'trim');
139 139
         $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
140
-        $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
140
+        $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
141 141
         $form->addRule('username', get_lang('UsernameWrong'), 'username');
142 142
         $form->addRule('username', get_lang('UserTaken'), 'username_available');
143 143
     }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     if (CHECK_PASS_EASY_TO_FIND) {
169 169
         $form->addRule(
170 170
             'pass1',
171
-            get_lang('PassTooEasy') . ': ' . api_generate_password(),
171
+            get_lang('PassTooEasy').': '.api_generate_password(),
172 172
             'callback',
173 173
             'api_check_password'
174 174
         );
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             )
241 241
         );
242 242
 
243
-        $captcha_question =  $form->addElement('CAPTCHA_Image', 'captcha_question', '', $options);
243
+        $captcha_question = $form->addElement('CAPTCHA_Image', 'captcha_question', '', $options);
244 244
         $form->addElement('static', null, null, get_lang('ClickOnTheImageForANewOne'));
245 245
 
246 246
         $form->addElement('text', 'captcha', get_lang('EnterTheLettersYouSee'), array('size' => 40));
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
         }
384 384
     }
385 385
 
386
-    $tool_name = get_lang('Registration', null, (!empty($_POST['language'])?$_POST['language']: $_user['language']));
386
+    $tool_name = get_lang('Registration', null, (!empty($_POST['language']) ? $_POST['language'] : $_user['language']));
387 387
 
388 388
     if (api_get_setting('allow_terms_conditions') === 'true' && $user_already_registered_show_terms) {
389 389
         $tool_name = get_lang('TermsAndConditions');
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
     }
405 405
 
406 406
     if (file_exists($home.'register_top_'.$user_selected_language.'.html')) {
407
-        $home_top_temp = @(string)file_get_contents($home.'register_top_'.$user_selected_language.'.html');
407
+        $home_top_temp = @(string) file_get_contents($home.'register_top_'.$user_selected_language.'.html');
408 408
         $open = str_replace('{rel_path}', api_get_path(REL_PATH), $home_top_temp);
409 409
         $open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
410 410
         if (!empty($open)) {
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
         if (api_get_setting('show_terms_if_profile_completed') === 'true') {
435 435
             $userInfo = api_get_user_info();
436 436
             if ($userInfo && $userInfo['status'] != ANONYMOUS) {
437
-                if ((int)$userInfo['profile_completed'] !== 1) {
437
+                if ((int) $userInfo['profile_completed'] !== 1) {
438 438
                     api_not_allowed(true);
439 439
                 }
440 440
             }
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
                 Database::query($sql);
648 648
 
649 649
                 // 2. Send mail to all platform admin
650
-                $emailsubject  = get_lang('ApprovalForNewAccount', null, $values['language']).': '.$values['username'];
650
+                $emailsubject = get_lang('ApprovalForNewAccount', null, $values['language']).': '.$values['username'];
651 651
                 $emailbody = get_lang('ApprovalForNewAccount', null, $values['language'])."\n";
652 652
                 $emailbody .= get_lang('UserName', null, $values['language']).': '.$values['username']."\n";
653 653
 
@@ -787,14 +787,14 @@  discard block
 block discarded – undo
787 787
         }
788 788
     } else {
789 789
         if (!empty($values['email'])) {
790
-            $text_after_registration.= '<p>'.get_lang('MailHasBeenSent', null, $_user['language']).'.</p>';
790
+            $text_after_registration .= '<p>'.get_lang('MailHasBeenSent', null, $_user['language']).'.</p>';
791 791
         }
792 792
 
793 793
         if ($is_allowedCreateCourse) {
794 794
             if ($usersCanCreateCourse) {
795
-                $form_data['message'] = '<p>'. get_lang('NowGoCreateYourCourse', null, $_user['language']). "</p>";
795
+                $form_data['message'] = '<p>'.get_lang('NowGoCreateYourCourse', null, $_user['language'])."</p>";
796 796
             }
797
-            $form_data['action']  = api_get_path(WEB_CODE_PATH).'create_course/add_course.php';
797
+            $form_data['action'] = api_get_path(WEB_CODE_PATH).'create_course/add_course.php';
798 798
 
799 799
             if (api_get_setting('course_validation') === 'true') {
800 800
                 $form_data['button'] = Display::button(
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
         } else {
818 818
             if (api_get_setting('allow_students_to_browse_courses') == 'true') {
819 819
                 $form_data['action'] = 'courses.php?action=subscribe';
820
-                $form_data['message'] = '<p>'. get_lang('NowGoChooseYourCourses', null, $_user['language']). ".</p>";
820
+                $form_data['message'] = '<p>'.get_lang('NowGoChooseYourCourses', null, $_user['language']).".</p>";
821 821
             } else {
822 822
                 $form_data['action'] = api_get_path(WEB_PATH).'user_portal.php';
823 823
             }
Please login to merge, or discard this patch.