Completed
Push — master ( 565c08...93d030 )
by José
125:33 queued 71:22
created
plugin/vchamilo/lib/Virtual.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
     }
143 143
 
144 144
     /**
145
-    * provides a side connection to a vchamilo database
146
-    * @param array $_configuration
145
+     * provides a side connection to a vchamilo database
146
+     * @param array $_configuration
147 147
      *
148
-    * @return \Doctrine\DBAL\Driver\Connection
149
-    */
148
+     * @return \Doctrine\DBAL\Driver\Connection
149
+     */
150 150
     public static function bootConnection(&$_configuration)
151 151
     {
152 152
         $dbParams = array(
@@ -254,10 +254,10 @@  discard block
 block discarded – undo
254 254
     }
255 255
 
256 256
     /**
257
-    * drop a vchamilo instance databases using the physical connection
258
-    * @param stdClass $params
259
-    * return an array of errors or false if ok
260
-    */
257
+     * drop a vchamilo instance databases using the physical connection
258
+     * @param stdClass $params
259
+     * return an array of errors or false if ok
260
+     */
261 261
     public static function dropDatabase($params)
262 262
     {
263 263
         $params = clone $params;
@@ -332,10 +332,10 @@  discard block
 block discarded – undo
332 332
     }
333 333
 
334 334
     /**
335
-    * get a proper SQLdump command
336
-    * @param object $vchamilodata the complete new host information
337
-    * @return string the shell command
338
-    */
335
+     * get a proper SQLdump command
336
+     * @param object $vchamilodata the complete new host information
337
+     * @return string the shell command
338
+     */
339 339
     public static function getDatabaseDumpCmd($vchamilodata)
340 340
     {
341 341
         $pgm = self::getConfig('vchamilo', 'mysql_cmd');
@@ -492,8 +492,8 @@  discard block
 block discarded – undo
492 492
     }
493 493
 
494 494
     /**
495
-    * read manifest values in vchamilo template.
496
-    */
495
+     * read manifest values in vchamilo template.
496
+     */
497 497
     public static function getVmanifest($version)
498 498
     {
499 499
         $file = api_get_path(SYS_PATH).'/plugin/vchamilo/templates/'.$version.'/manifest.php';
@@ -512,8 +512,8 @@  discard block
 block discarded – undo
512 512
     }
513 513
 
514 514
     /**
515
-    * make a fake vchamilo that represents the current host
516
-    */
515
+     * make a fake vchamilo that represents the current host
516
+     */
517 517
     public static function makeThis()
518 518
     {
519 519
         global $_configuration;
@@ -577,10 +577,10 @@  discard block
 block discarded – undo
577 577
     }
578 578
 
579 579
     /**
580
-    * this function set will map standard moodle API calls to chamilo
581
-    * internal primitives. This avoids too many changes to do in imported
582
-    * code
583
-    */
580
+     * this function set will map standard moodle API calls to chamilo
581
+     * internal primitives. This avoids too many changes to do in imported
582
+     * code
583
+     */
584 584
     public static function getConfig($module, $key, $isplugin = true)
585 585
     {
586 586
         if ($isplugin) {
Please login to merge, or discard this patch.
main/inc/lib/AnnouncementManager.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -480,8 +480,8 @@  discard block
 block discarded – undo
480 480
                         );
481 481
 
482 482
                         if (($counter % $batchSize) === 0) {
483
-                             $em->flush();
484
-                             $em->clear();
483
+                                $em->flush();
484
+                                $em->clear();
485 485
                         }
486 486
                         $counter++;
487 487
                     }
@@ -502,8 +502,8 @@  discard block
 block discarded – undo
502 502
                         );
503 503
 
504 504
                         if (($counter % $batchSize) === 0) {
505
-                             $em->flush();
506
-                             $em->clear();
505
+                                $em->flush();
506
+                                $em->clear();
507 507
                         }
508 508
                         $counter++;
509 509
                     }
@@ -1406,7 +1406,7 @@  discard block
 block discarded – undo
1406 1406
                             ip.to_user_id = $user_id AND (ip.to_group_id IS NULL OR ip.to_group_id IN (0, ".implode(", ", $group_memberships)."))
1407 1407
                         ) ";
1408 1408
                     } else {
1409
-                       $cond_user_id = " AND (
1409
+                        $cond_user_id = " AND (
1410 1410
                             ip.to_user_id = $user_id AND (ip.to_group_id IS NULL OR ip.to_group_id IN (0, ".$group_id."))
1411 1411
                         )";
1412 1412
                     }
Please login to merge, or discard this patch.
app/AppKernel.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -214,9 +214,9 @@
 block discarded – undo
214 214
     }
215 215
 
216 216
     /**
217
-    * Check if system is installed
218
-    * @return bool
219
-    */
217
+     * Check if system is installed
218
+     * @return bool
219
+     */
220 220
     public function isInstalled()
221 221
     {
222 222
         return !empty($this->getContainer()->getParameter('installed'));
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Entity/ExtraField.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  *
16 16
  * @ORM\MappedSuperclass
17 17
  */
18
- class ExtraField// extends BaseAttribute
18
+    class ExtraField// extends BaseAttribute
19 19
 {
20 20
     const USER_FIELD_TYPE = 1;
21 21
     const COURSE_FIELD_TYPE = 2;
@@ -263,9 +263,9 @@  discard block
 block discarded – undo
263 263
         return $this;
264 264
     }
265 265
 
266
-     /**
267
-     * @return boolean
268
-     */
266
+        /**
267
+         * @return boolean
268
+         */
269 269
     public function isChangeable()
270 270
     {
271 271
         return $this->changeable;
Please login to merge, or discard this patch.
src/Chamilo/SettingsBundle/Manager/SettingsManager.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@
 block discarded – undo
204 204
             $settings->setSchemaAlias($schemaAlias);
205 205
         }
206 206
 
207
-         // We need to get a plain parameters array since we use the options resolver on it
207
+            // We need to get a plain parameters array since we use the options resolver on it
208 208
         $parameters = $settings->getParameters();
209 209
 
210 210
         $settingsBuilder = new SettingsBuilder();
Please login to merge, or discard this patch.
main/inc/lib/internationalization.lib.php 1 patch
Indentation   +5 added lines, -7 removed lines patch added patch discarded remove patch
@@ -58,7 +58,6 @@  discard block
 block discarded – undo
58 58
 /**
59 59
  * Returns a translated (localized) string
60 60
  * @param string $variable				This is the identificator (name) of the translated string to be retrieved.
61
-
62 61
  * @return string						Returns the requested string in the correspondent language.
63 62
  * Notes:
64 63
  * 1. If the name of a given language variable has the prefix "lang" it may be omited, i.e. get_lang('Yes') == get_lang('Yes').
@@ -236,7 +235,7 @@  discard block
 block discarded – undo
236 235
     static $text_direction = array();
237 236
 
238 237
     if (empty($language)) {
239
-    	$language = api_get_interface_language();
238
+        $language = api_get_interface_language();
240 239
     }
241 240
     if (!isset($text_direction[$language])) {
242 241
         $text_direction[$language] = in_array(
@@ -1659,7 +1658,6 @@  discard block
 block discarded – undo
1659 1658
 
1660 1659
 /**
1661 1660
  * Return true a date is valid
1662
-
1663 1661
  * @param string $date example: 2014-06-30 13:05:05
1664 1662
  * @param string $format example: "Y-m-d H:i:s"
1665 1663
  *
@@ -1932,15 +1930,15 @@  discard block
 block discarded – undo
1932 1930
 {
1933 1931
     if ($showTime) {
1934 1932
         if ($humanForm) {
1935
-           return $date->format('j M Y H:i:s');
1933
+            return $date->format('j M Y H:i:s');
1936 1934
         } else {
1937
-           return $date->format('Y-m-d H:i:s');
1935
+            return $date->format('Y-m-d H:i:s');
1938 1936
         }
1939 1937
     } else {
1940 1938
         if ($humanForm) {
1941
-           return $date->format('j M Y');
1939
+            return $date->format('j M Y');
1942 1940
         } else {
1943
-           return $date->format('Y-m-d');
1941
+            return $date->format('Y-m-d');
1944 1942
         }
1945 1943
     }
1946 1944
 }
Please login to merge, or discard this patch.
main/admin/user_list.php 1 patch
Indentation   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -372,13 +372,13 @@  discard block
 block discarded – undo
372 372
     $firstname = $userInfo['firstname'];
373 373
     $lastname = $userInfo['lastname'];
374 374
 
375
-	if (api_is_western_name_order()) {
376
-		$message = sprintf(get_lang('AttemptingToLoginAs'),$firstname, $lastname, $userId);
377
-	} else {
378
-		$message = sprintf(get_lang('AttemptingToLoginAs'), $lastname, $firstname, $userId);
379
-	}
375
+    if (api_is_western_name_order()) {
376
+        $message = sprintf(get_lang('AttemptingToLoginAs'),$firstname, $lastname, $userId);
377
+    } else {
378
+        $message = sprintf(get_lang('AttemptingToLoginAs'), $lastname, $firstname, $userId);
379
+    }
380 380
 
381
-	if ($userId) {
381
+    if ($userId) {
382 382
 
383 383
         // Logout the current user
384 384
         LoginDelete(api_get_user_id());
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 {
442 442
     $sql = prepare_user_sql_query(false);
443 443
     if (!in_array($direction, array('ASC','DESC'))) {
444
-    	$direction = 'ASC';
444
+        $direction = 'ASC';
445 445
     }
446 446
     $column = intval($column);
447 447
     $from = intval($from);
@@ -452,23 +452,23 @@  discard block
 block discarded – undo
452 452
         $sql .= " WHERE u.creator_id = ".api_get_user_id();
453 453
     }
454 454
 
455
-	$sql .= " ORDER BY col$column $direction ";
456
-	$sql .= " LIMIT $from,$number_of_items";
455
+    $sql .= " ORDER BY col$column $direction ";
456
+    $sql .= " LIMIT $from,$number_of_items";
457 457
 
458
-	$res = Database::query($sql);
458
+    $res = Database::query($sql);
459 459
 
460
-	$users = array ();
460
+    $users = array ();
461 461
     $t = time();
462
-	while ($user = Database::fetch_row($res)) {
463
-		$userPicture = UserManager::getUserPicture($user[0], USER_IMAGE_SIZE_SMALL);
464
-		$photo = '<img src="'.$userPicture.'" width="22" height="22" alt="'.api_get_person_name($user[2], $user[3]).'" title="'.api_get_person_name($user[2], $user[3]).'" />';
462
+    while ($user = Database::fetch_row($res)) {
463
+        $userPicture = UserManager::getUserPicture($user[0], USER_IMAGE_SIZE_SMALL);
464
+        $photo = '<img src="'.$userPicture.'" width="22" height="22" alt="'.api_get_person_name($user[2], $user[3]).'" title="'.api_get_person_name($user[2], $user[3]).'" />';
465 465
 
466 466
         if ($user[7] == 1 && !empty($user[10])) {
467 467
             // check expiration date
468 468
             $expiration_time = convert_sql_date($user[10]);
469 469
             // if expiration date is passed, store a special value for active field
470 470
             if ($expiration_time < $t) {
471
-        	   $user[7] = '-1';
471
+                $user[7] = '-1';
472 472
             }
473 473
         }
474 474
 
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 */
499 499
 function email_filter($email)
500 500
 {
501
-	return Display :: encrypted_mailto_link($email, $email);
501
+    return Display :: encrypted_mailto_link($email, $email);
502 502
 }
503 503
 
504 504
 /**
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 */
509 509
 function user_filter($name, $params, $row)
510 510
 {
511
-	return '<a href="'.api_get_path(WEB_PATH).'whoisonline.php?origin=user_list&id='.$row[0].'">'.$name.'</a>';
511
+    return '<a href="'.api_get_path(WEB_PATH).'whoisonline.php?origin=user_list&id='.$row[0].'">'.$name.'</a>';
512 512
 }
513 513
 
514 514
 /**
@@ -526,17 +526,17 @@  discard block
 block discarded – undo
526 526
     $user_is_anonymous = false;
527 527
     $current_user_status_label = $row['7'];
528 528
 
529
-	if ($current_user_status_label == $statusname[ANONYMOUS]) {
530
-		$user_is_anonymous = true;
531
-	}
532
-	$result = '';
533
-	if (!$user_is_anonymous) {
529
+    if ($current_user_status_label == $statusname[ANONYMOUS]) {
530
+        $user_is_anonymous = true;
531
+    }
532
+    $result = '';
533
+    if (!$user_is_anonymous) {
534 534
         $icon = Display::return_icon(
535 535
             'course.png',
536 536
             get_lang('Courses'),
537 537
             array('onmouseout' => 'clear_course_list (\'div_'.$user_id.'\')')
538 538
         );
539
-		$result .= '<a href="javascript:void(0)" onclick="load_course_list(\'div_'.$user_id.'\','.$user_id.')" >
539
+        $result .= '<a href="javascript:void(0)" onclick="load_course_list(\'div_'.$user_id.'\','.$user_id.')" >
540 540
 			        '.$icon.'
541 541
 					<div class="blackboard_hide" id="div_'.$user_id.'">&nbsp;&nbsp;</div>
542 542
 					</a>';
@@ -546,14 +546,14 @@  discard block
 block discarded – undo
546 546
             get_lang('Sessions'),
547 547
             array('onmouseout' => 'clear_session_list (\'div_s_'.$user_id.'\')')
548 548
         );
549
-		$result .= '<a href="javascript:void(0)" onclick="load_session_list(\'div_s_'.$user_id.'\','.$user_id.')" >
549
+        $result .= '<a href="javascript:void(0)" onclick="load_session_list(\'div_s_'.$user_id.'\','.$user_id.')" >
550 550
 					'.$icon.'
551 551
 					<div class="blackboard_hide" id="div_s_'.$user_id.'">&nbsp;&nbsp;</div>
552 552
 					</a>';
553
-	} else {
554
-		$result .= Display::return_icon('course_na.png',get_lang('Courses')).'&nbsp;&nbsp;';
555
-		$result .= Display::return_icon('course_na.png',get_lang('Sessions')).'&nbsp;&nbsp;';
556
-	}
553
+    } else {
554
+        $result .= Display::return_icon('course_na.png',get_lang('Courses')).'&nbsp;&nbsp;';
555
+        $result .= Display::return_icon('course_na.png',get_lang('Sessions')).'&nbsp;&nbsp;';
556
+    }
557 557
 
558 558
     if (api_is_platform_admin()) {
559 559
         if (!$user_is_anonymous) {
@@ -602,18 +602,18 @@  discard block
 block discarded – undo
602 602
         );
603 603
     }
604 604
 
605
-	if ($is_admin) {
605
+    if ($is_admin) {
606 606
         $result .= Display::return_icon(
607 607
             'admin_star.png',
608 608
             get_lang('IsAdministrator'),
609 609
             array('width' => ICON_SIZE_SMALL, 'heigth' => ICON_SIZE_SMALL)
610 610
         );
611
-	} else {
612
-		$result .= Display::return_icon('admin_star_na.png', get_lang('IsNotAdministrator'));
613
-	}
611
+    } else {
612
+        $result .= Display::return_icon('admin_star_na.png', get_lang('IsNotAdministrator'));
613
+    }
614 614
 
615
-	// actions for assigning sessions, courses or users
616
-	if (!api_is_session_admin()) {
615
+    // actions for assigning sessions, courses or users
616
+    if (!api_is_session_admin()) {
617 617
         if ($current_user_status_label == $statusname[SESSIONADMIN]) {
618 618
             $result .= Display::url(
619 619
                 Display::return_icon('view_more_stats.gif', get_lang('AssignSessions')),
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
                 );
644 644
             }
645 645
         }
646
-	}
646
+    }
647 647
 
648 648
     if (api_is_platform_admin()) {
649 649
         $result .= ' <a data-title="'.get_lang('FreeBusyCalendar').'" href="'.api_get_path(WEB_AJAX_PATH).'agenda.ajax.php?a=get_user_agenda&user_id='.$user_id.'&modal_size=lg" class="agenda_opener ajax">'.
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
         }
663 663
     }
664 664
 
665
-	return $result;
665
+    return $result;
666 666
 }
667 667
 
668 668
 /**
@@ -694,16 +694,16 @@  discard block
 block discarded – undo
694 694
     if ($action === 'edit') {
695 695
         $result = Display::return_icon($image.'.png', get_lang('AccountExpired'), array(), 16);
696 696
     } elseif ($row['0'] <> $_user['user_id']) {
697
-    	// you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore.
697
+        // you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore.
698 698
         $result = Display::return_icon(
699 699
             $image.'.png',
700 700
             get_lang(ucfirst($action)),
701 701
             array('onclick' => 'active_user(this);', 'id' => 'img_'.$row['0']),
702 702
             16
703 703
         );
704
-	}
704
+    }
705 705
 
706
-	return $result;
706
+    return $result;
707 707
 }
708 708
 
709 709
 /**
@@ -716,8 +716,8 @@  discard block
 block discarded – undo
716 716
  * @author Patrick Cool <[email protected]>, Ghent University, Belgium
717 717
  */
718 718
 function status_filter($status) {
719
-	$statusname = api_get_status_langvars();
720
-	return $statusname[$status];
719
+    $statusname = api_get_status_langvars();
720
+    return $statusname[$status];
721 721
 }
722 722
 
723 723
 if (isset($_GET['keyword']) || isset($_GET['keyword_firstname'])) {
@@ -733,8 +733,8 @@  discard block
 block discarded – undo
733 733
 
734 734
 if (!empty($action)) {
735 735
     $check = Security::check_token('get');
736
-	if ($check) {
737
-		switch ($action) {
736
+    if ($check) {
737
+        switch ($action) {
738 738
             case 'add_user_to_my_url':
739 739
                 $user_id = $_REQUEST["user_id"];
740 740
                 $result = UrlManager::add_user_to_url($user_id, $current_access_url_id);
@@ -744,52 +744,52 @@  discard block
 block discarded – undo
744 744
                     $message  = Display::return_message($message, 'confirmation');
745 745
                 }
746 746
                 break;
747
-			case 'delete_user':
748
-				if (api_is_platform_admin()) {
747
+            case 'delete_user':
748
+                if (api_is_platform_admin()) {
749 749
                     $user_to_delete = $_GET['user_id'];
750 750
                     $userToDeleteInfo = api_get_user_info($user_to_delete);
751 751
                     $current_user_id = api_get_user_id();
752 752
 
753
-					if ($userToDeleteInfo && $deleteUserAvailable && api_global_admin_can_edit_admin($_GET['user_id'])) {
754
-						if ($user_to_delete != $current_user_id && UserManager :: delete_user($_GET['user_id'])) {
755
-							$message = Display :: return_message(
756
-							    get_lang('UserDeleted').': '.$userToDeleteInfo['complete_name_with_username'],
753
+                    if ($userToDeleteInfo && $deleteUserAvailable && api_global_admin_can_edit_admin($_GET['user_id'])) {
754
+                        if ($user_to_delete != $current_user_id && UserManager :: delete_user($_GET['user_id'])) {
755
+                            $message = Display :: return_message(
756
+                                get_lang('UserDeleted').': '.$userToDeleteInfo['complete_name_with_username'],
757 757
                                 'confirmation'
758 758
                             );
759
-						} else {
760
-							$message = Display :: return_message(get_lang('CannotDeleteUserBecauseOwnsCourse'), 'error');
761
-						}
762
-					} else {
763
-						$message = Display :: return_message(get_lang('CannotDeleteUser'), 'error');
764
-					}
765
-					Display::addFlash($message);
766
-					header('Location: '.api_get_self());
759
+                        } else {
760
+                            $message = Display :: return_message(get_lang('CannotDeleteUserBecauseOwnsCourse'), 'error');
761
+                        }
762
+                    } else {
763
+                        $message = Display :: return_message(get_lang('CannotDeleteUser'), 'error');
764
+                    }
765
+                    Display::addFlash($message);
766
+                    header('Location: '.api_get_self());
767 767
                     exit;
768
-				}
769
-				break;
768
+                }
769
+                break;
770 770
             case 'delete':
771
-				if (api_is_platform_admin()) {
772
-					$number_of_selected_users = count($_POST['id']);
773
-					$number_of_deleted_users = 0;
774
-					if (is_array($_POST['id'])) {
775
-						foreach ($_POST['id'] as $index => $user_id) {
776
-							if ($user_id != $_user['user_id']) {
777
-								if (UserManager::delete_user($user_id)) {
778
-									$number_of_deleted_users++;
779
-								}
780
-							}
781
-						}
782
-					}
783
-					if ($number_of_selected_users == $number_of_deleted_users) {
771
+                if (api_is_platform_admin()) {
772
+                    $number_of_selected_users = count($_POST['id']);
773
+                    $number_of_deleted_users = 0;
774
+                    if (is_array($_POST['id'])) {
775
+                        foreach ($_POST['id'] as $index => $user_id) {
776
+                            if ($user_id != $_user['user_id']) {
777
+                                if (UserManager::delete_user($user_id)) {
778
+                                    $number_of_deleted_users++;
779
+                                }
780
+                            }
781
+                        }
782
+                    }
783
+                    if ($number_of_selected_users == $number_of_deleted_users) {
784 784
                         $message = Display :: return_message(get_lang('SelectedUsersDeleted'), 'confirmation');
785
-					} else {
785
+                    } else {
786 786
                         $message = Display :: return_message(get_lang('SomeUsersNotDeleted'), 'error');
787
-					}
788
-				}
789
-				break;
790
-		}
791
-		Security::clear_token();
792
-	}
787
+                    }
788
+                }
789
+                break;
790
+        }
791
+        Security::clear_token();
792
+    }
793 793
 }
794 794
 
795 795
 // Create a search-box
@@ -807,15 +807,15 @@  discard block
 block discarded – undo
807 807
 $actionsCenter = '';
808 808
 $actionsRight  = '';
809 809
 if (api_is_platform_admin()) {
810
-	$actionsRight .= '<a class="pull-right" href="'.api_get_path(WEB_CODE_PATH).'admin/user_add.php">'.
811
-         Display::return_icon('new_user.png',get_lang('AddUsers'),'',ICON_SIZE_MEDIUM).'</a>';
810
+    $actionsRight .= '<a class="pull-right" href="'.api_get_path(WEB_CODE_PATH).'admin/user_add.php">'.
811
+            Display::return_icon('new_user.png',get_lang('AddUsers'),'',ICON_SIZE_MEDIUM).'</a>';
812 812
 }
813 813
 
814 814
 $actionsLeft .= $form->returnForm();
815 815
 $actionsCenter .= $searchAdvanced;
816 816
 
817 817
 if (isset($_GET['keyword'])) {
818
-	$parameters = array('keyword' => Security::remove_XSS($_GET['keyword']));
818
+    $parameters = array('keyword' => Security::remove_XSS($_GET['keyword']));
819 819
 } elseif (isset ($_GET['keyword_firstname'])) {
820 820
     $parameters['keyword_firstname'] = Security::remove_XSS($_GET['keyword_firstname']);
821 821
     $parameters['keyword_lastname'] = Security::remove_XSS($_GET['keyword_lastname']);
@@ -889,11 +889,11 @@  discard block
 block discarded – undo
889 889
 $table->set_header(2, get_lang('OfficialCode'));
890 890
 
891 891
 if (api_is_western_name_order()) {
892
-	$table->set_header(3, get_lang('FirstName'));
893
-	$table->set_header(4, get_lang('LastName'));
892
+    $table->set_header(3, get_lang('FirstName'));
893
+    $table->set_header(4, get_lang('LastName'));
894 894
 } else {
895
-	$table->set_header(3, get_lang('LastName'));
896
-	$table->set_header(4, get_lang('FirstName'));
895
+    $table->set_header(3, get_lang('LastName'));
896
+    $table->set_header(4, get_lang('FirstName'));
897 897
 }
898 898
 $table->set_header(5, get_lang('LoginName'));
899 899
 $table->set_header(6, get_lang('Email'));
Please login to merge, or discard this patch.
main/inc/lib/course.lib.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
     public static $toolList;
38 38
     public static $courseSettingsManager;
39 39
 
40
-     /**
41
-     * @param \Doctrine\ORM\EntityManager
42
-     */
40
+        /**
41
+         * @param \Doctrine\ORM\EntityManager
42
+         */
43 43
     public static function setEntityManager($em)
44 44
     {
45 45
         self::$em = $em;
@@ -1454,11 +1454,11 @@  discard block
 block discarded – undo
1454 1454
             }
1455 1455
 
1456 1456
             $sql .= ' FROM ' . Database::get_main_table(TABLE_MAIN_USER) . ' as user '
1457
-                  . ' LEFT JOIN ' . Database::get_main_table(TABLE_MAIN_COURSE_USER) . ' as course_rel_user
1457
+                    . ' LEFT JOIN ' . Database::get_main_table(TABLE_MAIN_COURSE_USER) . ' as course_rel_user
1458 1458
                       ON 
1459 1459
                         user.id = course_rel_user.user_id AND
1460 1460
                         course_rel_user.relation_type <> ' . COURSE_RELATION_TYPE_RRHH . '  '
1461
-                  . " INNER JOIN $course_table course ON course_rel_user.c_id = course.id ";
1461
+                    . " INNER JOIN $course_table course ON course_rel_user.c_id = course.id ";
1462 1462
 
1463 1463
             if (!empty($course_code)) {
1464 1464
                 $sql .= ' AND course_rel_user.c_id = "' . $courseId . '"';
@@ -1801,7 +1801,7 @@  discard block
 block discarded – undo
1801 1801
 
1802 1802
         // We get the coach for the given course in a given session.
1803 1803
         $sql = 'SELECT user_id FROM ' . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) .
1804
-               ' WHERE session_id ="' . $session_id . '" AND c_id="' . $courseId . '" AND status = 2';
1804
+                ' WHERE session_id ="' . $session_id . '" AND c_id="' . $courseId . '" AND status = 2';
1805 1805
         $rs = Database::query($sql);
1806 1806
         while ($user = Database::fetch_array($rs)) {
1807 1807
             $userInfo = api_get_user_info($user['user_id']);
@@ -3477,13 +3477,13 @@  discard block
 block discarded – undo
3477 3477
         return $html;
3478 3478
     }
3479 3479
 
3480
-     /**
3481
-     * Builds the course block in user_portal.php
3482
-     * @todo use Twig
3483
-     * @param array $params
3484
-     * @param bool|false $is_sub_content
3485
-     * @return string
3486
-     */
3480
+        /**
3481
+         * Builds the course block in user_portal.php
3482
+         * @todo use Twig
3483
+         * @param array $params
3484
+         * @param bool|false $is_sub_content
3485
+         * @return string
3486
+         */
3487 3487
     public static function course_item_html($params, $is_sub_content = false)
3488 3488
     {
3489 3489
         $html = '';
@@ -3666,13 +3666,13 @@  discard block
 block discarded – undo
3666 3666
                         $params['edit_actions'] .= api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course['code'];
3667 3667
                         if ($load_dirs) {
3668 3668
                             $params['document'] = '<a id="document_preview_' . $course_info['real_id'] . '_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3669
-                               . Display::returnFontAwesomeIcon('folder-open') . '</a>';
3669
+                                . Display::returnFontAwesomeIcon('folder-open') . '</a>';
3670 3670
                             $params['document'] .= Display::div('', ['id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container']);
3671 3671
                         }
3672 3672
                     }else{
3673 3673
                         if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED && $load_dirs) {
3674 3674
                             $params['document'] = '<a id="document_preview_' . $course_info['real_id'] . '_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3675
-                               . Display::returnFontAwesomeIcon('folder-open') . '</a>';
3675
+                                . Display::returnFontAwesomeIcon('folder-open') . '</a>';
3676 3676
                             $params['document'] .= Display::div('', ['id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container']);
3677 3677
                         }
3678 3678
                     }
@@ -3858,7 +3858,7 @@  discard block
 block discarded – undo
3858 3858
                 $params['edit_actions'] .= api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course['code'];
3859 3859
                 if($load_dirs){
3860 3860
                     $params['document'] = '<a id="document_preview_' . $course_info['real_id'] . '_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3861
-                               . Display::returnFontAwesomeIcon('folder-open') . '</a>';
3861
+                                . Display::returnFontAwesomeIcon('folder-open') . '</a>';
3862 3862
                     $params['document'] .= Display::div('', array('id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container'));
3863 3863
                 }
3864 3864
             }
@@ -3986,7 +3986,7 @@  discard block
 block discarded – undo
3986 3986
                 $params['edit_actions'] .= api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course['code'];
3987 3987
                 if($load_dirs){
3988 3988
                     $params['document'] = '<a id="document_preview_' . $course_info['real_id'] . '_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3989
-                               . Display::returnFontAwesomeIcon('folder-open') . '</a>';
3989
+                                . Display::returnFontAwesomeIcon('folder-open') . '</a>';
3990 3990
                     $params['document'] .= Display::div('', array('id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container'));
3991 3991
                 }
3992 3992
             }
@@ -4277,7 +4277,7 @@  discard block
 block discarded – undo
4277 4277
         }
4278 4278
 
4279 4279
         $session_title .= isset($course['special_course']) ? ' ' .
4280
-                          Display::return_icon('klipper.png', get_lang('CourseAutoRegister')) : '';
4280
+                            Display::return_icon('klipper.png', get_lang('CourseAutoRegister')) : '';
4281 4281
 
4282 4282
         $params['title'] = $session_title;
4283 4283
         $params['extra'] = '';
Please login to merge, or discard this patch.
main/inc/lib/display.lib.php 1 patch
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
      */
469 469
     public static function display_normal_message($message, $filter = true, $returnValue = false)
470 470
     {
471
-    	$message = self::return_message($message, 'normal', $filter);
471
+        $message = self::return_message($message, 'normal', $filter);
472 472
         if ($returnValue) {
473 473
             return $message;
474 474
         } else {
@@ -552,22 +552,22 @@  discard block
 block discarded – undo
552 552
         }
553 553
 
554 554
         if ($filter) {
555
-        	$message = api_htmlentities($message, ENT_QUOTES, api_is_xml_http_request() ? 'UTF-8' : api_get_system_encoding());
555
+            $message = api_htmlentities($message, ENT_QUOTES, api_is_xml_http_request() ? 'UTF-8' : api_get_system_encoding());
556 556
         }
557 557
 
558 558
         $class = '';
559 559
         switch ($type) {
560 560
             case 'warning':
561 561
                $class .= 'alert alert-warning';
562
-               break;
562
+                break;
563 563
             case 'error':
564 564
                $class .= 'alert alert-danger';
565
-               break;
565
+                break;
566 566
             case 'confirmation':
567 567
             case 'confirm':
568 568
             case 'success':
569 569
                 $class .= 'alert alert-success';
570
-               break;
570
+                break;
571 571
             case 'normal':
572 572
             default:
573 573
                 $class .= 'alert alert-info';
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
      * @param array    additional attributes (for instance height, width, onclick, ...)
698 698
      * @param integer  The wanted width of the icon (to be looked for in the corresponding img/icons/ folder)
699 699
      * @return void
700
-    */
700
+     */
701 701
     public static function display_icon(
702 702
         $image,
703 703
         $alt_text = '',
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
      * @author Julio Montoya 2010 Function improved, adding image constants
734 734
      * @author Yannick Warnier 2011 Added size handler
735 735
      * @version Feb 2011
736
-    */
736
+     */
737 737
     public static function return_icon(
738 738
         $image,
739 739
         $alt_text = '',
@@ -870,14 +870,14 @@  discard block
 block discarded – undo
870 870
      */
871 871
     public static function input($type, $name, $value, $attributes = array())
872 872
     {
873
-         if (isset($type)) {
874
-             $attributes['type']= $type;
875
-         }
876
-         if (isset($name)) {
877
-             $attributes['name']= $name;
878
-         }
879
-         if (isset($value)) {
880
-             $attributes['value']= $value;
873
+            if (isset($type)) {
874
+                $attributes['type']= $type;
875
+            }
876
+            if (isset($name)) {
877
+                $attributes['name']= $name;
878
+            }
879
+            if (isset($value)) {
880
+                $attributes['value']= $value;
881 881
         }
882 882
         return self::tag('input', '', $attributes);
883 883
     }
@@ -890,10 +890,10 @@  discard block
 block discarded – undo
890 890
      */
891 891
     public static function button($name, $value, $attributes = array())
892 892
     {
893
-    	if (!empty($name)) {
893
+        if (!empty($name)) {
894 894
             $attributes['name'] = $name;
895
-    	}
896
-    	return self::tag('button', $value, $attributes);
895
+        }
896
+        return self::tag('button', $value, $attributes);
897 897
     }
898 898
 
899 899
     /**
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
      * in the $htmlHeadXtra variable before the display_header
961 961
      * Add this script
962 962
      * @example
963
-             * <script>
963
+     * <script>
964 964
                     $(function() {
965 965
                         $( "#tabs" ).tabs();
966 966
                     });
@@ -1026,20 +1026,20 @@  discard block
 block discarded – undo
1026 1026
      */
1027 1027
     public static function tabsOnlyLink($headers, $selected = null)
1028 1028
     {
1029
-         $id = uniqid();
1030
-         $i = 1;
1031
-         $lis = null;
1032
-         foreach ($headers as $item) {
1029
+            $id = uniqid();
1030
+            $i = 1;
1031
+            $lis = null;
1032
+            foreach ($headers as $item) {
1033 1033
             $class = null;
1034 1034
             if ($i == $selected) {
1035 1035
                 $class = 'active';
1036 1036
             }
1037
-             $item = self::tag(
1038
-                 'a',
1039
-                 $item['content'],
1040
-                 array('id' => $id.'-'.$i, 'href' => $item['url'])
1041
-             );
1042
-             $lis .= self::tag('li', $item, array('class' => $class));
1037
+                $item = self::tag(
1038
+                    'a',
1039
+                    $item['content'],
1040
+                    array('id' => $id.'-'.$i, 'href' => $item['url'])
1041
+                );
1042
+                $lis .= self::tag('li', $item, array('class' => $class));
1043 1043
             $i++;
1044 1044
         }
1045 1045
         return self::tag('ul', $lis, array('class' => 'nav nav-tabs tabs-margin'));
@@ -1251,8 +1251,8 @@  discard block
 block discarded – undo
1251 1251
      */
1252 1252
     public static function table($headers, $rows, $attributes = array())
1253 1253
     {
1254
-    	if (empty($attributes)) {
1255
-    		$attributes['class'] = 'data_table';
1254
+        if (empty($attributes)) {
1255
+            $attributes['class'] = 'data_table';
1256 1256
         }
1257 1257
         $table = new HTML_Table($attributes);
1258 1258
         $row = 0;
@@ -1260,17 +1260,17 @@  discard block
 block discarded – undo
1260 1260
 
1261 1261
         // Course headers
1262 1262
         if (!empty($headers)) {
1263
-	        foreach ($headers as $item) {
1264
-	            $table->setHeaderContents($row, $column, $item);
1265
-	            $column++;
1266
-	        }
1267
-	        $row = 1;
1268
-	        $column = 0;
1263
+            foreach ($headers as $item) {
1264
+                $table->setHeaderContents($row, $column, $item);
1265
+                $column++;
1266
+            }
1267
+            $row = 1;
1268
+            $column = 0;
1269 1269
         }
1270 1270
 
1271 1271
         if (!empty($rows)) {
1272
-	        foreach($rows as $content) {
1273
-	            $table->setCellContents($row, $column, $content);
1272
+            foreach($rows as $content) {
1273
+                $table->setCellContents($row, $column, $content);
1274 1274
                 $row++;
1275 1275
             }
1276 1276
         }
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
                         //$item_property['tool'] != TOOL_DROPBOX &&
1377 1377
                         $item_property['tool'] != TOOL_NOTEBOOK &&
1378 1378
                         $item_property['tool'] != TOOL_CHAT)
1379
-                   )
1379
+                    )
1380 1380
                 )
1381 1381
                 // Take only what's visible or "invisible but where the user is a teacher" or where the visibility is unset.
1382 1382
                 && ($item_property['visibility'] == '1'
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
                         ($item_property['to_user_id'] != $user_id) &&
1393 1393
                         (!isset($item_property['to_group_id']) || !in_array($item_property['to_group_id'], $group_ids)))
1394 1394
                 ) {
1395
-                   continue;
1395
+                    continue;
1396 1396
                 }
1397 1397
 
1398 1398
                 // If it's a survey, make sure the user's invited. Otherwise drop it.
@@ -1604,21 +1604,21 @@  discard block
 block discarded – undo
1604 1604
      *
1605 1605
      * @param  string  id of the rating ul element
1606 1606
      * @param  string  url that will be added (for jquery see hot_courses.tpl)
1607
-	 * @param	string	point info array see function CourseManager::get_course_ranking()
1608
-	 * @param	bool	add a div wrapper
1609
-	 * @todo	use     templates
1607
+     * @param	string	point info array see function CourseManager::get_course_ranking()
1608
+     * @param	bool	add a div wrapper
1609
+     * @todo	use     templates
1610 1610
      **/
1611 1611
     public static function return_rating_system($id, $url, $point_info = array(), $add_div_wrapper = true)
1612 1612
     {
1613
-		$number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null;
1614
-		$percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
1613
+        $number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null;
1614
+        $percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0;
1615 1615
 
1616
-		if (!empty($percentage)) {
1616
+        if (!empty($percentage)) {
1617 1617
             $percentage = $percentage*125/100;
1618 1618
         }
1619
-		$accesses =  isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1619
+        $accesses =  isset($point_info['accesses']) ? $point_info['accesses'] : 0;
1620 1620
 
1621
-		$star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
1621
+        $star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']);
1622 1622
 
1623 1623
         $html = '<ul id="'.$id.'" class="star-rating">
1624 1624
 					<li class="current-rating" style="width:'.$percentage.'px;"></li>
@@ -1629,26 +1629,26 @@  discard block
 block discarded – undo
1629 1629
 					<li><a href="javascript:void(0);" data-link="'.$url.'&amp;star=5" title="'.$star_label.'" class="five-stars">5</a></li>
1630 1630
 				</ul>';
1631 1631
 
1632
-		$labels = array();
1632
+        $labels = array();
1633 1633
 
1634
-		$labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1635
-		$labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1636
-		/* if (!empty($number_of_users_who_voted)) {
1634
+        $labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes');
1635
+        $labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits');
1636
+        /* if (!empty($number_of_users_who_voted)) {
1637 1637
 			$labels[]= get_lang('Average').' '.$point_info['point_average_star'].'/5';
1638 1638
 		} */
1639 1639
 
1640
-		$labels[]= $point_info['user_vote']  ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
1640
+        $labels[]= $point_info['user_vote']  ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] ';
1641 1641
 
1642
-		if (!$add_div_wrapper && api_is_anonymous()) {
1643
-			$labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1644
-		}
1642
+        if (!$add_div_wrapper && api_is_anonymous()) {
1643
+            $labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error'));
1644
+        }
1645 1645
 
1646 1646
         $html .= Display::div(implode(' | ', $labels) , array('id' =>  'vote_label_'.$id, 'class' => 'vote_label_info'));
1647 1647
         $html .= ' '.Display::span(' ', array('id' =>  'vote_label2_'.$id));
1648 1648
 
1649 1649
         if ($add_div_wrapper) {
1650
-			$html = Display::div($html, array('id' => 'rating_wrapper_'.$id));
1651
-		}
1650
+            $html = Display::div($html, array('id' => 'rating_wrapper_'.$id));
1651
+        }
1652 1652
 
1653 1653
         return $html;
1654 1654
     }
@@ -1681,8 +1681,8 @@  discard block
 block discarded – undo
1681 1681
         return self::page_header($title, $second_title);
1682 1682
     }
1683 1683
 
1684
-     public static function page_subheader_and_translate($title, $second_title = null)
1685
-     {
1684
+        public static function page_subheader_and_translate($title, $second_title = null)
1685
+        {
1686 1686
         $title = get_lang($title);
1687 1687
         return self::page_subheader($title, $second_title);
1688 1688
     }
Please login to merge, or discard this patch.