Completed
Push — 1.11.x ( 7e6069...34fe5d )
by José
101:44 queued 47:09
created
main/inc/ajax/user_manager.ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                 <div class="row">
59 59
                     <div class="col-sm-10 col-sm-offset-2">
60 60
                         <a class="btn btn-primary" id="send_message_link">
61
-                            <em class="fa fa-envelope"></em> ' . get_lang('Send') . '
61
+                            <em class="fa fa-envelope"></em> ' . get_lang('Send').'
62 62
                         </a>
63 63
                     </div>
64 64
                 </div>
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
             if (!empty($user_id)) {
114 114
                 $user_table = Database :: get_main_table(TABLE_MAIN_USER);
115
-                $sql="UPDATE $user_table SET active='".$status."' WHERE user_id='".$user_id."'";
115
+                $sql = "UPDATE $user_table SET active='".$status."' WHERE user_id='".$user_id."'";
116 116
                 $result = Database::query($sql);
117 117
 
118 118
                 //Send and email if account is active
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
                     $emailsubject = '['.api_get_setting('siteName').'] '.get_lang('YourReg').' '.api_get_setting('siteName');
123 123
                     $email_admin = api_get_setting('emailAdministrator');
124 124
                     $sender_name = api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'), null, PERSON_NAME_EMAIL_ADDRESS);
125
-                    $emailbody=get_lang('Dear')." ".stripslashes($recipient_name).",\n\n";
125
+                    $emailbody = get_lang('Dear')." ".stripslashes($recipient_name).",\n\n";
126 126
 
127
-                    $emailbody.=sprintf(get_lang('YourAccountOnXHasJustBeenApprovedByOneOfOurAdministrators'), api_get_setting('siteName'))."\n";
128
-                    $emailbody.=sprintf(get_lang('YouCanNowLoginAtXUsingTheLoginAndThePasswordYouHaveProvided'), api_get_path(WEB_PATH)).",\n\n";
129
-                    $emailbody.=get_lang('HaveFun')."\n\n";
127
+                    $emailbody .= sprintf(get_lang('YourAccountOnXHasJustBeenApprovedByOneOfOurAdministrators'), api_get_setting('siteName'))."\n";
128
+                    $emailbody .= sprintf(get_lang('YouCanNowLoginAtXUsingTheLoginAndThePasswordYouHaveProvided'), api_get_path(WEB_PATH)).",\n\n";
129
+                    $emailbody .= get_lang('HaveFun')."\n\n";
130 130
                     //$emailbody.=get_lang('Problem'). "\n\n". get_lang('SignatureFormula');
131
-                    $emailbody.=api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n". get_lang('Manager'). " ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".api_get_setting('emailAdministrator');
131
+                    $emailbody .= api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n".get_lang('Manager')." ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n".get_lang('Email')." : ".api_get_setting('emailAdministrator');
132 132
 
133 133
                     $additionalParameters = array(
134 134
                         'smsType' => SmsPlugin::ACCOUNT_APPROVED_CONNECT,
Please login to merge, or discard this patch.
main/inc/ajax/model.ajax.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
         }
732 732
 
733 733
         break;
734
-	case 'get_user_skill_ranking':
734
+    case 'get_user_skill_ranking':
735 735
         $columns = array('photo', 'firstname', 'lastname', 'skills_acquired', 'currently_learning', 'rank');
736 736
         $result = $skill->get_user_list_skill_ranking($start, $limit, $sidx, $sord, $whereCondition);
737 737
         $result = msort($result, 'skills_acquired', 'asc');
@@ -1281,7 +1281,7 @@  discard block
 block discarded – undo
1281 1281
 
1282 1282
             if (!empty($item['certif_min_score']) && !empty($item['document_id'])) {
1283 1283
                 $item['certificates'] = Display::return_icon('accept.png', get_lang('WithCertificate'), array(), ICON_SIZE_SMALL);
1284
-                 $item['has_certificates'] = '1';
1284
+                    $item['has_certificates'] = '1';
1285 1285
             } else {
1286 1286
                 $item['certificates'] = Display::return_icon('warning.png', get_lang('NoCertificate'), array(), ICON_SIZE_SMALL);
1287 1287
                 $item['has_certificates'] = '0';
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 $action = $_GET['a'];
12 12
 $page = intval($_REQUEST['page']); //page
13 13
 $limit = intval($_REQUEST['rows']); //quantity of rows
14
-$sidx = $_REQUEST['sidx'];         //index (field) to filter
15
-$sord = $_REQUEST['sord'];         //asc or desc
14
+$sidx = $_REQUEST['sidx']; //index (field) to filter
15
+$sord = $_REQUEST['sord']; //asc or desc
16 16
 
17 17
 if (strpos(strtolower($sidx), 'asc') !== false) {
18 18
     $sidx = str_replace(array('asc', ','), '', $sidx);
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     $sord = 'desc';
25 25
 }
26 26
 
27
-if (!in_array($sord, array('asc','desc'))) {
27
+if (!in_array($sord, array('asc', 'desc'))) {
28 28
     $sord = 'desc';
29 29
 }
30 30
 
@@ -64,19 +64,19 @@  discard block
 block discarded – undo
64 64
 function getWhereClause($col, $oper, $val)
65 65
 {
66 66
     $ops = array(
67
-        'eq' => '=',        //equal
68
-        'ne' => '<>',       //not equal
69
-        'lt' => '<',        //less than
70
-        'le' => '<=',       //less than or equal
71
-        'gt' => '>',        //greater than
72
-        'ge' => '>=',       //greater than or equal
73
-        'bw' => 'LIKE',     //begins with
67
+        'eq' => '=', //equal
68
+        'ne' => '<>', //not equal
69
+        'lt' => '<', //less than
70
+        'le' => '<=', //less than or equal
71
+        'gt' => '>', //greater than
72
+        'ge' => '>=', //greater than or equal
73
+        'bw' => 'LIKE', //begins with
74 74
         'bn' => 'NOT LIKE', //doesn't begin with
75
-        'in' => 'LIKE',     //is in
75
+        'in' => 'LIKE', //is in
76 76
         'ni' => 'NOT LIKE', //is not in
77
-        'ew' => 'LIKE',     //ends with
77
+        'ew' => 'LIKE', //ends with
78 78
         'en' => 'NOT LIKE', //doesn't end with
79
-        'cn' => 'LIKE',     //contains
79
+        'cn' => 'LIKE', //contains
80 80
         'nc' => 'NOT LIKE'  //doesn't contain
81 81
     );
82 82
 
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
 
101 101
 // If there is no search request sent by jqgrid, $where should be empty
102 102
 $whereCondition = '';
103
-$operation = isset($_REQUEST['oper'])  ? $_REQUEST['oper']  : false;
104
-$exportFormat = isset($_REQUEST['export_format'])  ? $_REQUEST['export_format']  : 'csv';
105
-$searchField = isset($_REQUEST['searchField'])  ? $_REQUEST['searchField']  : false;
106
-$searchOperator = isset($_REQUEST['searchOper'])   ? $_REQUEST['searchOper']   : false;
103
+$operation = isset($_REQUEST['oper']) ? $_REQUEST['oper'] : false;
104
+$exportFormat = isset($_REQUEST['export_format']) ? $_REQUEST['export_format'] : 'csv';
105
+$searchField = isset($_REQUEST['searchField']) ? $_REQUEST['searchField'] : false;
106
+$searchOperator = isset($_REQUEST['searchOper']) ? $_REQUEST['searchOper'] : false;
107 107
 $searchString = isset($_REQUEST['searchString']) ? $_REQUEST['searchString'] : false;
108 108
 $search = isset($_REQUEST['_search']) ? $_REQUEST['_search'] : false;
109 109
 $forceSearch = isset($_REQUEST['_force_search']) ? $_REQUEST['_force_search'] : false;
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
             foreach ($filters->rules as $key => $rule) {
172 172
                 $whereCondition .= getWhereClause($rule->field, $rule->op, $rule->data);
173 173
 
174
-                if ($counter < count($filters->rules) -1) {
174
+                if ($counter < count($filters->rules) - 1) {
175 175
                     $whereCondition .= $filters->groupOp;
176 176
                 }
177 177
                 $counter++;
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         $userId = api_get_user_id();
202 202
         $sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : 0;
203 203
         $courseCodeList = array();
204
-        $userIdList  = array();
204
+        $userIdList = array();
205 205
         $sessionIdList = [];
206 206
         $searchByGroups = false;
207 207
         if (api_is_drh()) {
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 $total_pages = 0;
586 586
 if ($count > 0) {
587 587
     if (!empty($limit)) {
588
-        $total_pages = ceil((float)$count/(float)$limit);
588
+        $total_pages = ceil((float) $count / (float) $limit);
589 589
     }
590 590
 }
591 591
 if ($page > $total_pages) {
@@ -865,10 +865,10 @@  discard block
 block discarded – undo
865 865
     case 'get_work_user_list_others':
866 866
         if (isset($_GET['type']) && $_GET['type'] === 'simple') {
867 867
             $columns = array(
868
-                'type', 'firstname', 'lastname',  'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'
868
+                'type', 'firstname', 'lastname', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'
869 869
             );
870 870
         } else {
871
-            $columns = array('type', 'firstname', 'lastname',  'title', 'sent_date', 'actions');
871
+            $columns = array('type', 'firstname', 'lastname', 'title', 'sent_date', 'actions');
872 872
         }
873 873
         $whereCondition .= " AND u.user_id <> ".api_get_user_id();
874 874
         $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $whereCondition);
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
     case 'get_exercise_results':
903 903
         $course = api_get_course_info();
904 904
         // Used inside ExerciseLib::get_exam_results_data()
905
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
905
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
906 906
         if ($is_allowedToEdit || api_is_student_boss()) {
907 907
             $columns = array(
908 908
                 'firstname',
@@ -927,11 +927,11 @@  discard block
 block discarded – undo
927 927
         break;
928 928
     case 'get_hotpotatoes_exercise_results':
929 929
         $course = api_get_course_info();
930
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
930
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
931 931
         if (api_is_allowed_to_edit()) {
932
-            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date',  'score', 'actions');
932
+            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions');
933 933
         } else {
934
-            $columns = array('exe_date',  'score', 'actions');
934
+            $columns = array('exe_date', 'score', 'actions');
935 935
         }
936 936
         $result = ExerciseLib::get_exam_results_hotpotatoes_data(
937 937
             $start,
@@ -964,12 +964,12 @@  discard block
 block discarded – undo
964 964
         break;
965 965
     case 'get_hotpotatoes_exercise_results':
966 966
         $course = api_get_course_info();
967
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
967
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
968 968
 
969 969
         if (api_is_allowed_to_edit(null, true) || api_is_drh()) {
970
-            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date',  'score', 'actions');
970
+            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions');
971 971
         } else {
972
-            $columns = array('exe_date',  'score', 'actions');
972
+            $columns = array('exe_date', 'score', 'actions');
973 973
         }
974 974
         $result = ExerciseLib::get_exam_results_hotpotatoes_data(
975 975
             $start,
@@ -1005,7 +1005,7 @@  discard block
 block discarded – undo
1005 1005
             );
1006 1006
         }
1007 1007
 
1008
-        $columns =  array(
1008
+        $columns = array(
1009 1009
             'name',
1010 1010
             'date',
1011 1011
             'course_per_session',
@@ -1041,17 +1041,17 @@  discard block
 block discarded – undo
1041 1041
                 $detailButtons = [];
1042 1042
                 $detailButtons[] = Display::url(
1043 1043
                     Display::return_icon('works.png', get_lang('WorksReport')),
1044
-                    api_get_path(WEB_CODE_PATH) . 'mySpace/works_in_session_report.php?session=' . $session['id']
1044
+                    api_get_path(WEB_CODE_PATH).'mySpace/works_in_session_report.php?session='.$session['id']
1045 1045
                 );
1046 1046
                 $detailButtons[] = Display::url(
1047 1047
                     Display::return_icon('2rightarrow.png'),
1048
-                    api_get_path(WEB_CODE_PATH) . 'mySpace/course.php?session_id=' . $session['id']
1048
+                    api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id']
1049 1049
                 );
1050 1050
 
1051 1051
                 $result[] = array(
1052 1052
                     'name' => Display::url(
1053 1053
                         $session['name'],
1054
-                        api_get_path(WEB_CODE_PATH) . 'mySpace/course.php?session_id=' . $session['id']
1054
+                        api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id']
1055 1055
                     ),
1056 1056
                     'date' => $session_date_string,
1057 1057
                     'course_per_session' => $count_courses_in_session,
@@ -1363,7 +1363,7 @@  discard block
 block discarded – undo
1363 1363
         $result = $new_result;
1364 1364
         break;
1365 1365
     case 'get_gradebooks':
1366
-        $columns = array('name', 'certificates','skills', 'actions', 'has_certificates');
1366
+        $columns = array('name', 'certificates', 'skills', 'actions', 'has_certificates');
1367 1367
         if (!in_array($sidx, $columns)) {
1368 1368
             $sidx = 'name';
1369 1369
         }
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
                     if (!empty($exercises[$cnt - 4]['title'])) {
1537 1537
                         $title = ucwords(strtolower(trim($exercises[$cnt - 4]['title'])));
1538 1538
                     }
1539
-                    $columns[] = 'exer' . $i;
1539
+                    $columns[] = 'exer'.$i;
1540 1540
                     $column_names[] = $title;
1541 1541
                     $i++;
1542 1542
                     break;
@@ -1569,7 +1569,7 @@  discard block
 block discarded – undo
1569 1569
             $sessionInfo = SessionManager::fetch($listUserSess[$user['user_id']]['id_session']);
1570 1570
             $result[$i]['session'] = $sessionInfo['name'];
1571 1571
             $result[$i]['username'] = $user['username'];
1572
-            $result[$i]['name'] = $user['lastname'] . " " . $user['firstname'];
1572
+            $result[$i]['name'] = $user['lastname']." ".$user['firstname'];
1573 1573
             $j = 1;
1574 1574
             $finalScore = 0;
1575 1575
             foreach ($quizIds as $quizID) {
@@ -1577,7 +1577,7 @@  discard block
 block discarded – undo
1577 1577
                 if (!empty($arrGrade [$user['user_id']][$quizID]) || $arrGrade [$user['user_id']][$quizID] == 0) {
1578 1578
                     $finalScore += $grade = $arrGrade [$user['user_id']][$quizID];
1579 1579
                 }
1580
-                $result[$i]['exer' . $j] = $grade;
1580
+                $result[$i]['exer'.$j] = $grade;
1581 1581
                 $j++;
1582 1582
             }
1583 1583
 
@@ -1745,9 +1745,9 @@  discard block
 block discarded – undo
1745 1745
         foreach ($result as $row) {
1746 1746
             // if results tab give not id, set id to $i otherwise id="null" for all <tr> of the jqgrid - ref #4235
1747 1747
             if (!isset($row['id']) || isset($row['id']) && $row['id'] == '') {
1748
-                $response->rows[$i]['id']= $i;
1748
+                $response->rows[$i]['id'] = $i;
1749 1749
             } else {
1750
-                $response->rows[$i]['id']= $row['id'];
1750
+                $response->rows[$i]['id'] = $row['id'];
1751 1751
             }
1752 1752
             $array = array();
1753 1753
             foreach ($columns as $col) {
@@ -1757,7 +1757,7 @@  discard block
 block discarded – undo
1757 1757
                     $array[] = isset($row[$col]) ? Security::remove_XSS($row[$col]) : '';
1758 1758
                 }
1759 1759
             }
1760
-            $response->rows[$i]['cell']=$array;
1760
+            $response->rows[$i]['cell'] = $array;
1761 1761
             $i++;
1762 1762
         }
1763 1763
     }
Please login to merge, or discard this patch.
main/inc/local.inc.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -758,7 +758,7 @@
 block discarded – undo
758 758
     //    $gidReset = true;
759 759
 } // end else
760 760
 
761
- // Now check for anonymous user mode
761
+    // Now check for anonymous user mode
762 762
 if (isset($use_anonymous) && $use_anonymous) {
763 763
     //if anonymous mode is set, then try to set the current user as anonymous
764 764
     //if he doesn't have a login yet
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
             // is necessary verify check
218 218
             if ($legal_type == 1) {
219
-                if ((isset($_POST['legal_accept']) && $_POST['legal_accept']=='1')) {
219
+                if ((isset($_POST['legal_accept']) && $_POST['legal_accept'] == '1')) {
220 220
                     $legal_option = true;
221 221
                 } else {
222 222
                     $legal_option = false;
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
                  * Process external authentication
506 506
                  * on the basis of the given login name
507 507
                  */
508
-                $loginFailed = true;  // Default initialisation. It could
508
+                $loginFailed = true; // Default initialisation. It could
509 509
                 // change after the external authentication
510 510
                 $key = $uData['auth_source']; //'ldap','shibboleth'...
511 511
                 /* >>>>>>>> External authentication modules <<<<<<<<< */
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
                      * Process external authentication
540 540
                      * on the basis of the given login name
541 541
                      */
542
-                    $loginFailed = true;  // Default initialisation. It could
542
+                    $loginFailed = true; // Default initialisation. It could
543 543
                     // change after the external authentication
544 544
                     $key = $uData['auth_source']; //'ldap','shibboleth'...
545 545
 
@@ -550,11 +550,11 @@  discard block
 block discarded – undo
550 550
             } else {
551 551
                 // change after the external authentication
552 552
                 // login failed, Database::num_rows($result) <= 0
553
-                $loginFailed = true;  // Default initialisation. It could
553
+                $loginFailed = true; // Default initialisation. It could
554 554
             }
555 555
 
556 556
             // login failed, Database::num_rows($result) <= 0
557
-            $loginFailed = true;  // Default initialisation. It could
557
+            $loginFailed = true; // Default initialisation. It could
558 558
             // change after the external authentication
559 559
 
560 560
             /*
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
                         include_once($thisAuthSource['newUser']);
581 581
                     } else {
582 582
                         error_log(
583
-                            'Chamilo Authentication external file' .
583
+                            'Chamilo Authentication external file'.
584 584
                             ' could not be found - this might prevent your system from using'.
585 585
                             ' the authentication process in the user creation process',
586 586
                             0
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
             online_logout(null, false);
693 693
             $osso->logout(); //redirects and exits
694 694
         }
695
-    } elseif (api_get_setting('openid_authentication')=='true') {
695
+    } elseif (api_get_setting('openid_authentication') == 'true') {
696 696
         if (!empty($_POST['openid_url'])) {
697 697
             include api_get_path(SYS_CODE_PATH).'auth/openid/login.php';
698 698
             openid_begin(trim($_POST['openid_url']), api_get_path(WEB_PATH).'index.php');
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
             if ($res['status'] == 'success') {
706 706
                 $id1 = Database::escape_string($res['openid.identity']);
707 707
                 //have another id with or without the final '/'
708
-                $id2 = (substr($id1, -1, 1)=='/'?substr($id1, 0, -1):$id1.'/');
708
+                $id2 = (substr($id1, -1, 1) == '/' ? substr($id1, 0, -1) : $id1.'/');
709 709
                 //lookup the user in the main database
710 710
                 $user_table = Database::get_main_table(TABLE_MAIN_USER);
711 711
                 $sql = "SELECT user_id, username, password, auth_source, active, expiration_date
@@ -714,14 +714,14 @@  discard block
 block discarded – undo
714 714
                         OR openid = '$id2' ";
715 715
                 $result = Database::query($sql);
716 716
                 if ($result !== false) {
717
-                    if (Database::num_rows($result)>0) {
717
+                    if (Database::num_rows($result) > 0) {
718 718
                         $uData = Database::fetch_array($result);
719 719
 
720 720
                         if ($uData['auth_source'] == PLATFORM_AUTH_SOURCE) {
721 721
                             //the authentification of this user is managed by Chamilo itself
722 722
 
723 723
                             // check if the account is active (not locked)
724
-                            if ($uData['active']=='1') {
724
+                            if ($uData['active'] == '1') {
725 725
                                 // check if the expiration date has not been reached
726 726
                                 if ($uData['expiration_date'] > date('Y-m-d H:i:s')
727 727
                                     || empty($uData['expiration_date'])
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
     (isset($_SESSION['_cid']) && $cidReq != $_SESSION['_cid']))
801 801
 ) {
802 802
     $cidReset = true;
803
-    $gidReset = true;    // As groups depend from courses, group id is reset
803
+    $gidReset = true; // As groups depend from courses, group id is reset
804 804
 }
805 805
 
806 806
 /* USER INIT */
@@ -950,8 +950,8 @@  discard block
 block discarded – undo
950 950
             $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
951 951
 
952 952
             if (!empty($_GET['id_session'])) {
953
-                $sql = 'SELECT name FROM '.$tbl_session . '
954
-                        WHERE id="'.intval($_GET['id_session']) . '"';
953
+                $sql = 'SELECT name FROM '.$tbl_session.'
954
+                        WHERE id="'.intval($_GET['id_session']).'"';
955 955
                 $rs = Database::query($sql);
956 956
                 if (Database::num_rows($rs)) {
957 957
                     list($_SESSION['session_name']) = Database::fetch_array($rs);
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
         // Moreover, if we want to track a course with another session it can be usefull
1040 1040
         if (!empty($_GET['id_session']) && is_numeric($_GET['id_session'])) {
1041 1041
             $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
1042
-            $sql = 'SELECT name FROM '.$tbl_session . ' WHERE id="'.intval($_GET['id_session']). '"';
1042
+            $sql = 'SELECT name FROM '.$tbl_session.' WHERE id="'.intval($_GET['id_session']).'"';
1043 1043
             $rs = Database::query($sql);
1044 1044
             if (Database::num_rows($rs)) {
1045 1045
                 list($_SESSION['session_name']) = Database::fetch_array($rs);
@@ -1164,7 +1164,7 @@  discard block
 block discarded – undo
1164 1164
                     }
1165 1165
                 }
1166 1166
                 $url = api_get_path(WEB_CODE_PATH).'auth/inscription.php';
1167
-                header("Location:". $url);
1167
+                header("Location:".$url);
1168 1168
                 exit;
1169 1169
             }
1170 1170
         }
@@ -1185,8 +1185,8 @@  discard block
 block discarded – undo
1185 1185
         if (Database::num_rows($result) > 0) { // this  user have a recorded state for this course
1186 1186
             $cuData = Database::fetch_array($result, 'ASSOC');
1187 1187
 
1188
-            $is_courseAdmin = (bool)($cuData['status'] == 1);
1189
-            $is_courseTutor = (bool)($cuData['is_tutor'] == 1);
1188
+            $is_courseAdmin = (bool) ($cuData['status'] == 1);
1189
+            $is_courseTutor = (bool) ($cuData['is_tutor'] == 1);
1190 1190
             $is_courseMember = true;
1191 1191
         }
1192 1192
 
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
                 // This user has no status related to this course
1198 1198
                 // The user is subscribed in a session? The user is a Session coach a Session admin ?
1199 1199
 
1200
-                $tbl_session  = Database :: get_main_table(TABLE_MAIN_SESSION);
1200
+                $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
1201 1201
                 $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
1202 1202
                 $tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
1203 1203
 
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
 
1311 1311
             //If I'm the admin platform i'm a teacher of the course
1312 1312
             if ($is_platformAdmin) {
1313
-                $is_courseAdmin     = true;
1313
+                $is_courseAdmin = true;
1314 1314
             }
1315 1315
         }
1316 1316
     } else { // keys missing => not anymore in the course - user relation
@@ -1468,12 +1468,12 @@  discard block
 block discarded – undo
1468 1468
     ($logging_in && exist_firstpage_parameter())
1469 1469
 ) {
1470 1470
     $redirectCourseDir = api_get_firstpage_parameter();
1471
-    api_delete_firstpage_parameter();    // delete the cookie
1471
+    api_delete_firstpage_parameter(); // delete the cookie
1472 1472
 
1473 1473
     if (!isset($_SESSION['request_uri'])) {
1474 1474
         if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
1475 1475
             $_SESSION['noredirection'] = false;
1476
-            $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/';
1476
+            $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/';
1477 1477
         }
1478 1478
     }
1479 1479
 } elseif (api_user_is_login() && exist_firstpage_parameter()) {
@@ -1481,7 +1481,7 @@  discard block
 block discarded – undo
1481 1481
     api_delete_firstpage_parameter(); // delete the cookie
1482 1482
     if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
1483 1483
         $_SESSION['noredirection'] = false;
1484
-        $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/';
1484
+        $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/';
1485 1485
     }
1486 1486
 }
1487 1487
 
Please login to merge, or discard this patch.
main/inc/lib/AnnouncementEmail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@
 block discarded – undo
196 196
      *
197 197
      * @return array
198 198
      */
199
-    public function sender($key = '',  $userId = '')
199
+    public function sender($key = '', $userId = '')
200 200
     {
201 201
         $_user = api_get_user_info($userId);
202 202
 
Please login to merge, or discard this patch.
main/inc/lib/custom_pages.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public static function path($name = '')
37 37
     {
38
-        return api_get_path(SYS_PATH) . 'custompages/' . $name;
38
+        return api_get_path(SYS_PATH).'custompages/'.$name;
39 39
     }
40 40
 
41 41
     /**
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
             return false;
51 51
         }
52 52
 
53
-        $file = self::path($page_name . '.php');
53
+        $file = self::path($page_name.'.php');
54 54
         if (file_exists($file)) {
55 55
             include($file);
56 56
             exit;
57 57
         } else {
58
-            error_log('CustomPages::displayPage : could not read file ' . $file);
58
+            error_log('CustomPages::displayPage : could not read file '.$file);
59 59
         }
60 60
     }
61 61
 
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
     public static function getURLImages($url_id = null)
70 70
     {
71 71
         if (is_null($url_id)) {
72
-            $url = 'http://' . $_SERVER['HTTP_HOST'] . '/';
72
+            $url = 'http://'.$_SERVER['HTTP_HOST'].'/';
73 73
             $url_id = UrlManager::get_url_id($url);
74 74
         }
75
-        $url_images_dir = api_get_path(SYS_PATH) . 'custompages/url-images/';
75
+        $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/';
76 76
         $images = array();
77 77
         for ($img_id = 1; $img_id <= 3; $img_id++) {
78
-            if (file_exists($url_images_dir . $url_id . '_url_image_' . $img_id . '.png')) {
79
-                $images[] = api_get_path(WEB_PATH) . 'custompages/url-images/' . $url_id . '_url_image_' . $img_id . '.png';
78
+            if (file_exists($url_images_dir.$url_id.'_url_image_'.$img_id.'.png')) {
79
+                $images[] = api_get_path(WEB_PATH).'custompages/url-images/'.$url_id.'_url_image_'.$img_id.'.png';
80 80
             }
81 81
         }
82 82
 
Please login to merge, or discard this patch.
main/inc/lib/redirect.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             self::navigate($url);
35 35
         }
36 36
 
37
-        $url = self::www() . $url;
37
+        $url = self::www().$url;
38 38
         self::navigate($url);
39 39
     }
40 40
 
@@ -67,25 +67,25 @@  discard block
 block discarded – undo
67 67
                     case COURSEMANAGER:
68 68
                         $redir = api_get_setting('teacher_page_after_login');
69 69
                         if (!empty($redir)) {
70
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
70
+                            self::navigate(api_get_path(WEB_PATH).$redir);
71 71
                         }
72 72
                         break;
73 73
                     case STUDENT:
74 74
                         $redir = api_get_setting('student_page_after_login');
75 75
                         if (!empty($redir)) {
76
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
76
+                            self::navigate(api_get_path(WEB_PATH).$redir);
77 77
                         }
78 78
                         break;
79 79
                     case DRH:
80 80
                         $redir = api_get_setting('drh_page_after_login');
81 81
                         if (!empty($redir)) {
82
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
82
+                            self::navigate(api_get_path(WEB_PATH).$redir);
83 83
                         }
84 84
                         break;
85 85
                     case SESSIONADMIN:
86 86
                         $redir = api_get_setting('sessionadmin_page_after_login');
87 87
                         if (!empty($redir)) {
88
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
88
+                            self::navigate(api_get_path(WEB_PATH).$redir);
89 89
                         }
90 90
                         break;
91 91
                     default:
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             }
112 112
             $page_after_login = api_get_setting('page_after_login');
113 113
             if (!empty($page_after_login)) {
114
-                self::navigate(api_get_path(WEB_PATH) . $page_after_login);
114
+                self::navigate(api_get_path(WEB_PATH).$page_after_login);
115 115
             }
116 116
         }
117 117
     }
Please login to merge, or discard this patch.
main/inc/lib/extra_field_value.lib.php 3 patches
Indentation   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -720,11 +720,11 @@  discard block
 block discarded – undo
720 720
         return false;
721 721
     }
722 722
 
723
-     /**
724
-     * @param int $itemId
725
-     * @param int $fieldId
726
-     * @return array
727
-     */
723
+        /**
724
+         * @param int $itemId
725
+         * @param int $fieldId
726
+         * @return array
727
+         */
728 728
     public function getAllValuesByItemAndField($itemId, $fieldId)
729 729
     {
730 730
         $fieldId = intval($fieldId);
@@ -847,7 +847,6 @@  discard block
 block discarded – undo
847 847
     /**
848 848
      * Deletes all values from an item
849 849
      * @param int $itemId (session id, course id, etc)
850
-
851 850
      * @assert (-1,-1) == null
852 851
      */
853 852
     public function deleteValuesByItem($itemId)
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
                             break;
217 217
                     }
218 218
 
219
-                    $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE . "_{$params['item_id']}.png";
219
+                    $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE."_{$params['item_id']}.png";
220 220
 
221 221
                     if (!file_exists($fileDir)) {
222 222
                         mkdir($fileDir, $dirPermissions, true);
@@ -226,15 +226,15 @@  discard block
 block discarded – undo
226 226
 
227 227
                         //Crop the image to adjust 16:9 ratio
228 228
                         $crop = new Image($value['tmp_name']);
229
-                        $crop->crop($params['extra_' . $field_variable . '_crop_result']);
229
+                        $crop->crop($params['extra_'.$field_variable.'_crop_result']);
230 230
 
231 231
                         $imageExtraField = new Image($value['tmp_name']);
232 232
                         $imageExtraField->resize(400);
233
-                        $imageExtraField->send_image($fileDir . $fileName, -1, 'png');
233
+                        $imageExtraField->send_image($fileDir.$fileName, -1, 'png');
234 234
                         $newParams = array(
235 235
                             'item_id' => $params['item_id'],
236 236
                             'field_id' => $extraFieldInfo['id'],
237
-                            'value' => $fileDirStored . $fileName,
237
+                            'value' => $fileDirStored.$fileName,
238 238
                             'comment' => $comment
239 239
                         );
240 240
 
@@ -260,18 +260,18 @@  discard block
 block discarded – undo
260 260
                     }
261 261
 
262 262
                     $cleanedName = api_replace_dangerous_char($value['name']);
263
-                    $fileName = ExtraField::FIELD_TYPE_FILE . "_{$params['item_id']}_$cleanedName";
263
+                    $fileName = ExtraField::FIELD_TYPE_FILE."_{$params['item_id']}_$cleanedName";
264 264
                     if (!file_exists($fileDir)) {
265 265
                         mkdir($fileDir, $dirPermissions, true);
266 266
                     }
267 267
 
268 268
                     if ($value['error'] == 0) {
269
-                        moveUploadedFile($value, $fileDir . $fileName);
269
+                        moveUploadedFile($value, $fileDir.$fileName);
270 270
 
271 271
                         $new_params = array(
272 272
                             'item_id' => $params['item_id'],
273 273
                             'field_id' => $extraFieldInfo['id'],
274
-                            'value' => $fileDirStored . $fileName
274
+                            'value' => $fileDirStored.$fileName
275 275
                         );
276 276
 
277 277
                         if ($this->type !== 'session' && $this->type !== 'course') {
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
                 */
412 412
                 if (false) {
413 413
                     global $app;
414
-                    switch($this->type) {
414
+                    switch ($this->type) {
415 415
                         case 'question':
416 416
                             $extraFieldValue = new ChamiloLMS\Entity\QuestionFieldValues();
417 417
                             $extraFieldValue->setUserId(api_get_user_id());
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
                 */
474 474
                 if (false) {
475 475
                     global $app;
476
-                    switch($this->type) {
476
+                    switch ($this->type) {
477 477
                         case 'question':
478 478
                             $extraFieldValue = $app['orm.ems']['db_write']->getRepository('ChamiloLMS\Entity\QuestionFieldValues')->find($field_values['id']);
479 479
                             $extraFieldValue->setUserId(api_get_user_id());
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * This function is used with $extraField->addElements()
76 76
      * @param array $params array for the insertion into the *_field_values table
77 77
      * @param bool $showQuery
78
-     * @return mixed false on empty params, void otherwise
78
+     * @return false|null false on empty params, void otherwise
79 79
      * @assert (array()) === false
80 80
      */
81 81
     public function saveFieldValues($params, $showQuery = false)
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
      * @param int $item_id Item ID (It could be a session_id, course_id or user_id)
532 532
      * @param int $field_id Field ID (the ID from the *_field table)
533 533
      * @param bool $transform Whether to transform the result to a human readable strings
534
-     * @return mixed A structured array with the field_id and field_value, or false on error
534
+     * @return string A structured array with the field_id and field_value, or false on error
535 535
      * @assert (-1,-1) === false
536 536
      */
537 537
     public function get_values_by_handler_and_field_id($item_id, $field_id, $transform = false)
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
      * @param int $item_id Item ID from the original table
625 625
      * @param string $field_variable The name of the field we are looking for
626 626
      * @param bool $transform
627
-     * @param bool $allVisibility
627
+     * @param bool $visibility
628 628
      *
629 629
      * @return mixed Array of results, or false on error or not found
630 630
      * @assert (-1,'') === false
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
      * @param string $field_value Data we are looking for in the given field
687 687
      * @param bool $transform Whether to transform the result to a human readable strings
688 688
      * @param bool $last Whether to return the last element or simply the first one we get
689
-     * @return mixed Give the ID if found, or false on failure or not found
689
+     * @return boolean|string Give the ID if found, or false on failure or not found
690 690
      * @assert (-1,-1) === false
691 691
      */
692 692
     public function get_item_id_from_field_variable_and_field_value(
Please login to merge, or discard this patch.
main/inc/lib/export.lib.inc.php 3 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         }
100 100
         foreach ($data as $row) {
101 101
             $string = implode("</td><td>", $row);
102
-            $string = '<tr><td>' . $string . '</td></tr>';
102
+            $string = '<tr><td>'.$string.'</td></tr>';
103 103
             if ($encoding != 'utf-8') {
104 104
                 $string = api_convert_encoding($string, $encoding, $systemEncoding);
105 105
             }
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
             fwrite($handle, '<'.$wrapper_tagname.'>');
174 174
         }
175 175
         $s = self::_export_complex_table_xml_helper($data);
176
-        fwrite($handle,$s);
176
+        fwrite($handle, $s);
177 177
         if (!is_null($wrapper_tagname)) {
178 178
             fwrite($handle, '</'.$wrapper_tagname.'>'."\n");
179 179
         }
@@ -195,10 +195,10 @@  discard block
 block discarded – undo
195 195
         }
196 196
         $string = '';
197 197
         foreach ($data as $row) {
198
-            $string .= "\n".str_repeat("\t",$level).'<'.$row['name'].'>';
198
+            $string .= "\n".str_repeat("\t", $level).'<'.$row['name'].'>';
199 199
             if (is_array($row['value'])) {
200
-            	$string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n";
201
-                $string .= str_repeat("\t",$level).'</'.$row['name'].'>';
200
+            	$string .= self::_export_complex_table_xml_helper($row['value'], $level + 1)."\n";
201
+                $string .= str_repeat("\t", $level).'</'.$row['name'].'>';
202 202
             } else {
203 203
                 $string .= $row['value'];
204 204
                 $string .= '</'.$row['name'].'>';
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      * @param array $data
39 39
      * @param string $filename
40 40
      *
41
-     * @return mixed csv file | false if no data to export
41
+     * @return false|null csv file | false if no data to export
42 42
      */
43 43
     public static function arrayToCsv($data, $filename = 'export')
44 44
     {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      * @param string Name of common tag to place each line in
161 161
      * @param string Name of the root element. A root element should always be given.
162 162
      * @param string Encoding in which the data is provided
163
-     * @return void  Prompts the user for a file download
163
+     * @return boolean  Prompts the user for a file download
164 164
      */
165 165
     public static function export_complex_table_xml(
166 166
         $data,
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
      * @param string $name
287 287
      * @param string $format
288 288
      *
289
-     * @return bool
289
+     * @return false|null
290 290
      */
291 291
     public static function htmlToOdt($html, $name, $format = 'odt')
292 292
     {
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
     }
116 116
 
117 117
     /**
118
-    * Export tabular data to XML-file
119
-    * @param array  Simple array of data to put in XML
120
-    * @param string Name of file to be given to the user
121
-    * @param string Name of common tag to place each line in
122
-    * @param string Name of the root element. A root element should always be given.
123
-    * @param string Encoding in which the data is provided
124
-    */
118
+     * Export tabular data to XML-file
119
+     * @param array  Simple array of data to put in XML
120
+     * @param string Name of file to be given to the user
121
+     * @param string Name of common tag to place each line in
122
+     * @param string Name of the root element. A root element should always be given.
123
+     * @param string Encoding in which the data is provided
124
+     */
125 125
     public static function arrayToXml(
126 126
         $data,
127 127
         $filename = 'export',
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         foreach ($data as $row) {
201 201
             $string .= "\n".str_repeat("\t",$level).'<'.$row['name'].'>';
202 202
             if (is_array($row['value'])) {
203
-            	$string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n";
203
+                $string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n";
204 204
                 $string .= str_repeat("\t",$level).'</'.$row['name'].'>';
205 205
             } else {
206 206
                 $string .= $row['value'];
Please login to merge, or discard this patch.
main/inc/lib/array.lib.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -108,24 +108,24 @@
 block discarded – undo
108 108
  */
109 109
 function utf8_sort($array)
110 110
 {
111
-	$old_locale = setlocale(LC_ALL, null);
112
-	$code = api_get_language_isocode();
113
-	$locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8');
114
-	$try_sort = false;
111
+    $old_locale = setlocale(LC_ALL, null);
112
+    $code = api_get_language_isocode();
113
+    $locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8');
114
+    $try_sort = false;
115 115
 
116
-	foreach($locale_list as $locale) {
117
-		$my_local = setlocale(LC_COLLATE, $locale);
118
-		if ($my_local) {
119
-			$try_sort = true;
120
-			break;
121
-		}
122
-	}
116
+    foreach($locale_list as $locale) {
117
+        $my_local = setlocale(LC_COLLATE, $locale);
118
+        if ($my_local) {
119
+            $try_sort = true;
120
+            break;
121
+        }
122
+    }
123 123
 
124
-	if ($try_sort) {
125
-		uasort($array, 'strcoll');
126
-	}
127
-	setlocale(LC_COLLATE, $old_locale);
128
-	return $array;
124
+    if ($try_sort) {
125
+        uasort($array, 'strcoll');
126
+    }
127
+    setlocale(LC_COLLATE, $old_locale);
128
+    return $array;
129 129
 }
130 130
 
131 131
 /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
 {
111 111
 	$old_locale = setlocale(LC_ALL, null);
112 112
 	$code = api_get_language_isocode();
113
-	$locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8');
113
+	$locale_list = array($code.'.utf8', 'en.utf8', 'en_US.utf8', 'en_GB.utf8');
114 114
 	$try_sort = false;
115 115
 
116
-	foreach($locale_list as $locale) {
116
+	foreach ($locale_list as $locale) {
117 117
 		$my_local = setlocale(LC_COLLATE, $locale);
118 118
 		if ($my_local) {
119 119
 			$try_sort = true;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     $flatten = array();
152 152
     array_walk_recursive(
153 153
         $array,
154
-        function ($value) use (&$flatten) {
154
+        function($value) use (&$flatten) {
155 155
             $flatten[] = $value;
156 156
         }
157 157
     );
Please login to merge, or discard this patch.