Completed
Push — master ( 3fdf06...e648ff )
by Julito
33:51
created
main/inc/lib/course.lib.php 2 patches
Doc Comments   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
      * @param  string $courseCode the course code
793 793
      * @param  int $visible (optional) The course visibility in the catalogue to the user (1=visible, 0=invisible)
794 794
      *
795
-     * @return boolean true if added successfully, false otherwise.
795
+     * @return boolean|string true if added successfully, false otherwise.
796 796
      */
797 797
     public static function addUserVisibilityToCourseInCatalogue($userId, $courseCode, $visible = 1)
798 798
     {
@@ -2636,7 +2636,7 @@  discard block
 block discarded – undo
2636 2636
      * then the courses that the user is allowed or not to see in catalogue
2637 2637
      *
2638 2638
      * @param boolean $allowed Either if the courses have some users that are or are not allowed to see in catalogue
2639
-     * @param boolean $byUserId if the courses are or are not allowed to see to the user
2639
+     * @param integer $byUserId if the courses are or are not allowed to see to the user
2640 2640
      * @return array Course codes allowed or not to see in catalogue by some user or the user
2641 2641
      */
2642 2642
     public static function getCatalogueCourseList($allowed = true, $byUserId = -1)
@@ -3180,6 +3180,7 @@  discard block
 block discarded – undo
3180 3180
      * @param int $limit
3181 3181
      * @param string $column
3182 3182
      * @param string $direction
3183
+     * @param integer $status
3183 3184
      * @return array    courses
3184 3185
      */
3185 3186
     public static function get_courses_followed_by_drh(
@@ -4772,7 +4773,7 @@  discard block
 block discarded – undo
4772 4773
      * Returns an array with the hottest courses
4773 4774
      * @param   int $days number of days
4774 4775
      * @param   int $limit number of hottest courses
4775
-     * @return array
4776
+     * @return null|Symfony\Component\HttpFoundation\Response
4776 4777
      */
4777 4778
     public static function return_hot_courses($days = 30, $limit = 6)
4778 4779
     {
@@ -5027,7 +5028,7 @@  discard block
 block discarded – undo
5027 5028
     /**
5028 5029
      * Returns the SQL conditions to filter course only visible by the user in the catalogue
5029 5030
      *
5030
-     * @param $courseTableAlias Alias of the course table
5031
+     * @param string $courseTableAlias Alias of the course table
5031 5032
      * @return string SQL conditions
5032 5033
      */
5033 5034
     public static function getCourseVisibilitySQLCondition($courseTableAlias) {
@@ -6119,11 +6120,11 @@  discard block
 block discarded – undo
6119 6120
 
6120 6121
     /**
6121 6122
      * @param int $user_id
6122
-     * @param $filter
6123
+     * @param string $filter
6123 6124
      * @param bool $load_dirs
6124 6125
      * @param int $getCount
6125 6126
      * @param int $start
6126
-     * @param null $maxPerPage
6127
+     * @param integer $maxPerPage
6127 6128
      * @return null|string
6128 6129
      */
6129 6130
     public static function displayCourses($user_id, $filter, $load_dirs, $getCount, $start = null, $maxPerPage = null)
Please login to merge, or discard this patch.
Spacing   +339 added lines, -340 removed lines patch added patch discarded remove patch
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
     {
178 178
         return Database::fetch_array(
179 179
             Database::query(
180
-                "SELECT *, id as real_id FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . "
181
-                WHERE code='" . Database::escape_string($course_code) . "'"), 'ASSOC'
180
+                "SELECT *, id as real_id FROM ".Database::get_main_table(TABLE_MAIN_COURSE)."
181
+                WHERE code='" . Database::escape_string($course_code)."'"), 'ASSOC'
182 182
         );
183 183
     }
184 184
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
         $alsoSearchCode = false,
207 207
         $conditionsLike = array()
208 208
     ) {
209
-        $sql = "SELECT course.* FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . " course ";
209
+        $sql = "SELECT course.* FROM ".Database::get_main_table(TABLE_MAIN_COURSE)." course ";
210 210
 
211 211
         if (!empty($urlId)) {
212 212
             $table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
@@ -214,9 +214,9 @@  discard block
 block discarded – undo
214 214
         }
215 215
 
216 216
         if (!empty($startwith)) {
217
-            $sql .= "WHERE (title LIKE '" . Database::escape_string($startwith) . "%' ";
217
+            $sql .= "WHERE (title LIKE '".Database::escape_string($startwith)."%' ";
218 218
             if ($alsoSearchCode) {
219
-                $sql .= "OR code LIKE '" . Database::escape_string($startwith) . "%' ";
219
+                $sql .= "OR code LIKE '".Database::escape_string($startwith)."%' ";
220 220
             }
221 221
             $sql .= ') ';
222 222
             if ($visibility !== -1 && $visibility == strval(intval($visibility))) {
@@ -250,19 +250,19 @@  discard block
 block discarded – undo
250 250
                 $value = Database::escape_string($value);
251 251
                 $simple_like = false;
252 252
                 if ($simple_like) {
253
-                    $temp_conditions[] = $field . " LIKE '$value%'";
253
+                    $temp_conditions[] = $field." LIKE '$value%'";
254 254
                 } else {
255
-                    $temp_conditions[] = $field . ' LIKE \'%' . $value . '%\'';
255
+                    $temp_conditions[] = $field.' LIKE \'%'.$value.'%\'';
256 256
                 }
257 257
             }
258 258
             $condition = ' AND ';
259 259
             if (!empty($temp_conditions)) {
260
-                $sql .= implode(' ' . $condition . ' ', $temp_conditions);
260
+                $sql .= implode(' '.$condition.' ', $temp_conditions);
261 261
             }
262 262
         }
263 263
 
264 264
         if (!empty($orderby)) {
265
-            $sql .= " ORDER BY " . Database::escape_string($orderby) . " ";
265
+            $sql .= " ORDER BY ".Database::escape_string($orderby)." ";
266 266
         } else {
267 267
             $sql .= " ORDER BY 1 ";
268 268
         }
@@ -274,13 +274,13 @@  discard block
 block discarded – undo
274 274
         }
275 275
 
276 276
         if (!empty($howmany) && is_int($howmany) and $howmany > 0) {
277
-            $sql .= ' LIMIT ' . Database::escape_string($howmany);
277
+            $sql .= ' LIMIT '.Database::escape_string($howmany);
278 278
         } else {
279 279
             $sql .= ' LIMIT 1000000'; //virtually no limit
280 280
         }
281 281
         if (!empty($from)) {
282 282
             $from = intval($from);
283
-            $sql .= ' OFFSET ' . intval($from);
283
+            $sql .= ' OFFSET '.intval($from);
284 284
         } else {
285 285
             $sql .= ' OFFSET 0';
286 286
         }
@@ -312,10 +312,10 @@  discard block
 block discarded – undo
312 312
 
313 313
         $result = Database::fetch_array(
314 314
             Database::query(
315
-                "SELECT status FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . "
315
+                "SELECT status FROM ".Database::get_main_table(TABLE_MAIN_COURSE_USER)."
316 316
                 WHERE
317 317
                     c_id  = $courseId AND
318
-                    user_id = " . intval($userId)
318
+                    user_id = ".intval($userId)
319 319
             )
320 320
         );
321 321
 
@@ -333,9 +333,9 @@  discard block
 block discarded – undo
333 333
 
334 334
         $result = Database::fetch_array(
335 335
             Database::query("
336
-                SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . "
336
+                SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER)."
337 337
                 WHERE
338
-                    c_id  = '" . intval($courseId). "' AND
338
+                    c_id  = '" . intval($courseId)."' AND
339 339
                     user_id = " . intval($userId)
340 340
             )
341 341
         );
@@ -382,9 +382,9 @@  discard block
 block discarded – undo
382 382
         $result = Database::fetch_array(
383 383
             Database::query("
384 384
                 SELECT is_tutor
385
-                FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . "
385
+                FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER)."
386 386
                 WHERE
387
-                    c_id = '" . Database::escape_string($courseId) . "' AND
387
+                    c_id = '" . Database::escape_string($courseId)."' AND
388 388
                     user_id = " . intval($user_id)
389 389
             )
390 390
         );
@@ -437,17 +437,17 @@  discard block
 block discarded – undo
437 437
         $course_id = $course_info['real_id'];
438 438
 
439 439
         // Unsubscribe user from all groups in the course.
440
-        $sql = "DELETE FROM " . Database::get_course_table(TABLE_GROUP_USER) . "
441
-                WHERE c_id = $course_id AND user_id IN (" . $user_ids . ")";
440
+        $sql = "DELETE FROM ".Database::get_course_table(TABLE_GROUP_USER)."
441
+                WHERE c_id = $course_id AND user_id IN (".$user_ids.")";
442 442
         Database::query($sql);
443
-        $sql = "DELETE FROM " . Database::get_course_table(TABLE_GROUP_TUTOR) . "
444
-                WHERE c_id = $course_id AND user_id IN (" . $user_ids . ")";
443
+        $sql = "DELETE FROM ".Database::get_course_table(TABLE_GROUP_TUTOR)."
444
+                WHERE c_id = $course_id AND user_id IN (".$user_ids.")";
445 445
         Database::query($sql);
446 446
 
447 447
         // Erase user student publications (works) in the course - by André Boivin
448 448
 
449 449
         if (!empty($user_list)) {
450
-            require_once api_get_path(SYS_CODE_PATH) . 'work/work.lib.php';
450
+            require_once api_get_path(SYS_CODE_PATH).'work/work.lib.php';
451 451
             foreach ($user_list as $userId) {
452 452
                 // Getting all work from user
453 453
                 $workList = getWorkPerUser($userId);
@@ -466,74 +466,74 @@  discard block
 block discarded – undo
466 466
         }
467 467
 
468 468
         // Unsubscribe user from all blogs in the course.
469
-        Database::query("DELETE FROM " . Database::get_course_table(TABLE_BLOGS_REL_USER) . " WHERE c_id = $course_id AND  user_id IN (" . $user_ids . ")");
470
-        Database::query("DELETE FROM " . Database::get_course_table(TABLE_BLOGS_TASKS_REL_USER) . " WHERE c_id = $course_id AND  user_id IN (" . $user_ids . ")");
469
+        Database::query("DELETE FROM ".Database::get_course_table(TABLE_BLOGS_REL_USER)." WHERE c_id = $course_id AND  user_id IN (".$user_ids.")");
470
+        Database::query("DELETE FROM ".Database::get_course_table(TABLE_BLOGS_TASKS_REL_USER)." WHERE c_id = $course_id AND  user_id IN (".$user_ids.")");
471 471
 
472 472
         // Deleting users in forum_notification and mailqueue course tables
473
-        $sql = "DELETE FROM  " . Database::get_course_table(TABLE_FORUM_NOTIFICATION) . "
474
-                WHERE c_id = $course_id AND user_id IN (" . $user_ids . ")";
473
+        $sql = "DELETE FROM  ".Database::get_course_table(TABLE_FORUM_NOTIFICATION)."
474
+                WHERE c_id = $course_id AND user_id IN (".$user_ids.")";
475 475
         Database::query($sql);
476 476
 
477
-        $sql = "DELETE FROM " . Database::get_course_table(TABLE_FORUM_MAIL_QUEUE) . "
478
-                WHERE c_id = $course_id AND user_id IN (" . $user_ids . ")";
477
+        $sql = "DELETE FROM ".Database::get_course_table(TABLE_FORUM_MAIL_QUEUE)."
478
+                WHERE c_id = $course_id AND user_id IN (".$user_ids.")";
479 479
         Database::query($sql);
480 480
 
481 481
         // Unsubscribe user from the course.
482 482
         if (!empty($session_id)) {
483 483
 
484 484
             // Delete in table session_rel_course_rel_user
485
-            $sql = "DELETE FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . "
485
+            $sql = "DELETE FROM ".Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)."
486 486
                     WHERE
487
-                        session_id ='" . $session_id . "' AND
488
-                        c_id = '" . $course_id . "' AND
487
+                        session_id ='" . $session_id."' AND
488
+                        c_id = '" . $course_id."' AND
489 489
                         user_id IN ($user_ids)";
490 490
             Database::query($sql);
491 491
 
492 492
             foreach ($user_list as $uid) {
493 493
                 // check if a user is register in the session with other course
494
-                $sql = "SELECT user_id FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . "
494
+                $sql = "SELECT user_id FROM ".Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)."
495 495
                         WHERE session_id='$session_id' AND user_id='$uid'";
496 496
                 $rs = Database::query($sql);
497 497
 
498 498
                 if (Database::num_rows($rs) == 0) {
499 499
                     // Delete in table session_rel_user
500
-                    $sql = "DELETE FROM " . Database::get_main_table(TABLE_MAIN_SESSION_USER) . "
500
+                    $sql = "DELETE FROM ".Database::get_main_table(TABLE_MAIN_SESSION_USER)."
501 501
                             WHERE
502
-                                session_id ='" . $session_id . "' AND
502
+                                session_id ='" . $session_id."' AND
503 503
                                 user_id = '$uid' AND
504
-                                relation_type<>" . SESSION_RELATION_TYPE_RRHH . "";
504
+                                relation_type<>".SESSION_RELATION_TYPE_RRHH."";
505 505
                     Database::query($sql);
506 506
                 }
507 507
             }
508 508
 
509 509
             // Update the table session
510
-            $sql = "SELECT COUNT(*) FROM " . Database::get_main_table(TABLE_MAIN_SESSION_USER) . "
511
-                    WHERE session_id = '" . $session_id . "' AND relation_type <> " . SESSION_RELATION_TYPE_RRHH;
510
+            $sql = "SELECT COUNT(*) FROM ".Database::get_main_table(TABLE_MAIN_SESSION_USER)."
511
+                    WHERE session_id = '" . $session_id."' AND relation_type <> ".SESSION_RELATION_TYPE_RRHH;
512 512
             $row = Database::fetch_array(Database::query($sql));
513 513
             $count = $row[0];
514 514
             // number of users by session
515
-            $sql = "UPDATE " . Database::get_main_table(TABLE_MAIN_SESSION) . " SET nbr_users = '$count'
516
-                    WHERE id = '" . $session_id . "'";
515
+            $sql = "UPDATE ".Database::get_main_table(TABLE_MAIN_SESSION)." SET nbr_users = '$count'
516
+                    WHERE id = '".$session_id."'";
517 517
             Database::query($sql);
518 518
 
519 519
             // Update the table session_rel_course
520
-            $sql = "SELECT COUNT(*) FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . "
520
+            $sql = "SELECT COUNT(*) FROM ".Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)."
521 521
                     WHERE session_id = '$session_id' AND c_id = '$course_id' AND status<>2";
522 522
             $row = Database::fetch_array(@Database::query($sql));
523 523
             $count = $row[0];
524 524
 
525 525
             // number of users by session and course
526
-            $sql = "UPDATE " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE) . "
526
+            $sql = "UPDATE ".Database::get_main_table(TABLE_MAIN_SESSION_COURSE)."
527 527
                     SET nbr_users = '$count'
528 528
                     WHERE session_id = '$session_id' AND c_id = '$course_id'";
529 529
             Database::query($sql);
530 530
 
531 531
         } else {
532
-            $sql = "DELETE FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . "
532
+            $sql = "DELETE FROM ".Database::get_main_table(TABLE_MAIN_COURSE_USER)."
533 533
                     WHERE
534
-                        user_id IN (" . $user_ids . ") AND
535
-                        relation_type<>" . COURSE_RELATION_TYPE_RRHH . " AND
536
-                        c_id = '" . $course_id . "'";
534
+                        user_id IN (" . $user_ids.") AND
535
+                        relation_type<>" . COURSE_RELATION_TYPE_RRHH." AND
536
+                        c_id = '" . $course_id."'";
537 537
             Database::query($sql);
538 538
 
539 539
             // add event to system log
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 
604 604
         // A preliminary check whether the user has bben already registered on the platform.
605 605
         if (Database::num_rows(Database::query(
606
-                "SELECT status FROM " . Database::get_main_table(TABLE_MAIN_USER) . "
606
+                "SELECT status FROM ".Database::get_main_table(TABLE_MAIN_USER)."
607 607
                 WHERE user_id = '$user_id' ")) == 0
608 608
         ) {
609 609
             return false; // The user has not been registered to the platform.
@@ -613,8 +613,8 @@  discard block
 block discarded – undo
613 613
 
614 614
         if (empty($session_id)) {
615 615
             if (Database::num_rows(Database::query("
616
-                    SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . "
617
-                    WHERE user_id = '$user_id' AND relation_type<>" . COURSE_RELATION_TYPE_RRHH . " AND c_id = '$courseId'")) > 0
616
+                    SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER)."
617
+                    WHERE user_id = '$user_id' AND relation_type<>".COURSE_RELATION_TYPE_RRHH." AND c_id = '$courseId'")) > 0
618 618
             ) {
619 619
                 // The user has been already subscribed to the course.
620 620
                 return false;
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
         $courseId = $courseInfo['real_id'];
737 737
 
738 738
         // Check in advance whether the user has already been registered on the platform.
739
-        $sql = "SELECT status FROM " . $user_table . " WHERE user_id = $user_id ";
739
+        $sql = "SELECT status FROM ".$user_table." WHERE user_id = $user_id ";
740 740
         if (Database::num_rows(Database::query($sql)) == 0) {
741 741
             if ($debug) {
742 742
                 error_log('The user has not been registered to the platform');
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
         $sql = "SELECT * FROM $course_user_table
749 749
                 WHERE
750 750
                     user_id = $user_id AND
751
-                    relation_type <> " . COURSE_RELATION_TYPE_RRHH . " AND
751
+                    relation_type <> ".COURSE_RELATION_TYPE_RRHH." AND
752 752
                     c_id = $courseId";
753 753
         if (Database::num_rows(Database::query($sql)) > 0) {
754 754
             if ($debug) {
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
         if (!api_is_course_admin()) {
761 761
             // Check in advance whether subscription is allowed or not for this course.
762 762
             $sql = "SELECT code, visibility FROM $course_table
763
-                    WHERE id = $courseId AND subscribe = '" . SUBSCRIBE_NOT_ALLOWED . "'";
763
+                    WHERE id = $courseId AND subscribe = '".SUBSCRIBE_NOT_ALLOWED."'";
764 764
             if (Database::num_rows(Database::query($sql)) > 0) {
765 765
                 if ($debug) {
766 766
                     error_log('Subscription is not allowed for this course');
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
         $courseId = $courseInfo['real_id'];
810 810
 
811 811
         // Check in advance whether the user has already been registered on the platform.
812
-        $sql = "SELECT status FROM " . $userTable . " WHERE user_id = $userId ";
812
+        $sql = "SELECT status FROM ".$userTable." WHERE user_id = $userId ";
813 813
         if (Database::num_rows(Database::query($sql)) == 0) {
814 814
             if ($debug) {
815 815
                 error_log('The user has not been registered to the platform');
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
         $sql = "SELECT * FROM $courseUserTable
822 822
                 WHERE
823 823
                     user_id = $userId AND
824
-                    visible = " . $visible . " AND
824
+                    visible = ".$visible." AND
825 825
                     c_id = $courseId";
826 826
         if (Database::num_rows(Database::query($sql)) > 0) {
827 827
             if ($debug) {
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
         $sql = "SELECT * FROM $courseUserTable
869 869
                 WHERE
870 870
                     user_id = $userId AND
871
-                    visible = " . $visible . " AND
871
+                    visible = ".$visible." AND
872 872
                     c_id = $courseId";
873 873
         if (Database::num_rows(Database::query($sql)) > 0) {
874 874
             $cond = array(
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
     {
893 893
         $wanted_course_code = Database::escape_string($wanted_course_code);
894 894
         $sql = "SELECT COUNT(*) as number
895
-                FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . "
895
+                FROM " . Database::get_main_table(TABLE_MAIN_COURSE)."
896 896
                 WHERE code = '$wanted_course_code' OR visual_code = '$wanted_course_code'";
897 897
         $result = Database::fetch_array(Database::query($sql));
898 898
 
@@ -1088,7 +1088,7 @@  discard block
 block discarded – undo
1088 1088
         $sql = "SELECT * FROM $table
1089 1089
                 WHERE
1090 1090
                     user_id = $userId AND
1091
-                    relation_type = " . COURSE_RELATION_TYPE_RRHH . " AND
1091
+                    relation_type = ".COURSE_RELATION_TYPE_RRHH." AND
1092 1092
                     c_id = $courseId";
1093 1093
 
1094 1094
         $result = Database::fetch_array(Database::query($sql));
@@ -1127,13 +1127,13 @@  discard block
 block discarded – undo
1127 1127
                 return false;
1128 1128
             }
1129 1129
             $courseId = $courseInfo['real_id'];
1130
-            $condition_course = ' AND c_id = ' . $courseId;
1130
+            $condition_course = ' AND c_id = '.$courseId;
1131 1131
         }
1132 1132
 
1133
-        $sql = "SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . "
1133
+        $sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE_USER)."
1134 1134
                 WHERE
1135 1135
                     user_id = $user_id AND
1136
-                    relation_type<>" . COURSE_RELATION_TYPE_RRHH . "
1136
+                    relation_type<>".COURSE_RELATION_TYPE_RRHH."
1137 1137
                     $condition_course ";
1138 1138
 
1139 1139
         $result = Database::fetch_array(Database::query($sql));
@@ -1149,20 +1149,20 @@  discard block
 block discarded – undo
1149 1149
         }
1150 1150
 
1151 1151
         $tableSessionCourseUser = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
1152
-        $sql = 'SELECT 1 FROM ' . $tableSessionCourseUser .
1153
-            ' WHERE user_id = ' . $user_id . ' ' . $condition_course;
1152
+        $sql = 'SELECT 1 FROM '.$tableSessionCourseUser.
1153
+            ' WHERE user_id = '.$user_id.' '.$condition_course;
1154 1154
         if (Database::num_rows(Database::query($sql)) > 0) {
1155 1155
             return true;
1156 1156
         }
1157 1157
 
1158
-        $sql = 'SELECT 1 FROM ' . $tableSessionCourseUser .
1159
-            ' WHERE user_id = ' . $user_id . ' AND status=2 ' . $condition_course;
1158
+        $sql = 'SELECT 1 FROM '.$tableSessionCourseUser.
1159
+            ' WHERE user_id = '.$user_id.' AND status=2 '.$condition_course;
1160 1160
         if (Database::num_rows(Database::query($sql)) > 0) {
1161 1161
             return true;
1162 1162
         }
1163 1163
 
1164
-        $sql = 'SELECT 1 FROM ' . Database::get_main_table(TABLE_MAIN_SESSION) .
1165
-            ' WHERE id = ' . $session_id . ' AND id_coach=' . $user_id;
1164
+        $sql = 'SELECT 1 FROM '.Database::get_main_table(TABLE_MAIN_SESSION).
1165
+            ' WHERE id = '.$session_id.' AND id_coach='.$user_id;
1166 1166
 
1167 1167
         if (Database::num_rows(Database::query($sql)) > 0) {
1168 1168
             return true;
@@ -1189,8 +1189,8 @@  discard block
 block discarded – undo
1189 1189
         $courseId = $courseInfo['real_id'];
1190 1190
 
1191 1191
         $result = Database::query(
1192
-            'SELECT status FROM ' . Database::get_main_table(TABLE_MAIN_COURSE_USER) .
1193
-            ' WHERE c_id = ' . $courseId . ' AND user_id = ' . $user_id . ''
1192
+            'SELECT status FROM '.Database::get_main_table(TABLE_MAIN_COURSE_USER).
1193
+            ' WHERE c_id = '.$courseId.' AND user_id = '.$user_id.''
1194 1194
         );
1195 1195
 
1196 1196
         if (Database::num_rows($result) > 0) {
@@ -1220,12 +1220,12 @@  discard block
 block discarded – undo
1220 1220
             $result = Database::fetch_array(
1221 1221
                 Database::query(
1222 1222
                     "SELECT *
1223
-                    FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . " course
1224
-                    LEFT JOIN " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " course_user
1223
+                    FROM " . Database::get_main_table(TABLE_MAIN_COURSE)." course
1224
+                    LEFT JOIN " . Database::get_main_table(TABLE_MAIN_COURSE_USER)." course_user
1225 1225
                     ON course.id = course_user.c_id
1226 1226
                     WHERE
1227 1227
                         course_user.user_id = '$user_id' AND
1228
-                        course_user.relation_type<>" . COURSE_RELATION_TYPE_RRHH . " AND
1228
+                        course_user.relation_type<>".COURSE_RELATION_TYPE_RRHH." AND
1229 1229
                         ( course.id = '$courseId')"
1230 1230
                 )
1231 1231
             );
@@ -1239,8 +1239,8 @@  discard block
 block discarded – undo
1239 1239
 
1240 1240
         // A user?
1241 1241
         if (Database::num_rows(Database::query("SELECT user_id
1242
-                FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . "
1243
-                WHERE session_id='" . $session_id . "'
1242
+                FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)."
1243
+                WHERE session_id='" . $session_id."'
1244 1244
                 AND user_id ='$user_id'"))
1245 1245
         ) {
1246 1246
             return true;
@@ -1248,8 +1248,8 @@  discard block
 block discarded – undo
1248 1248
 
1249 1249
         // A course coach?
1250 1250
         if (Database::num_rows(Database::query("SELECT user_id
1251
-                FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . "
1252
-                WHERE session_id='" . $session_id . "'
1251
+                FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)."
1252
+                WHERE session_id='" . $session_id."'
1253 1253
                 AND user_id = '$user_id' AND status = 2
1254 1254
                 AND c_id ='$courseId'"))
1255 1255
         ) {
@@ -1258,8 +1258,8 @@  discard block
 block discarded – undo
1258 1258
 
1259 1259
         // A session coach?
1260 1260
         if (Database::num_rows(Database::query("SELECT id_coach
1261
-                FROM " . Database::get_main_table(TABLE_MAIN_SESSION) . " AS session
1262
-                WHERE session.id='" . $session_id . "'
1261
+                FROM " . Database::get_main_table(TABLE_MAIN_SESSION)." AS session
1262
+                WHERE session.id='" . $session_id."'
1263 1263
                 AND id_coach='$user_id'"))
1264 1264
         ) {
1265 1265
             return true;
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
         // we have to check if it is a valid field that can be sorted on
1328 1328
         if (!strstr($order_by, 'ORDER BY')) {
1329 1329
             if (!empty($order_by)) {
1330
-                $order_by = 'ORDER BY ' . $order_by;
1330
+                $order_by = 'ORDER BY '.$order_by;
1331 1331
             } else {
1332 1332
                 $order_by = '';
1333 1333
             }
@@ -1359,11 +1359,11 @@  discard block
 block discarded – undo
1359 1359
             if (!empty($courseCodeList)) {
1360 1360
                 $courseCodeListForSession = array_map(array('Database', 'escape_string'), $courseCodeList);
1361 1361
                 $courseCodeListForSession = implode('","', $courseCodeListForSession);
1362
-                $courseCondition = ' course.code IN ("' . $courseCodeListForSession . '")  ';
1362
+                $courseCondition = ' course.code IN ("'.$courseCodeListForSession.'")  ';
1363 1363
             }
1364 1364
 
1365
-            $sql .= ' FROM ' . Database::get_main_table(TABLE_MAIN_USER) . ' as user ';
1366
-            $sql .= " LEFT JOIN ".Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . " as session_course_user
1365
+            $sql .= ' FROM '.Database::get_main_table(TABLE_MAIN_USER).' as user ';
1366
+            $sql .= " LEFT JOIN ".Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)." as session_course_user
1367 1367
                       ON
1368 1368
                         user.id = session_course_user.user_id AND
1369 1369
                         $sessionCondition
@@ -1404,15 +1404,15 @@  discard block
 block discarded – undo
1404 1404
                 }
1405 1405
             }
1406 1406
 
1407
-            $sql .= ' FROM ' . Database::get_main_table(TABLE_MAIN_USER) . ' as user '
1408
-                  . ' LEFT JOIN ' . Database::get_main_table(TABLE_MAIN_COURSE_USER) . ' as course_rel_user
1407
+            $sql .= ' FROM '.Database::get_main_table(TABLE_MAIN_USER).' as user '
1408
+                  . ' LEFT JOIN '.Database::get_main_table(TABLE_MAIN_COURSE_USER).' as course_rel_user
1409 1409
                       ON 
1410 1410
                         user.id = course_rel_user.user_id AND
1411
-                        course_rel_user.relation_type <> ' . COURSE_RELATION_TYPE_RRHH . '  '
1411
+                        course_rel_user.relation_type <> ' . COURSE_RELATION_TYPE_RRHH.'  '
1412 1412
                   . " INNER JOIN $course_table course ON course_rel_user.c_id = course.id ";
1413 1413
 
1414 1414
             if (!empty($course_code)) {
1415
-                $sql .= ' AND course_rel_user.c_id = "' . $courseId . '"';
1415
+                $sql .= ' AND course_rel_user.c_id = "'.$courseId.'"';
1416 1416
             }
1417 1417
             $where[] = ' course_rel_user.c_id IS NOT NULL ';
1418 1418
 
@@ -1424,7 +1424,7 @@  discard block
 block discarded – undo
1424 1424
 
1425 1425
         $multiple_access_url = api_get_multiple_access_url();
1426 1426
         if ($multiple_access_url) {
1427
-            $sql .= ' LEFT JOIN ' . Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER) . ' au
1427
+            $sql .= ' LEFT JOIN '.Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER).' au
1428 1428
                       ON (au.user_id = user.id) ';
1429 1429
         }
1430 1430
 
@@ -1444,7 +1444,7 @@  discard block
 block discarded – undo
1444 1444
             }
1445 1445
         }
1446 1446
 
1447
-        $sql .= ' WHERE ' . $filter_by_status_condition . ' ' . implode(' OR ', $where);
1447
+        $sql .= ' WHERE '.$filter_by_status_condition.' '.implode(' OR ', $where);
1448 1448
 
1449 1449
         if ($multiple_access_url) {
1450 1450
             $current_access_url_id = api_get_current_access_url_id();
@@ -1466,15 +1466,15 @@  discard block
 block discarded – undo
1466 1466
         if (!empty($userIdList)) {
1467 1467
             $userIdList = array_map('intval', $userIdList);
1468 1468
             $userIdList = implode('","', $userIdList);
1469
-            $sql .= ' AND user.id IN ("' . $userIdList . '")';
1469
+            $sql .= ' AND user.id IN ("'.$userIdList.'")';
1470 1470
         }
1471 1471
 
1472 1472
         if (isset($filterByActive)) {
1473 1473
             $filterByActive = intval($filterByActive);
1474
-            $sql .= ' AND user.active = ' . $filterByActive;
1474
+            $sql .= ' AND user.active = '.$filterByActive;
1475 1475
         }
1476 1476
 
1477
-        $sql .= ' ' . $order_by . ' ' . $limit;
1477
+        $sql .= ' '.$order_by.' '.$limit;
1478 1478
 
1479 1479
         $rs = Database::query($sql);
1480 1480
         $users = array();
@@ -1620,7 +1620,7 @@  discard block
 block discarded – undo
1620 1620
                             )
1621 1621
                         );
1622 1622
                         $report_info['progress_100'] = $progress == 100 ? Display::label(get_lang('Yes'), 'success') : Display::label(get_lang('No'));
1623
-                        $report_info['progress'] = $progress . "%";
1623
+                        $report_info['progress'] = $progress."%";
1624 1624
 
1625 1625
                         foreach ($extra_fields as $extra) {
1626 1626
                             $user_data = UserManager::get_extra_user_data_by_field($user['user_id'], $extra['1']);
@@ -1690,32 +1690,32 @@  discard block
 block discarded – undo
1690 1690
         $courseId = $courseInfo['real_id'];
1691 1691
 
1692 1692
         $sql = 'SELECT DISTINCT count(user.id) as count  
1693
-                FROM ' . Database::get_main_table(TABLE_MAIN_USER) . ' as user ';
1693
+                FROM ' . Database::get_main_table(TABLE_MAIN_USER).' as user ';
1694 1694
         $where = array();
1695 1695
         if (!empty($session_id)) {
1696
-            $sql .= ' LEFT JOIN ' . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . ' as session_course_user
1696
+            $sql .= ' LEFT JOIN '.Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER).' as session_course_user
1697 1697
                       ON
1698 1698
                         user.user_id = session_course_user.user_id AND
1699
-                        session_course_user.c_id = "' . $courseId . '" AND
1699
+                        session_course_user.c_id = "' . $courseId.'" AND
1700 1700
                         session_course_user.session_id  = ' . $session_id;
1701 1701
 
1702 1702
             $where[] = ' session_course_user.c_id IS NOT NULL ';
1703 1703
         } else {
1704
-            $sql .= ' LEFT JOIN ' . Database::get_main_table(TABLE_MAIN_COURSE_USER) . ' as course_rel_user
1704
+            $sql .= ' LEFT JOIN '.Database::get_main_table(TABLE_MAIN_COURSE_USER).' as course_rel_user
1705 1705
                         ON
1706 1706
                             user.user_id = course_rel_user.user_id AND
1707
-                            course_rel_user.relation_type<>' . COURSE_RELATION_TYPE_RRHH . ' AND
1708
-                            course_rel_user.c_id = ' . $courseId ;
1707
+                            course_rel_user.relation_type<>' . COURSE_RELATION_TYPE_RRHH.' AND
1708
+                            course_rel_user.c_id = ' . $courseId;
1709 1709
             $where[] = ' course_rel_user.c_id IS NOT NULL ';
1710 1710
         }
1711 1711
 
1712 1712
         $multiple_access_url = api_get_multiple_access_url();
1713 1713
         if ($multiple_access_url) {
1714
-            $sql .= ' LEFT JOIN ' . Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER) . '  au
1714
+            $sql .= ' LEFT JOIN '.Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER).'  au
1715 1715
                       ON (au.user_id = user.user_id) ';
1716 1716
         }
1717 1717
 
1718
-        $sql .= ' WHERE ' . implode(' OR ', $where);
1718
+        $sql .= ' WHERE '.implode(' OR ', $where);
1719 1719
 
1720 1720
         if ($multiple_access_url) {
1721 1721
             $current_access_url_id = api_get_current_access_url_id();
@@ -1752,8 +1752,8 @@  discard block
 block discarded – undo
1752 1752
         $users = array();
1753 1753
 
1754 1754
         // We get the coach for the given course in a given session.
1755
-        $sql = 'SELECT user_id FROM ' . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) .
1756
-               ' WHERE session_id ="' . $session_id . '" AND c_id="' . $courseId . '" AND status = 2';
1755
+        $sql = 'SELECT user_id FROM '.Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER).
1756
+               ' WHERE session_id ="'.$session_id.'" AND c_id="'.$courseId.'" AND status = 2';
1757 1757
         $rs = Database::query($sql);
1758 1758
         while ($user = Database::fetch_array($rs)) {
1759 1759
             $userInfo = api_get_user_info($user['user_id']);
@@ -1840,11 +1840,11 @@  discard block
 block discarded – undo
1840 1840
             $joinSession = "";
1841 1841
             //Session creation date
1842 1842
             if (!empty($date_from) && !empty($date_to)) {
1843
-                $joinSession = "INNER JOIN " . Database::get_main_table(TABLE_MAIN_SESSION) . " s";
1843
+                $joinSession = "INNER JOIN ".Database::get_main_table(TABLE_MAIN_SESSION)." s";
1844 1844
             }
1845 1845
 
1846 1846
             $sql_query = "SELECT *
1847
-                          FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . " scu
1847
+                          FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)." scu
1848 1848
                           $joinSession
1849 1849
                           INNER JOIN $userTable u ON scu.user_id = u.user_id
1850 1850
                           WHERE scu.c_id = '$courseId' AND scu.status <> 2";
@@ -1856,11 +1856,11 @@  discard block
 block discarded – undo
1856 1856
             }
1857 1857
 
1858 1858
             if ($session_id != 0) {
1859
-                $sql_query .= ' AND scu.session_id = ' . $session_id;
1859
+                $sql_query .= ' AND scu.session_id = '.$session_id;
1860 1860
             }
1861 1861
 
1862 1862
             if (!$includeInvitedUsers) {
1863
-                $sql_query .= " AND u.status != " . INVITEE;
1863
+                $sql_query .= " AND u.status != ".INVITEE;
1864 1864
             }
1865 1865
 
1866 1866
             $rs = Database::query($sql_query);
@@ -1894,8 +1894,8 @@  discard block
 block discarded – undo
1894 1894
                     u.email,
1895 1895
                     u.username,
1896 1896
                     u.status
1897
-                FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " cu
1898
-                INNER JOIN " . Database::get_main_table(TABLE_MAIN_USER) . " u
1897
+                FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER)." cu
1898
+                INNER JOIN " . Database::get_main_table(TABLE_MAIN_USER)." u
1899 1899
                 ON (cu.user_id = u.id)
1900 1900
                 WHERE
1901 1901
                     cu.c_id = $courseId AND
@@ -1933,8 +1933,8 @@  discard block
 block discarded – undo
1933 1933
                     u.email,
1934 1934
                     u.username,
1935 1935
                     u.status
1936
-                FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " cu
1937
-                INNER JOIN " . Database::get_main_table(TABLE_MAIN_USER) . " u
1936
+                FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER)." cu
1937
+                INNER JOIN " . Database::get_main_table(TABLE_MAIN_USER)." u
1938 1938
                 ON (cu.user_id = u.id)
1939 1939
                 WHERE
1940 1940
                     cu.c_id = $courseId AND
@@ -1942,7 +1942,7 @@  discard block
 block discarded – undo
1942 1942
         $rs = Database::query($sql);
1943 1943
         $listTeachers = array();
1944 1944
         $teachers = array();
1945
-        $url = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=get_user_popup';
1945
+        $url = api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=get_user_popup';
1946 1946
         while ($teacher = Database::fetch_array($rs)) {
1947 1947
             $teachers['id'] = $teacher['user_id'];
1948 1948
             $teachers['lastname'] = $teacher['lastname'];
@@ -1955,7 +1955,7 @@  discard block
 block discarded – undo
1955 1955
                 $userPicture = UserManager::getUserPicture($teacher['user_id'], USER_IMAGE_SIZE_SMALL);
1956 1956
                 $teachers['avatar'] = $userPicture;
1957 1957
             }
1958
-            $teachers['url'] = $url.'&user_id='. $teacher['user_id'];
1958
+            $teachers['url'] = $url.'&user_id='.$teacher['user_id'];
1959 1959
             $listTeachers[] = $teachers;
1960 1960
         }
1961 1961
 
@@ -1985,7 +1985,7 @@  discard block
 block discarded – undo
1985 1985
                     $teacher['lastname']
1986 1986
                 );
1987 1987
                 if ($add_link_to_profile) {
1988
-                    $url = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=get_user_popup&user_id=' . $teacher['user_id'];
1988
+                    $url = api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=get_user_popup&user_id='.$teacher['user_id'];
1989 1989
                     $teacher_name = Display::url(
1990 1990
                         $teacher_name,
1991 1991
                         $url,
@@ -2001,8 +2001,8 @@  discard block
 block discarded – undo
2001 2001
             if (!empty($list)) {
2002 2002
                 if ($orderList === true) {
2003 2003
                     $html .= '<ul class="user-teacher">';
2004
-                    foreach ($list as $teacher){
2005
-                        $html .= Display::tag('li', Display::return_icon('teacher.png', $teacher, null, ICON_SIZE_TINY) . ' ' . $teacher);
2004
+                    foreach ($list as $teacher) {
2005
+                        $html .= Display::tag('li', Display::return_icon('teacher.png', $teacher, null, ICON_SIZE_TINY).' '.$teacher);
2006 2006
                     }
2007 2007
                     $html .= '</ul>';
2008 2008
                 } else {
@@ -2083,7 +2083,7 @@  discard block
 block discarded – undo
2083 2083
             foreach ($coachList as $coach_course) {
2084 2084
                 $coach_name = $coach_course['full_name'];
2085 2085
                 if ($add_link_to_profile) {
2086
-                    $url = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=get_user_popup&user_id=' . $coach_course['user_id'];
2086
+                    $url = api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=get_user_popup&user_id='.$coach_course['user_id'];
2087 2087
                     $coach_name = Display::url(
2088 2088
                         $coach_name,
2089 2089
                         $url,
@@ -2104,7 +2104,7 @@  discard block
 block discarded – undo
2104 2104
                 foreach ($course_coachs as $coachs) {
2105 2105
                     $html .= Display::tag(
2106 2106
                         'li',
2107
-                        Display::return_icon('teacher.png', $coachs, null, ICON_SIZE_TINY) . ' ' . $coachs
2107
+                        Display::return_icon('teacher.png', $coachs, null, ICON_SIZE_TINY).' '.$coachs
2108 2108
                     );
2109 2109
                 }
2110 2110
                 $html .= '</ul>';
@@ -2157,20 +2157,20 @@  discard block
 block discarded – undo
2157 2157
         }
2158 2158
 
2159 2159
         $group_list = array();
2160
-        $session_id != 0 ? $session_condition = ' WHERE g.session_id IN(1,' . intval($session_id) . ')' : $session_condition = ' WHERE g.session_id = 0';
2160
+        $session_id != 0 ? $session_condition = ' WHERE g.session_id IN(1,'.intval($session_id).')' : $session_condition = ' WHERE g.session_id = 0';
2161 2161
 
2162 2162
         if ($in_get_empty_group == 0) {
2163 2163
             // get only groups that are not empty
2164 2164
             $sql = "SELECT DISTINCT g.id, g.iid, g.name
2165
-                    FROM " . Database::get_course_table(TABLE_GROUP) . " AS g
2166
-                    INNER JOIN " . Database::get_course_table(TABLE_GROUP_USER) . " gu
2165
+                    FROM " . Database::get_course_table(TABLE_GROUP)." AS g
2166
+                    INNER JOIN " . Database::get_course_table(TABLE_GROUP_USER)." gu
2167 2167
                     ON (g.id = gu.group_id AND g.c_id = $course_id AND gu.c_id = $course_id)
2168 2168
                     $session_condition
2169 2169
                     ORDER BY g.name";
2170 2170
         } else {
2171 2171
             // get all groups even if they are empty
2172 2172
             $sql = "SELECT g.id, g.name, g.iid 
2173
-                    FROM " . Database::get_course_table(TABLE_GROUP) . " AS g
2173
+                    FROM " . Database::get_course_table(TABLE_GROUP)." AS g
2174 2174
                     $session_condition
2175 2175
                     AND c_id = $course_id";
2176 2176
         }
@@ -2226,7 +2226,7 @@  discard block
 block discarded – undo
2226 2226
         $table_stats_uploads = Database::get_main_table(TABLE_STATISTIC_TRACK_E_UPLOADS);
2227 2227
 
2228 2228
         $codeFiltered = Database::escape_string($code);
2229
-        $sql = "SELECT * FROM $table_course WHERE code='" . $codeFiltered . "'";
2229
+        $sql = "SELECT * FROM $table_course WHERE code='".$codeFiltered."'";
2230 2230
         $res = Database::query($sql);
2231 2231
 
2232 2232
         if (Database::num_rows($res) == 0) {
@@ -2234,7 +2234,7 @@  discard block
 block discarded – undo
2234 2234
         }
2235 2235
 
2236 2236
         $sql = "SELECT * FROM $table_course
2237
-                WHERE code = '" . $codeFiltered . "'";
2237
+                WHERE code = '".$codeFiltered."'";
2238 2238
         $res = Database::query($sql);
2239 2239
         $course = Database::fetch_array($res);
2240 2240
         $courseId = $course['id'];
@@ -2282,34 +2282,34 @@  discard block
 block discarded – undo
2282 2282
                 }
2283 2283
             }
2284 2284
 
2285
-            $course_dir = api_get_path(SYS_COURSE_PATH) . $course['directory'];
2286
-            $archive_dir = api_get_path(SYS_ARCHIVE_PATH) . $course['directory'] . '_' . time();
2285
+            $course_dir = api_get_path(SYS_COURSE_PATH).$course['directory'];
2286
+            $archive_dir = api_get_path(SYS_ARCHIVE_PATH).$course['directory'].'_'.time();
2287 2287
             if (is_dir($course_dir)) {
2288 2288
                 rename($course_dir, $archive_dir);
2289 2289
             }
2290 2290
 
2291 2291
             // Unsubscribe all users from the course
2292
-            $sql = "DELETE FROM $table_course_user WHERE c_id='" . $courseId . "'";
2292
+            $sql = "DELETE FROM $table_course_user WHERE c_id='".$courseId."'";
2293 2293
             Database::query($sql);
2294 2294
             // Delete the course from the sessions tables
2295
-            $sql = "DELETE FROM $table_session_course WHERE c_id='" . $courseId . "'";
2295
+            $sql = "DELETE FROM $table_session_course WHERE c_id='".$courseId."'";
2296 2296
             Database::query($sql);
2297
-            $sql = "DELETE FROM $table_session_course_user WHERE c_id='" . $courseId . "'";
2297
+            $sql = "DELETE FROM $table_session_course_user WHERE c_id='".$courseId."'";
2298 2298
             Database::query($sql);
2299 2299
 
2300 2300
             // Delete from Course - URL
2301
-            $sql = "DELETE FROM $table_course_rel_url WHERE c_id = '" . $courseId. "'";
2301
+            $sql = "DELETE FROM $table_course_rel_url WHERE c_id = '".$courseId."'";
2302 2302
             Database::query($sql);
2303 2303
 
2304
-            $sql = 'SELECT survey_id FROM ' . $table_course_survey . ' WHERE course_code="' . $codeFiltered . '"';
2304
+            $sql = 'SELECT survey_id FROM '.$table_course_survey.' WHERE course_code="'.$codeFiltered.'"';
2305 2305
             $result_surveys = Database::query($sql);
2306 2306
             while ($surveys = Database::fetch_array($result_surveys)) {
2307 2307
                 $survey_id = $surveys[0];
2308
-                $sql = 'DELETE FROM ' . $table_course_survey_question . ' WHERE survey_id="' . $survey_id . '"';
2308
+                $sql = 'DELETE FROM '.$table_course_survey_question.' WHERE survey_id="'.$survey_id.'"';
2309 2309
                 Database::query($sql);
2310
-                $sql = 'DELETE FROM ' . $table_course_survey_question_option . ' WHERE survey_id="' . $survey_id . '"';
2310
+                $sql = 'DELETE FROM '.$table_course_survey_question_option.' WHERE survey_id="'.$survey_id.'"';
2311 2311
                 Database::query($sql);
2312
-                $sql = 'DELETE FROM ' . $table_course_survey . ' WHERE survey_id="' . $survey_id . '"';
2312
+                $sql = 'DELETE FROM '.$table_course_survey.' WHERE survey_id="'.$survey_id.'"';
2313 2313
                 Database::query($sql);
2314 2314
             }
2315 2315
 
@@ -2353,7 +2353,7 @@  discard block
 block discarded – undo
2353 2353
             Category::deleteCategoryFromCourse($courseId);
2354 2354
 
2355 2355
             // Delete the course from the database
2356
-            $sql = "DELETE FROM $table_course WHERE code = '" . $codeFiltered . "'";
2356
+            $sql = "DELETE FROM $table_course WHERE code = '".$codeFiltered."'";
2357 2357
             Database::query($sql);
2358 2358
 
2359 2359
             // delete extra course fields
@@ -2399,15 +2399,15 @@  discard block
 block discarded – undo
2399 2399
                 while ($row = Database::fetch_array($res_table, 'ASSOC')) {
2400 2400
                     $row_to_save = array();
2401 2401
                     foreach ($row as $key => $value) {
2402
-                        $row_to_save[$key] = $key . "='" . Database::escape_string($row[$key]) . "'";
2402
+                        $row_to_save[$key] = $key."='".Database::escape_string($row[$key])."'";
2403 2403
                     }
2404
-                    $sql_dump .= "\nINSERT INTO $table SET " . implode(', ', $row_to_save) . ';';
2404
+                    $sql_dump .= "\nINSERT INTO $table SET ".implode(', ', $row_to_save).';';
2405 2405
                 }
2406 2406
             }
2407 2407
         }
2408 2408
 
2409
-        if (is_dir(api_get_path(SYS_COURSE_PATH) . $course['directory'])) {
2410
-            $file_name = api_get_path(SYS_COURSE_PATH) . $course['directory'] . '/mysql_dump.sql';
2409
+        if (is_dir(api_get_path(SYS_COURSE_PATH).$course['directory'])) {
2410
+            $file_name = api_get_path(SYS_COURSE_PATH).$course['directory'].'/mysql_dump.sql';
2411 2411
             $handle = fopen($file_name, 'a+');
2412 2412
             if ($handle !== false) {
2413 2413
                 fwrite($handle, $sql_dump);
@@ -2436,13 +2436,13 @@  discard block
 block discarded – undo
2436 2436
         $TABLECOURSE = Database::get_main_table(TABLE_MAIN_COURSE);
2437 2437
         $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
2438 2438
 
2439
-        $course_title = Database::result(Database::query('SELECT title FROM ' . $TABLECOURSE . ' WHERE code="' . $course_code . '"'),
2439
+        $course_title = Database::result(Database::query('SELECT title FROM '.$TABLECOURSE.' WHERE code="'.$course_code.'"'),
2440 2440
             0, 0);
2441 2441
 
2442 2442
         $sql = 'SELECT course.code as code, course.title as title, cu.sort as sort
2443
-                FROM ' . $TABLECOURSUSER . ' as cu, ' . $TABLECOURSE . ' as course
2444
-                WHERE   course.id = cu.c_id AND user_id = "' . $user_id . '" AND
2445
-                        cu.relation_type<>' . COURSE_RELATION_TYPE_RRHH . ' AND
2443
+                FROM ' . $TABLECOURSUSER.' as cu, '.$TABLECOURSE.' as course
2444
+                WHERE   course.id = cu.c_id AND user_id = "' . $user_id.'" AND
2445
+                        cu.relation_type<>' . COURSE_RELATION_TYPE_RRHH.' AND
2446 2446
                         user_course_cat = 0
2447 2447
                 ORDER BY cu.sort';
2448 2448
         $result = Database::query($sql);
@@ -2461,21 +2461,21 @@  discard block
 block discarded – undo
2461 2461
                     $course_found = true;
2462 2462
                     $course_sort = $courses['sort'];
2463 2463
                     if ($counter == 0) {
2464
-                        $sql = 'UPDATE ' . $TABLECOURSUSER . '
2464
+                        $sql = 'UPDATE '.$TABLECOURSUSER.'
2465 2465
                                 SET sort = sort+1
2466 2466
                                 WHERE
2467
-                                    user_id= "' . $user_id . '" AND
2468
-                                    relation_type<>' . COURSE_RELATION_TYPE_RRHH . '
2467
+                                    user_id= "' . $user_id.'" AND
2468
+                                    relation_type<>' . COURSE_RELATION_TYPE_RRHH.'
2469 2469
                                     AND user_course_cat="0"
2470
-                                    AND sort > "' . $course_sort . '"';
2470
+                                    AND sort > "' . $course_sort.'"';
2471 2471
                         $course_sort++;
2472 2472
                     } else {
2473
-                        $sql = 'UPDATE ' . $TABLECOURSUSER . ' SET sort = sort+1
2473
+                        $sql = 'UPDATE '.$TABLECOURSUSER.' SET sort = sort+1
2474 2474
                                 WHERE
2475
-                                    user_id= "' . $user_id . '" AND
2476
-                                    relation_type<>' . COURSE_RELATION_TYPE_RRHH . ' AND
2475
+                                    user_id= "' . $user_id.'" AND
2476
+                                    relation_type<>' . COURSE_RELATION_TYPE_RRHH.' AND
2477 2477
                                     user_course_cat="0" AND
2478
-                                    sort >= "' . $course_sort . '"';
2478
+                                    sort >= "' . $course_sort.'"';
2479 2479
                     }
2480 2480
                     Database::query($sql);
2481 2481
                     break;
@@ -2488,9 +2488,9 @@  discard block
 block discarded – undo
2488 2488
 
2489 2489
             // We must register the course in the beginning of the list
2490 2490
             if (!$course_found) {
2491
-                $course_sort = Database::result(Database::query('SELECT min(sort) as min_sort FROM ' . $TABLECOURSUSER . ' WHERE user_id="' . $user_id . '" AND user_course_cat="0"'),
2491
+                $course_sort = Database::result(Database::query('SELECT min(sort) as min_sort FROM '.$TABLECOURSUSER.' WHERE user_id="'.$user_id.'" AND user_course_cat="0"'),
2492 2492
                     0, 0);
2493
-                Database::query('UPDATE ' . $TABLECOURSUSER . ' SET sort = sort+1 WHERE user_id= "' . $user_id . '" AND user_course_cat="0"');
2493
+                Database::query('UPDATE '.$TABLECOURSUSER.' SET sort = sort+1 WHERE user_id= "'.$user_id.'" AND user_course_cat="0"');
2494 2494
             }
2495 2495
         }
2496 2496
         return $course_sort;
@@ -2503,8 +2503,8 @@  discard block
 block discarded – undo
2503 2503
      */
2504 2504
     public static function course_exists($course_code)
2505 2505
     {
2506
-        $sql = 'SELECT 1 FROM ' . Database::get_main_table(TABLE_MAIN_COURSE) . '
2507
-                WHERE code="' . Database::escape_string($course_code) . '"';
2506
+        $sql = 'SELECT 1 FROM '.Database::get_main_table(TABLE_MAIN_COURSE).'
2507
+                WHERE code="' . Database::escape_string($course_code).'"';
2508 2508
 
2509 2509
         return Database::num_rows(Database::query($sql));
2510 2510
     }
@@ -2529,8 +2529,8 @@  discard block
 block discarded – undo
2529 2529
         $student = api_get_user_info($user_id);
2530 2530
 
2531 2531
         $name_course = $information['title'];
2532
-        $sql = "SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " 
2533
-                WHERE c_id ='" . $courseId . "'";
2532
+        $sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE_USER)." 
2533
+                WHERE c_id ='" . $courseId."'";
2534 2534
 
2535 2535
         // TODO: Ivan: This is a mistake, please, have a look at it. Intention here is diffcult to be guessed.
2536 2536
         //if ($send_to_tutor_also = true)
@@ -2545,18 +2545,18 @@  discard block
 block discarded – undo
2545 2545
         while ($row = Database::fetch_array($result)) {
2546 2546
             $tutor = api_get_user_info($row['user_id']);
2547 2547
             $emailto = $tutor['email'];
2548
-            $emailsubject = get_lang('NewUserInTheCourse') . ': ' . $name_course;
2549
-            $emailbody = get_lang('Dear') . ': ' . api_get_person_name($tutor['firstname'], $tutor['lastname']) . "\n";
2550
-            $emailbody .= get_lang('MessageNewUserInTheCourse') . ': ' . $name_course . "\n";
2551
-            $emailbody .= get_lang('UserName') . ': ' . $student['username'] . "\n";
2548
+            $emailsubject = get_lang('NewUserInTheCourse').': '.$name_course;
2549
+            $emailbody = get_lang('Dear').': '.api_get_person_name($tutor['firstname'], $tutor['lastname'])."\n";
2550
+            $emailbody .= get_lang('MessageNewUserInTheCourse').': '.$name_course."\n";
2551
+            $emailbody .= get_lang('UserName').': '.$student['username']."\n";
2552 2552
             if (api_is_western_name_order()) {
2553
-                $emailbody .= get_lang('FirstName') . ': ' . $student['firstname'] . "\n";
2554
-                $emailbody .= get_lang('LastName') . ': ' . $student['lastname'] . "\n";
2553
+                $emailbody .= get_lang('FirstName').': '.$student['firstname']."\n";
2554
+                $emailbody .= get_lang('LastName').': '.$student['lastname']."\n";
2555 2555
             } else {
2556
-                $emailbody .= get_lang('LastName') . ': ' . $student['lastname'] . "\n";
2557
-                $emailbody .= get_lang('FirstName') . ': ' . $student['firstname'] . "\n";
2556
+                $emailbody .= get_lang('LastName').': '.$student['lastname']."\n";
2557
+                $emailbody .= get_lang('FirstName').': '.$student['firstname']."\n";
2558 2558
             }
2559
-            $emailbody .= get_lang('Email') . ': <a href="mailto:' . $student['email'] . '">' . $student['email'] ."</a>\n\n";
2559
+            $emailbody .= get_lang('Email').': <a href="mailto:'.$student['email'].'">'.$student['email']."</a>\n\n";
2560 2560
             $recipient_name = api_get_person_name($tutor['firstname'], $tutor['lastname'], null,
2561 2561
                 PERSON_NAME_EMAIL_ADDRESS);
2562 2562
             $sender_name = api_get_person_name(api_get_setting('administratorName'),
@@ -2710,9 +2710,9 @@  discard block
 block discarded – undo
2710 2710
         } else {
2711 2711
             $with_special_courses = $without_special_courses = '';
2712 2712
             if (!empty($special_course_list)) {
2713
-                $sc_string = '"' . implode('","', $special_course_list) . '"';
2714
-                $with_special_courses = ' course.id IN (' . $sc_string . ')';
2715
-                $without_special_courses = ' AND course.id NOT IN (' . $sc_string . ')';
2713
+                $sc_string = '"'.implode('","', $special_course_list).'"';
2714
+                $with_special_courses = ' course.id IN ('.$sc_string.')';
2715
+                $without_special_courses = ' AND course.id NOT IN ('.$sc_string.')';
2716 2716
             }
2717 2717
 
2718 2718
             if (!empty($with_special_courses)) {
@@ -2756,8 +2756,8 @@  discard block
 block discarded – undo
2756 2756
 
2757 2757
         if ($include_sessions === true) {
2758 2758
             $sql = "SELECT DISTINCT(c.code), c.id as real_id
2759
-                    FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . " s,
2760
-                    " . Database::get_main_table(TABLE_MAIN_COURSE) . " c
2759
+                    FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)." s,
2760
+                    " . Database::get_main_table(TABLE_MAIN_COURSE)." c
2761 2761
                     WHERE user_id = $user_id AND s.c_id = c.id";
2762 2762
             $r = Database::query($sql);
2763 2763
             while ($row = Database::fetch_array($r, 'ASSOC')) {
@@ -2779,7 +2779,7 @@  discard block
 block discarded – undo
2779 2779
     public static function get_course_id_from_path($path)
2780 2780
     {
2781 2781
         $path = Database::escape_string(str_replace('.', '', str_replace('/', '', $path)));
2782
-        $res = Database::query("SELECT code FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . "
2782
+        $res = Database::query("SELECT code FROM ".Database::get_main_table(TABLE_MAIN_COURSE)."
2783 2783
                 WHERE directory LIKE BINARY '$path'");
2784 2784
         if ($res === false) {
2785 2785
             return false;
@@ -2801,8 +2801,8 @@  discard block
 block discarded – undo
2801 2801
     public static function get_courses_info_from_visual_code($code)
2802 2802
     {
2803 2803
         $result = array();
2804
-        $sql_result = Database::query("SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . "
2805
-                WHERE visual_code = '" . Database::escape_string($code) . "'");
2804
+        $sql_result = Database::query("SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE)."
2805
+                WHERE visual_code = '" . Database::escape_string($code)."'");
2806 2806
         while ($virtual_course = Database::fetch_array($sql_result)) {
2807 2807
             $result[] = $virtual_course;
2808 2808
         }
@@ -2819,10 +2819,10 @@  discard block
 block discarded – undo
2819 2819
     public static function get_emails_of_tutors_to_course($courseId)
2820 2820
     {
2821 2821
         $list = array();
2822
-        $res = Database::query("SELECT user_id FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . "
2823
-                WHERE c_id ='" . intval($courseId) . "' AND status=1");
2822
+        $res = Database::query("SELECT user_id FROM ".Database::get_main_table(TABLE_MAIN_COURSE_USER)."
2823
+                WHERE c_id ='" . intval($courseId)."' AND status=1");
2824 2824
         while ($list_users = Database::fetch_array($res)) {
2825
-            $result = Database::query("SELECT * FROM " . Database::get_main_table(TABLE_MAIN_USER) . "
2825
+            $result = Database::query("SELECT * FROM ".Database::get_main_table(TABLE_MAIN_USER)."
2826 2826
                     WHERE user_id=" . $list_users['user_id']);
2827 2827
             while ($row_user = Database::fetch_array($result)) {
2828 2828
                 $name_teacher = api_get_person_name($row_user['firstname'], $row_user['lastname']);
@@ -2866,7 +2866,7 @@  discard block
 block discarded – undo
2866 2866
             }
2867 2867
 
2868 2868
             $sql = "SELECT firstname, lastname, email FROM $tbl_user
2869
-                    WHERE user_id IN (" . implode(",", $user_ids) . ")";
2869
+                    WHERE user_id IN (".implode(",", $user_ids).")";
2870 2870
             $rs_user = Database::query($sql);
2871 2871
 
2872 2872
             while ($row_emails = Database::fetch_array($rs_user)) {
@@ -2915,9 +2915,9 @@  discard block
 block discarded – undo
2915 2915
      */
2916 2916
     public static function update_attribute($id, $name, $value)
2917 2917
     {
2918
-        $id = (int)$id;
2918
+        $id = (int) $id;
2919 2919
         $table = Database::get_main_table(TABLE_MAIN_COURSE);
2920
-        $sql = "UPDATE $table SET $name = '" . Database::escape_string($value) . "'
2920
+        $sql = "UPDATE $table SET $name = '".Database::escape_string($value)."'
2921 2921
                 WHERE id = '$id'";
2922 2922
 
2923 2923
         return Database::query($sql);
@@ -2933,7 +2933,7 @@  discard block
 block discarded – undo
2933 2933
      */
2934 2934
     public static function update_attributes($id, $attributes)
2935 2935
     {
2936
-        $id = (int)$id;
2936
+        $id = (int) $id;
2937 2937
         $table = Database::get_main_table(TABLE_MAIN_COURSE);
2938 2938
         $sql = "UPDATE $table SET ";
2939 2939
         $i = 0;
@@ -2942,7 +2942,7 @@  discard block
 block discarded – undo
2942 2942
                 if ($i > 0) {
2943 2943
                     $sql .= ", ";
2944 2944
                 }
2945
-                $sql .= " $name = '" . Database::escape_string($value) . "'";
2945
+                $sql .= " $name = '".Database::escape_string($value)."'";
2946 2946
                 $i++;
2947 2947
             }
2948 2948
         }
@@ -2984,10 +2984,10 @@  discard block
 block discarded – undo
2984 2984
         }
2985 2985
 
2986 2986
         $sql = 'SELECT sc.id session_category
2987
-                FROM ' . Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY) . ' sc
2988
-                INNER JOIN ' . Database::get_main_table(TABLE_MAIN_SESSION) . ' s
2987
+                FROM ' . Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY).' sc
2988
+                INNER JOIN ' . Database::get_main_table(TABLE_MAIN_SESSION).' s
2989 2989
                 ON sc.id = s.session_category_id 
2990
-                WHERE s.id="' . intval($session_id) . '"';
2990
+                WHERE s.id="' . intval($session_id).'"';
2991 2991
 
2992 2992
         return Database::result(
2993 2993
             Database::query($sql),
@@ -3033,13 +3033,13 @@  discard block
 block discarded – undo
3033 3033
                 $data .= '<div class="sectiontitle">';
3034 3034
                 if (api_is_allowed_to_edit() && $action_show) {
3035 3035
                     //delete
3036
-                    $data .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=delete&description_id=' . $description->id . '" onclick="javascript:if(!confirm(\'' . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),
3037
-                                ENT_QUOTES, $charset)) . '\')) return false;">';
3036
+                    $data .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=delete&description_id='.$description->id.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),
3037
+                                ENT_QUOTES, $charset)).'\')) return false;">';
3038 3038
                     $data .= Display::return_icon('delete.gif', get_lang('Delete'),
3039 3039
                         array('style' => 'vertical-align:middle;float:right;'));
3040 3040
                     $data .= '</a> ';
3041 3041
                     //edit
3042
-                    $data .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&description_id=' . $description->id . '">';
3042
+                    $data .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&description_id='.$description->id.'">';
3043 3043
                     $data .= Display::return_icon('edit.png', get_lang('Edit'),
3044 3044
                         array('style' => 'vertical-align:middle;float:right; padding-right:4px;'), ICON_SIZE_SMALL);
3045 3045
                     $data .= '</a> ';
@@ -3051,7 +3051,7 @@  discard block
 block discarded – undo
3051 3051
                 $data .= '</div>';
3052 3052
             }
3053 3053
         } else {
3054
-            $data .= '<em>' . get_lang('ThisCourseDescriptionIsEmpty') . '</em>';
3054
+            $data .= '<em>'.get_lang('ThisCourseDescriptionIsEmpty').'</em>';
3055 3055
         }
3056 3056
 
3057 3057
         return $data;
@@ -3138,11 +3138,11 @@  discard block
 block discarded – undo
3138 3138
                     ON (a.c_id = s.c_id)
3139 3139
                     WHERE
3140 3140
                         user_id = $hr_manager_id AND
3141
-                        relation_type=" . COURSE_RELATION_TYPE_RRHH . " AND
3142
-                        access_url_id = " . api_get_current_access_url_id() . "";
3141
+                        relation_type=".COURSE_RELATION_TYPE_RRHH." AND
3142
+                        access_url_id = " . api_get_current_access_url_id()."";
3143 3143
         } else {
3144 3144
             $sql = "SELECT c_id FROM $tbl_course_rel_user
3145
-                    WHERE user_id = $hr_manager_id AND relation_type=" . COURSE_RELATION_TYPE_RRHH . " ";
3145
+                    WHERE user_id = $hr_manager_id AND relation_type=".COURSE_RELATION_TYPE_RRHH." ";
3146 3146
         }
3147 3147
         $result = Database::query($sql);
3148 3148
         if (Database::num_rows($result) > 0) {
@@ -3151,7 +3151,7 @@  discard block
 block discarded – undo
3151 3151
                         WHERE
3152 3152
                             c_id = '{$row['c_id']}' AND
3153 3153
                             user_id = $hr_manager_id AND
3154
-                            relation_type=" . COURSE_RELATION_TYPE_RRHH . " ";
3154
+                            relation_type=".COURSE_RELATION_TYPE_RRHH." ";
3155 3155
                 Database::query($sql);
3156 3156
             }
3157 3157
         }
@@ -3162,7 +3162,7 @@  discard block
 block discarded – undo
3162 3162
                 $courseInfo = api_get_course_info($course_code);
3163 3163
                 $courseId = $courseInfo['real_id'];
3164 3164
                 $sql = "INSERT IGNORE INTO $tbl_course_rel_user(c_id, user_id, status, relation_type)
3165
-                        VALUES($courseId, $hr_manager_id, '" . DRH . "', '" . COURSE_RELATION_TYPE_RRHH . "')";
3165
+                        VALUES($courseId, $hr_manager_id, '".DRH."', '".COURSE_RELATION_TYPE_RRHH."')";
3166 3166
                 $result = Database::query($sql);
3167 3167
                 if (Database::affected_rows($result)) {
3168 3168
                     $affected_rows++;
@@ -3245,16 +3245,16 @@  discard block
 block discarded – undo
3245 3245
             case COURSEMANAGER:
3246 3246
                 $whereConditions .= " AND cru.user_id = '$user_id'";
3247 3247
                 if (!$showAllAssignedCourses) {
3248
-                    $whereConditions .= " AND status = " . COURSEMANAGER;
3248
+                    $whereConditions .= " AND status = ".COURSEMANAGER;
3249 3249
                 } else {
3250
-                    $whereConditions .= " AND relation_type = " . COURSE_RELATION_TYPE_COURSE_MANAGER;
3250
+                    $whereConditions .= " AND relation_type = ".COURSE_RELATION_TYPE_COURSE_MANAGER;
3251 3251
                 }
3252 3252
                 break;
3253 3253
             case DRH:
3254 3254
                 $whereConditions .= " AND
3255 3255
                     cru.user_id = '$user_id' AND
3256
-                    status = " . DRH . " AND
3257
-                    relation_type = '" . COURSE_RELATION_TYPE_RRHH . "'
3256
+                    status = ".DRH." AND
3257
+                    relation_type = '" . COURSE_RELATION_TYPE_RRHH."'
3258 3258
                 ";
3259 3259
                 break;
3260 3260
         }
@@ -3275,7 +3275,7 @@  discard block
 block discarded – undo
3275 3275
                 );
3276 3276
                 if (!empty($courseList)) {
3277 3277
                     $courseListToString = implode("','", array_keys($courseList));
3278
-                    $whereConditions .= " AND c.id IN ('" . $courseListToString . "')";
3278
+                    $whereConditions .= " AND c.id IN ('".$courseListToString."')";
3279 3279
                 }
3280 3280
                 $tableSessionRelCourse = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
3281 3281
                 $orderBy = ' ORDER BY position';
@@ -3291,7 +3291,7 @@  discard block
 block discarded – undo
3291 3291
                     INNER JOIN $tbl_course_rel_access_url a ON (a.c_id = c.id)
3292 3292
                     $extraInnerJoin
3293 3293
                 WHERE
3294
-                    access_url_id = " . api_get_current_access_url_id() . "
3294
+                    access_url_id = ".api_get_current_access_url_id()."
3295 3295
                     $whereConditions
3296 3296
                 $orderBy
3297 3297
                 ";
@@ -3352,10 +3352,10 @@  discard block
 block discarded – undo
3352 3352
     {
3353 3353
         $course_info = api_get_course_info($course_code);
3354 3354
         // course path
3355
-        $store_path = api_get_path(SYS_COURSE_PATH) . $course_info['path'];
3355
+        $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'];
3356 3356
         // image name for courses
3357
-        $course_image = $store_path . '/course-pic.png';
3358
-        $course_medium_image = $store_path . '/course-pic85x85.png';
3357
+        $course_image = $store_path.'/course-pic.png';
3358
+        $course_medium_image = $store_path.'/course-pic85x85.png';
3359 3359
 
3360 3360
         if (file_exists($course_image)) {
3361 3361
             unlink($course_image);
@@ -3389,11 +3389,11 @@  discard block
 block discarded – undo
3389 3389
     {
3390 3390
         $course_info = api_get_course_info($courseCode);
3391 3391
         // course path
3392
-        $storePath = api_get_path(SYS_COURSE_PATH) . $course_info['path'];
3392
+        $storePath = api_get_path(SYS_COURSE_PATH).$course_info['path'];
3393 3393
         // image name for courses
3394
-        $courseImage = $storePath . '/course-pic.png';
3395
-        $courseMediumImage = $storePath . '/course-pic85x85.png';
3396
-        $courseSmallImage = $storePath . '/course-pic32.png';
3394
+        $courseImage = $storePath.'/course-pic.png';
3395
+        $courseMediumImage = $storePath.'/course-pic85x85.png';
3396
+        $courseSmallImage = $storePath.'/course-pic32.png';
3397 3397
 
3398 3398
         if (file_exists($courseImage)) {
3399 3399
             unlink($courseImage);
@@ -3421,26 +3421,26 @@  discard block
 block discarded – undo
3421 3421
 
3422 3422
         $notifications = isset($params['notifications']) ? $params['notifications'] : null;
3423 3423
 
3424
-        $html .= '<h3>' . $params['title'] . $notifications . '</h3> ';
3424
+        $html .= '<h3>'.$params['title'].$notifications.'</h3> ';
3425 3425
 
3426 3426
         if (isset($params['description'])) {
3427
-            $html .= '<p>' . $params['description'] . '</p>';
3427
+            $html .= '<p>'.$params['description'].'</p>';
3428 3428
         }
3429 3429
         if (!empty($params['subtitle'])) {
3430
-            $html .= '<small>' . $params['subtitle'] . '</small>';
3430
+            $html .= '<small>'.$params['subtitle'].'</small>';
3431 3431
         }
3432 3432
         if (!empty($params['teachers'])) {
3433
-            $html .= '<h5 class="teacher">' . Display::return_icon('teacher.png', get_lang('Teacher'), array(),
3434
-                    ICON_SIZE_TINY) . $params['teachers'] . '</h5>';
3433
+            $html .= '<h5 class="teacher">'.Display::return_icon('teacher.png', get_lang('Teacher'), array(),
3434
+                    ICON_SIZE_TINY).$params['teachers'].'</h5>';
3435 3435
         }
3436 3436
         if (!empty($params['coaches'])) {
3437
-            $html .= '<h5 class="teacher">' . Display::return_icon('teacher.png', get_lang('Coach'), array(),
3438
-                    ICON_SIZE_TINY) . $params['coaches'] . '</h5>';
3437
+            $html .= '<h5 class="teacher">'.Display::return_icon('teacher.png', get_lang('Coach'), array(),
3438
+                    ICON_SIZE_TINY).$params['coaches'].'</h5>';
3439 3439
         }
3440 3440
 
3441 3441
         $html .= '</div>';
3442 3442
         $params['right_actions'] = isset($params['right_actions']) ? $params['right_actions'] : null;
3443
-        $html .= '<div class="pull-right course-box-actions">' . $params['right_actions'] . '</div>';
3443
+        $html .= '<div class="pull-right course-box-actions">'.$params['right_actions'].'</div>';
3444 3444
         $html .= '</div>';
3445 3445
         $html .= '</div>';
3446 3446
 
@@ -3461,13 +3461,13 @@  discard block
 block discarded – undo
3461 3461
         if ($is_sub_content) {
3462 3462
             $class = "course_item";
3463 3463
         }
3464
-        $html .= '<div class="' . $class . '">';
3464
+        $html .= '<div class="'.$class.'">';
3465 3465
         $html .= '<div class="panel-body">';
3466 3466
         $html .= '<div class="course-items">';
3467 3467
         $html .= ' <div class="row">';
3468 3468
         $html .= '<div class="col-md-2">';
3469 3469
         if (!empty($params['link'])) {
3470
-            $html .= '<a class="thumbnail" href="' . $params['link'] . '">';
3470
+            $html .= '<a class="thumbnail" href="'.$params['link'].'">';
3471 3471
             $html .= $params['icon'];
3472 3472
             $html .= '</a>';
3473 3473
         } else {
@@ -3480,20 +3480,20 @@  discard block
 block discarded – undo
3480 3480
         $param_class = isset($params['class']) ? $params['class'] : '';
3481 3481
         $params['right_actions'] = isset($params['right_actions']) ? $params['right_actions'] : '';
3482 3482
 
3483
-        $html .= '<div class="col-md-10 ' . $param_class . '">';
3484
-        $html .= '<div class="pull-right">' . $params['right_actions'] . '</div>';
3485
-        $html .= '<h4 class="course-items-title">' . $params['title'] . $notifications . '</h4> ';
3483
+        $html .= '<div class="col-md-10 '.$param_class.'">';
3484
+        $html .= '<div class="pull-right">'.$params['right_actions'].'</div>';
3485
+        $html .= '<h4 class="course-items-title">'.$params['title'].$notifications.'</h4> ';
3486 3486
 
3487 3487
         if (isset($params['show_description'], $params['description']) && $params['show_description'] == 1) {
3488
-            $html .= '<p class="description-session">' . $params['description'] . '</p>';
3488
+            $html .= '<p class="description-session">'.$params['description'].'</p>';
3489 3489
         }
3490 3490
         if (!empty($params['subtitle'])) {
3491
-            $html .= '<div class="subtitle-session">' . $params['subtitle'] . '</div>';
3491
+            $html .= '<div class="subtitle-session">'.$params['subtitle'].'</div>';
3492 3492
         }
3493 3493
         if (!empty($params['teachers'])) {
3494 3494
             $teachers = $params['teachers'];
3495
-            $html .= '<h5 class="course-items-session">' .
3496
-                    Display::return_icon('teacher.png', get_lang('Teacher'), array(), ICON_SIZE_TINY) .
3495
+            $html .= '<h5 class="course-items-session">'.
3496
+                    Display::return_icon('teacher.png', get_lang('Teacher'), array(), ICON_SIZE_TINY).
3497 3497
                 $teachers.'</h5>';
3498 3498
         }
3499 3499
         if (!empty($params['coaches'])) {
@@ -3503,9 +3503,9 @@  discard block
 block discarded – undo
3503 3503
                     $coaches .= $coach['full_name'];
3504 3504
                 }
3505 3505
             }
3506
-            $html .= '<h5 class="course-items-session">' .
3507
-                Display::return_icon('teacher.png', get_lang('Coach'), array(), ICON_SIZE_TINY) .
3508
-                $coaches .
3506
+            $html .= '<h5 class="course-items-session">'.
3507
+                Display::return_icon('teacher.png', get_lang('Coach'), array(), ICON_SIZE_TINY).
3508
+                $coaches.
3509 3509
                 '</h5>';
3510 3510
         }
3511 3511
 
@@ -3542,7 +3542,7 @@  discard block
 block discarded – undo
3542 3542
      */
3543 3543
     public static function course_item_parent($main_content, $sub_content, $sub_sub_content = null)
3544 3544
     {
3545
-        return '<div class="panel panel-default">' . $main_content . $sub_content . $sub_sub_content . '</div>';
3545
+        return '<div class="panel panel-default">'.$main_content.$sub_content.$sub_sub_content.'</div>';
3546 3546
     }
3547 3547
 
3548 3548
     /**
@@ -3555,11 +3555,11 @@  discard block
 block discarded – undo
3555 3555
         $html = '';
3556 3556
         $html .= '<div class="row">';
3557 3557
         $html .= '<div class="col-md-2">';
3558
-        if (!empty($params['link'])){
3558
+        if (!empty($params['link'])) {
3559 3559
             $html .= '<a class="thumbnail" href="'.$params['link'].'">';
3560 3560
             $html .= $params['icon'];
3561 3561
             $html .= '</a>';
3562
-        }else{
3562
+        } else {
3563 3563
             $html .= $params['icon'];
3564 3564
         }
3565 3565
         $html .= '</div>';
@@ -3589,7 +3589,7 @@  discard block
 block discarded – undo
3589 3589
         $special_course_list = self::get_special_course_list();
3590 3590
         $with_special_courses = '';
3591 3591
         if (!empty($special_course_list)) {
3592
-            $with_special_courses = ' AND course.id IN ("' . implode('","', $special_course_list) . '")';
3592
+            $with_special_courses = ' AND course.id IN ("'.implode('","', $special_course_list).'")';
3593 3593
         }
3594 3594
 
3595 3595
         $courseList = [];
@@ -3633,27 +3633,27 @@  discard block
 block discarded – undo
3633 3633
                     $params['edit_actions'] = '';
3634 3634
                     $params['document'] = '';
3635 3635
                     if (api_is_platform_admin()) {
3636
-                        $params['edit_actions'] .= api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course['code'];
3636
+                        $params['edit_actions'] .= api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'];
3637 3637
                         if ($load_dirs) {
3638
-                            $params['document'] = '<a id="document_preview_' . $course_info['real_id'] . '_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3639
-                               . Display::returnFontAwesomeIcon('folder-open') . '</a>';
3640
-                            $params['document'] .= Display::div('', ['id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container']);
3638
+                            $params['document'] = '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3639
+                               . Display::returnFontAwesomeIcon('folder-open').'</a>';
3640
+                            $params['document'] .= Display::div('', ['id' => 'document_result_'.$course_info['real_id'].'_0', 'class' => 'document_preview_container']);
3641 3641
                         }
3642 3642
                     } else {
3643 3643
                         if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED && $load_dirs) {
3644
-                            $params['document'] = '<a id="document_preview_' . $course_info['real_id'] . '_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3645
-                               . Display::returnFontAwesomeIcon('folder-open') . '</a>';
3646
-                            $params['document'] .= Display::div('', ['id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container']);
3644
+                            $params['document'] = '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3645
+                               . Display::returnFontAwesomeIcon('folder-open').'</a>';
3646
+                            $params['document'] .= Display::div('', ['id' => 'document_result_'.$course_info['real_id'].'_0', 'class' => 'document_preview_container']);
3647 3647
                         }
3648 3648
                     }
3649 3649
 
3650 3650
                     $params['visibility'] = $course_info['visibility'];
3651 3651
                     $params['status'] = $course_info['status'];
3652 3652
                     $params['category'] = $course_info['categoryName'];
3653
-                    $params['icon'] = Display::return_icon('drawing-pin.png',null, null, ICON_SIZE_LARGE, null);
3653
+                    $params['icon'] = Display::return_icon('drawing-pin.png', null, null, ICON_SIZE_LARGE, null);
3654 3654
 
3655 3655
                     if (api_get_setting('display_coursecode_in_courselist') == 'true') {
3656
-                        $params['code_course']  = '(' . $course_info['visual_code'] . ')';
3656
+                        $params['code_course'] = '('.$course_info['visual_code'].')';
3657 3657
                     }
3658 3658
 
3659 3659
                     $params['title'] = $course_info['title'];
@@ -3698,7 +3698,7 @@  discard block
 block discarded – undo
3698 3698
         // Step 1: We get all the categories of the user
3699 3699
         $table = Database::get_main_table(TABLE_USER_COURSE_CATEGORY);
3700 3700
         $sql = "SELECT id, title FROM $table
3701
-                WHERE user_id = '" . $user_id . "'
3701
+                WHERE user_id = '".$user_id."'
3702 3702
                 ORDER BY sort ASC";
3703 3703
 
3704 3704
         $result = Database::query($sql);
@@ -3752,7 +3752,7 @@  discard block
 block discarded – undo
3752 3752
 
3753 3753
         $without_special_courses = '';
3754 3754
         if (!empty($special_course_list)) {
3755
-            $without_special_courses = ' AND course.id NOT IN ("' . implode('","', $special_course_list) . '")';
3755
+            $without_special_courses = ' AND course.id NOT IN ("'.implode('","', $special_course_list).'")';
3756 3756
         }
3757 3757
 
3758 3758
         $sql = "SELECT
@@ -3764,14 +3764,14 @@  discard block
 block discarded – undo
3764 3764
                 INNER JOIN $TABLE_ACCESS_URL_REL_COURSE url
3765 3765
                 ON (url.c_id = course.id)
3766 3766
                 WHERE
3767
-                    course_rel_user.user_id = '" . $user_id . "' AND
3768
-                    course_rel_user.user_course_cat = '" . $user_category_id . "'
3767
+                    course_rel_user.user_id = '".$user_id."' AND
3768
+                    course_rel_user.user_course_cat = '" . $user_category_id."'
3769 3769
                     $without_special_courses ";
3770 3770
 
3771 3771
         // If multiple URL access mode is enabled, only fetch courses
3772 3772
         // corresponding to the current URL.
3773 3773
         if (api_get_multiple_access_url() && $current_url_id != -1) {
3774
-            $sql .= " AND url.c_id = course.id AND access_url_id='" . $current_url_id . "'";
3774
+            $sql .= " AND url.c_id = course.id AND access_url_id='".$current_url_id."'";
3775 3775
         }
3776 3776
         // Use user's classification for courses (if any).
3777 3777
         $sql .= " ORDER BY course_rel_user.user_course_cat, course_rel_user.sort ASC";
@@ -3807,28 +3807,28 @@  discard block
 block discarded – undo
3807 3807
             if ($showCustomIcon === 'true' && $iconName != 'course.png') {
3808 3808
                 $thumbnails = $course_info['course_image'];
3809 3809
                 $image = $course_info['course_image_large'];
3810
-            }else{
3811
-                $image = Display::return_icon('session_default.png', null, null, null,null, true);
3810
+            } else {
3811
+                $image = Display::return_icon('session_default.png', null, null, null, null, true);
3812 3812
             }
3813 3813
 
3814 3814
             $params['course_id'] = $course_info['real_id'];
3815 3815
             $params['edit_actions'] = '';
3816 3816
             $params['document'] = '';
3817 3817
             if (api_is_platform_admin()) {
3818
-                $params['edit_actions'] .= api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course_info['code'];
3818
+                $params['edit_actions'] .= api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course_info['code'];
3819 3819
                 if ($load_dirs) {
3820
-                    $params['document'] = '<a id="document_preview_' . $course_info['real_id'] . '_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3821
-                               . Display::returnFontAwesomeIcon('folder-open') . '</a>';
3822
-                    $params['document'] .= Display::div('', array('id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container'));
3820
+                    $params['document'] = '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3821
+                               . Display::returnFontAwesomeIcon('folder-open').'</a>';
3822
+                    $params['document'] .= Display::div('', array('id' => 'document_result_'.$course_info['real_id'].'_0', 'class' => 'document_preview_container'));
3823 3823
                 }
3824 3824
             }
3825 3825
             if ($load_dirs) {
3826
-                $params['document'] = '<a id="document_preview_' . $course_info['real_id'] . '_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3827
-                    . Display::returnFontAwesomeIcon('folder-open') . '</a>';
3828
-                $params['document'] .= Display::div('', array('id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container'));
3826
+                $params['document'] = '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3827
+                    . Display::returnFontAwesomeIcon('folder-open').'</a>';
3828
+                $params['document'] .= Display::div('', array('id' => 'document_result_'.$course_info['real_id'].'_0', 'class' => 'document_preview_container'));
3829 3829
             }
3830 3830
 
3831
-            $courseUrl = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?id_session=0';
3831
+            $courseUrl = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/index.php?id_session=0';
3832 3832
             $teachers = [];
3833 3833
             if (api_get_setting('display_teacher_in_courselist') === 'true') {
3834 3834
                 $teachers = CourseManager::getTeachersFromCourse($course_info['real_id'], false);
@@ -3836,7 +3836,7 @@  discard block
 block discarded – undo
3836 3836
 
3837 3837
             $params['status'] = $row['status'];
3838 3838
             if (api_get_setting('display_coursecode_in_courselist') == 'true') {
3839
-                $params['code_course'] = '(' . $course_info['visual_code'] . ') ';
3839
+                $params['code_course'] = '('.$course_info['visual_code'].') ';
3840 3840
             }
3841 3841
 
3842 3842
             $params['visibility'] = $course_info['visibility'];
@@ -3880,7 +3880,7 @@  discard block
 block discarded – undo
3880 3880
 
3881 3881
         $without_special_courses = '';
3882 3882
         if (!empty($special_course_list)) {
3883
-            $without_special_courses = ' AND course.id NOT IN ("' . implode('","', $special_course_list) . '")';
3883
+            $without_special_courses = ' AND course.id NOT IN ("'.implode('","', $special_course_list).'")';
3884 3884
         }
3885 3885
 
3886 3886
         $sql = "SELECT
@@ -3898,14 +3898,14 @@  discard block
 block discarded – undo
3898 3898
                 INNER JOIN $TABLE_ACCESS_URL_REL_COURSE url
3899 3899
                 ON (url.c_id = course.id)
3900 3900
                 WHERE
3901
-                    course_rel_user.user_id = '" . $user_id . "' AND
3902
-                    course_rel_user.user_course_cat = '" . $user_category_id . "'
3901
+                    course_rel_user.user_id = '".$user_id."' AND
3902
+                    course_rel_user.user_course_cat = '" . $user_category_id."'
3903 3903
                     $without_special_courses ";
3904 3904
 
3905 3905
         // If multiple URL access mode is enabled, only fetch courses
3906 3906
         // corresponding to the current URL.
3907 3907
         if (api_get_multiple_access_url() && $current_url_id != -1) {
3908
-            $sql .= " AND url.c_id = course.id AND access_url_id='" . $current_url_id . "'";
3908
+            $sql .= " AND url.c_id = course.id AND access_url_id='".$current_url_id."'";
3909 3909
         }
3910 3910
         // Use user's classification for courses (if any).
3911 3911
         $sql .= " ORDER BY course_rel_user.user_course_cat, course_rel_user.sort ASC";
@@ -3934,28 +3934,28 @@  discard block
 block discarded – undo
3934 3934
             if ($showCustomIcon === 'true' && $iconName != 'course.png') {
3935 3935
                 $thumbnails = $course_info['course_image'];
3936 3936
                 $image = $course_info['course_image_large'];
3937
-            }else{
3938
-                $image = Display::return_icon('session_default.png', null, null, null,null, true);
3937
+            } else {
3938
+                $image = Display::return_icon('session_default.png', null, null, null, null, true);
3939 3939
             }
3940 3940
 
3941 3941
             $params = array();
3942 3942
             $params['edit_actions'] = '';
3943 3943
             $params['document'] = '';
3944 3944
             if (api_is_platform_admin()) {
3945
-                $params['edit_actions'] .= api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course_info['code'];
3946
-                if($load_dirs){
3947
-                    $params['document'] = '<a id="document_preview_' . $course_info['real_id'] . '_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3948
-                               . Display::returnFontAwesomeIcon('folder-open') . '</a>';
3949
-                    $params['document'] .= Display::div('', array('id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container'));
3945
+                $params['edit_actions'] .= api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course_info['code'];
3946
+                if ($load_dirs) {
3947
+                    $params['document'] = '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3948
+                               . Display::returnFontAwesomeIcon('folder-open').'</a>';
3949
+                    $params['document'] .= Display::div('', array('id' => 'document_result_'.$course_info['real_id'].'_0', 'class' => 'document_preview_container'));
3950 3950
                 }
3951 3951
             }
3952 3952
             if ($load_dirs) {
3953
-                $params['document'] = '<a id="document_preview_' . $course_info['real_id'] . '_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3954
-                    . Display::returnFontAwesomeIcon('folder-open') . '</a>';
3955
-                $params['document'] .= Display::div('', array('id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container'));
3953
+                $params['document'] = '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'
3954
+                    . Display::returnFontAwesomeIcon('folder-open').'</a>';
3955
+                $params['document'] .= Display::div('', array('id' => 'document_result_'.$course_info['real_id'].'_0', 'class' => 'document_preview_container'));
3956 3956
             }
3957 3957
 
3958
-            $course_title_url = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?id_session=0';
3958
+            $course_title_url = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/index.php?id_session=0';
3959 3959
 
3960 3960
             $teachers = [];
3961 3961
             if (api_get_setting('display_teacher_in_courselist') === 'true') {
@@ -3964,7 +3964,7 @@  discard block
 block discarded – undo
3964 3964
             $params['status'] = $row['status'];
3965 3965
 
3966 3966
             if (api_get_setting('display_coursecode_in_courselist') == 'true') {
3967
-                $params['code_course'] = '(' . $course_info['visual_code'] . ') ';
3967
+                $params['code_course'] = '('.$course_info['visual_code'].') ';
3968 3968
             }
3969 3969
 
3970 3970
             $params['visibility'] = $course_info['visibility'];
@@ -4152,15 +4152,15 @@  discard block
 block discarded – undo
4152 4152
                 }
4153 4153
 
4154 4154
                 if ($userInCourseStatus == COURSEMANAGER || $sessionCourseAvailable) {
4155
-                    $session_url = $course_info['course_public_url'] . '?id_session=' . $course_info['id_session'];
4156
-                    $session_title = '<a href="' . $session_url. '">'. $course_info['name'] . '</a>'.$notifications;
4155
+                    $session_url = $course_info['course_public_url'].'?id_session='.$course_info['id_session'];
4156
+                    $session_title = '<a href="'.$session_url.'">'.$course_info['name'].'</a>'.$notifications;
4157 4157
                 } else {
4158 4158
                     $session_title = $course_info['name'];
4159 4159
                 }
4160 4160
 
4161 4161
             } else {
4162 4162
                 $session_title =
4163
-                    $course_info['name'] . ' ' .
4163
+                    $course_info['name'].' '.
4164 4164
                     Display::tag('span', get_lang('CourseClosed'), array('class' => 'item_closed'));
4165 4165
             }
4166 4166
         } else {
@@ -4176,7 +4176,7 @@  discard block
 block discarded – undo
4176 4176
             $thumbnails = $course_info['course_image'];
4177 4177
             $image = $course_info['course_image_large'];
4178 4178
         } else {
4179
-            $image = Display::return_icon('session_default.png', null, null, null,null, true);
4179
+            $image = Display::return_icon('session_default.png', null, null, null, null, true);
4180 4180
         }
4181 4181
         $params['thumbnails'] = $thumbnails;
4182 4182
         $params['image'] = $image;
@@ -4189,12 +4189,12 @@  discard block
 block discarded – undo
4189 4189
             $course_visibility != COURSE_VISIBILITY_HIDDEN
4190 4190
         ) {
4191 4191
             if (api_is_platform_admin()) {
4192
-                $params['edit_actions'] .= api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course_info['code'];
4192
+                $params['edit_actions'] .= api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course_info['code'];
4193 4193
                 if ($load_dirs) {
4194
-                    $params['document'] .= '<a id="document_preview_' . $course_info['real_id'] . '_' . $course_info['id_session'] . '" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">' .
4195
-                        Display::returnFontAwesomeIcon('folder-open') . '</a>';
4194
+                    $params['document'] .= '<a id="document_preview_'.$course_info['real_id'].'_'.$course_info['id_session'].'" class="document_preview btn btn-default btn-sm" href="javascript:void(0);">'.
4195
+                        Display::returnFontAwesomeIcon('folder-open').'</a>';
4196 4196
                     $params['document'] .= Display::div('', array(
4197
-                        'id' => 'document_result_' . $course_info['real_id'] . '_' . $course_info['id_session'],
4197
+                        'id' => 'document_result_'.$course_info['real_id'].'_'.$course_info['id_session'],
4198 4198
                         'class' => 'document_preview_container'
4199 4199
                     ));
4200 4200
                 }
@@ -4202,7 +4202,7 @@  discard block
 block discarded – undo
4202 4202
         }
4203 4203
 
4204 4204
         if (api_get_setting('display_coursecode_in_courselist') === 'true') {
4205
-            $session_title .= ' (' . $course_info['visual_code'] . ') ';
4205
+            $session_title .= ' ('.$course_info['visual_code'].') ';
4206 4206
         }
4207 4207
 
4208 4208
         if (api_get_setting('display_teacher_in_courselist') === 'true') {
@@ -4223,7 +4223,7 @@  discard block
 block discarded – undo
4223 4223
             }
4224 4224
         }
4225 4225
 
4226
-        $session_title .= isset($course['special_course']) ? ' ' .
4226
+        $session_title .= isset($course['special_course']) ? ' '.
4227 4227
                           Display::return_icon('klipper.png', get_lang('CourseAutoRegister')) : '';
4228 4228
 
4229 4229
         $params['title'] = $session_title;
@@ -4250,13 +4250,13 @@  discard block
 block discarded – undo
4250 4250
                 ) {
4251 4251
                     $session['dates'] = '';
4252 4252
                     if (api_get_setting('show_session_coach') === 'true') {
4253
-                        $session['coach'] = get_lang('GeneralCoach') . ': ' . $sessionCoachName;
4253
+                        $session['coach'] = get_lang('GeneralCoach').': '.$sessionCoachName;
4254 4254
                     }
4255 4255
                     $active = true;
4256 4256
                 } else {
4257
-                    $session ['dates'] = ' - ' . get_lang('From') . ' ' . $session['access_start_date'] . ' ' . get_lang('To') . ' ' . $session['access_end_date'];
4257
+                    $session ['dates'] = ' - '.get_lang('From').' '.$session['access_start_date'].' '.get_lang('To').' '.$session['access_end_date'];
4258 4258
                     if (api_get_setting('show_session_coach') === 'true') {
4259
-                        $session['coach'] = get_lang('GeneralCoach') . ': ' . $sessionCoachName;
4259
+                        $session['coach'] = get_lang('GeneralCoach').': '.$sessionCoachName;
4260 4260
                     }
4261 4261
                     $date_start = $session['access_start_date'];
4262 4262
                     $date_end = $session['access_end_date'];
@@ -4389,7 +4389,7 @@  discard block
 block discarded – undo
4389 4389
             if (Database::num_rows($result) > 0) {
4390 4390
                 $row = Database::fetch_array($result);
4391 4391
                 $count = $row['count'] + 1;
4392
-                $wanted_code = $wanted_code . '_' . $count;
4392
+                $wanted_code = $wanted_code.'_'.$count;
4393 4393
                 $result = api_get_course_info($wanted_code);
4394 4394
                 if (empty($result)) {
4395 4395
                     return $wanted_code;
@@ -4423,7 +4423,7 @@  discard block
 block discarded – undo
4423 4423
         $enabled = api_get_plugin_setting('courselegal', 'tool_enable');
4424 4424
 
4425 4425
         if ($enabled == 'true') {
4426
-            require_once api_get_path(SYS_PLUGIN_PATH) . 'courselegal/config.php';
4426
+            require_once api_get_path(SYS_PLUGIN_PATH).'courselegal/config.php';
4427 4427
             $plugin = CourseLegalPlugin::create();
4428 4428
             return $plugin->isUserAcceptedLegal($user_id, $course_code, $session_id);
4429 4429
         }
@@ -4468,7 +4468,7 @@  discard block
 block discarded – undo
4468 4468
         $enabled = api_get_plugin_setting('courselegal', 'tool_enable');
4469 4469
 
4470 4470
         if ($enabled == 'true') {
4471
-            require_once api_get_path(SYS_PLUGIN_PATH) . 'courselegal/config.php';
4471
+            require_once api_get_path(SYS_PLUGIN_PATH).'courselegal/config.php';
4472 4472
             $plugin = CourseLegalPlugin::create();
4473 4473
             return $plugin->saveUserLegal($user_id, $course_code, $session_id);
4474 4474
         }
@@ -4810,10 +4810,10 @@  discard block
 block discarded – undo
4810 4810
                 INNER JOIN $table_course_url u
4811 4811
                 ON u.c_id = c.id
4812 4812
                 WHERE
4813
-                    u.access_url_id = " . api_get_current_access_url_id() . " AND
4813
+                    u.access_url_id = ".api_get_current_access_url_id()." AND
4814 4814
                     login_course_date <= '$now' AND
4815 4815
                     login_course_date > DATE_SUB('$now', INTERVAL $days DAY) AND
4816
-                    visibility <> '" . COURSE_VISIBILITY_CLOSED . "' AND visibility <> '" . COURSE_VISIBILITY_HIDDEN . "'
4816
+                    visibility <> '".COURSE_VISIBILITY_CLOSED."' AND visibility <> '".COURSE_VISIBILITY_HIDDEN."'
4817 4817
                 GROUP BY a.c_id
4818 4818
                 ORDER BY course_count DESC
4819 4819
                 LIMIT $limit
@@ -4838,7 +4838,7 @@  discard block
 block discarded – undo
4838 4838
     public static function process_hot_course_item($courses, $my_course_code_list = array())
4839 4839
     {
4840 4840
         $hotCourses = [];
4841
-        $ajax_url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=add_course_vote';
4841
+        $ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote';
4842 4842
         $stok = Security::get_existing_token();
4843 4843
         $user_id = api_get_user_id();
4844 4844
 
@@ -4884,7 +4884,7 @@  discard block
 block discarded – undo
4884 4884
             if ($access_link && in_array('register', $access_link)) {
4885 4885
                 $my_course['register_button'] = Display::url(
4886 4886
                     Display::returnFontAwesomeIcon('sign-in'),
4887
-                    api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?action=subscribe&sec_token=' . $stok,
4887
+                    api_get_path(WEB_COURSE_PATH).$course_info['path'].'/index.php?action=subscribe&sec_token='.$stok,
4888 4888
                     array('class' => 'btn btn-success btn-sm', 'title' => get_lang('Subscribe')));
4889 4889
             }
4890 4890
 
@@ -4893,14 +4893,14 @@  discard block
 block discarded – undo
4893 4893
             ) {
4894 4894
                 $my_course['go_to_course_button'] = Display::url(
4895 4895
                     Display::returnFontAwesomeIcon('share'),
4896
-                    api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php',
4896
+                    api_get_path(WEB_COURSE_PATH).$course_info['path'].'/index.php',
4897 4897
                     array('class' => 'btn btn-default btn-sm', 'title' => get_lang('GoToCourse')));
4898 4898
             }
4899 4899
 
4900 4900
             if ($access_link && in_array('unsubscribe', $access_link)) {
4901 4901
                 $my_course['unsubscribe_button'] = Display::url(
4902 4902
                     Display::returnFontAwesomeIcon('sign-out'),
4903
-                    api_get_path(WEB_CODE_PATH) . 'auth/courses.php?action=unsubscribe&unsubscribe=' . $courseCode . '&sec_token=' . $stok . '&category_code=' . $categoryCode,
4903
+                    api_get_path(WEB_CODE_PATH).'auth/courses.php?action=unsubscribe&unsubscribe='.$courseCode.'&sec_token='.$stok.'&category_code='.$categoryCode,
4904 4904
                     array('class' => 'btn btn-danger btn-sm', 'title' => get_lang('Unreg')));
4905 4905
             }
4906 4906
 
@@ -4925,7 +4925,7 @@  discard block
 block discarded – undo
4925 4925
             ) { */
4926 4926
                 $my_course['description_button'] = Display::url(
4927 4927
                     Display::returnFontAwesomeIcon('info-circle'),
4928
-                    api_get_path(WEB_AJAX_PATH) . 'course_home.ajax.php?a=show_course_information&code=' . $course_info['code'],
4928
+                    api_get_path(WEB_AJAX_PATH).'course_home.ajax.php?a=show_course_information&code='.$course_info['code'],
4929 4929
                     [
4930 4930
                         'class' => 'btn btn-default btn-sm ajax',
4931 4931
                         'data-title' => get_lang('Description'),
@@ -4936,8 +4936,8 @@  discard block
 block discarded – undo
4936 4936
             /* get_lang('Description') */
4937 4937
             $my_course['teachers'] = CourseManager::getTeachersFromCourse($course_info['real_id'], false);
4938 4938
             $point_info = self::get_course_ranking($course_info['real_id'], 0);
4939
-            $my_course['rating_html'] = Display::return_rating_system('star_' . $course_info['real_id'],
4940
-                $ajax_url . '&course_id=' . $course_info['real_id'], $point_info);
4939
+            $my_course['rating_html'] = Display::return_rating_system('star_'.$course_info['real_id'],
4940
+                $ajax_url.'&course_id='.$course_info['real_id'], $point_info);
4941 4941
 
4942 4942
             $hotCourses[] = $my_course;
4943 4943
         }
@@ -5015,9 +5015,9 @@  discard block
 block discarded – undo
5015 5015
                     WHERE
5016 5016
                         c.id = u.c_id AND
5017 5017
                         u.access_url_id = $urlId AND
5018
-                        visibility <> " . COURSE_VISIBILITY_HIDDEN;
5018
+                        visibility <> ".COURSE_VISIBILITY_HIDDEN;
5019 5019
         } else {
5020
-            $sql .= " WHERE visibility <> " . COURSE_VISIBILITY_HIDDEN;
5020
+            $sql .= " WHERE visibility <> ".COURSE_VISIBILITY_HIDDEN;
5021 5021
         }
5022 5022
         $res = Database::query($sql);
5023 5023
         $row = Database::fetch_row($res);
@@ -5042,16 +5042,16 @@  discard block
 block discarded – undo
5042 5042
         $restrictedCourses = self::getCatalogueCourseList(true);
5043 5043
         $allowedCoursesToCurrentUser = self::getCatalogueCourseList(true, $currentUserId);
5044 5044
         if (!empty($restrictedCourses)) {
5045
-            $visibilityCondition .= ' AND ('.$courseTableAlias.'.code NOT IN ("' . implode('","', $restrictedCourses) . '")';
5046
-            $visibilityCondition .= ' OR '.$courseTableAlias.'.code IN ("' . implode('","', $allowedCoursesToCurrentUser) . '"))';
5045
+            $visibilityCondition .= ' AND ('.$courseTableAlias.'.code NOT IN ("'.implode('","', $restrictedCourses).'")';
5046
+            $visibilityCondition .= ' OR '.$courseTableAlias.'.code IN ("'.implode('","', $allowedCoursesToCurrentUser).'"))';
5047 5047
         }
5048 5048
 
5049 5049
         // Check if course have users denied to see it in the catalogue, then show only if current user is not denied to see it
5050 5050
         $restrictedCourses = self::getCatalogueCourseList(false);
5051 5051
         $notAllowedCoursesToCurrentUser = self::getCatalogueCourseList(false, $currentUserId);
5052 5052
         if (!empty($restrictedCourses)) {
5053
-            $visibilityCondition .= ' AND ('.$courseTableAlias.'.code NOT IN ("' . implode('","', $restrictedCourses) . '")';
5054
-            $visibilityCondition .= ' OR '.$courseTableAlias.'.code NOT IN ("' . implode('","', $notAllowedCoursesToCurrentUser) . '"))';
5053
+            $visibilityCondition .= ' AND ('.$courseTableAlias.'.code NOT IN ("'.implode('","', $restrictedCourses).'")';
5054
+            $visibilityCondition .= ' OR '.$courseTableAlias.'.code NOT IN ("'.implode('","', $notAllowedCoursesToCurrentUser).'"))';
5055 5055
         }
5056 5056
 
5057 5057
         return $visibilityCondition;
@@ -5071,7 +5071,7 @@  discard block
 block discarded – undo
5071 5071
 
5072 5072
         $withoutSpecialCourses = '';
5073 5073
         if (!empty($specialCourseList)) {
5074
-            $withoutSpecialCourses = ' AND c.id NOT IN ("' . implode('","', $specialCourseList) . '")';
5074
+            $withoutSpecialCourses = ' AND c.id NOT IN ("'.implode('","', $specialCourseList).'")';
5075 5075
         }
5076 5076
 
5077 5077
         $visibilityCondition = self::getCourseVisibilitySQLCondition('c');
@@ -5202,12 +5202,12 @@  discard block
 block discarded – undo
5202 5202
             if (count($teachers) > 0) {
5203 5203
                 foreach ($teachers as $key) {
5204 5204
                     $key = Database::escape_string($key);
5205
-                    $cond .= " AND user_id <> '" . $key . "'";
5205
+                    $cond .= " AND user_id <> '".$key."'";
5206 5206
                 }
5207 5207
             }
5208 5208
 
5209
-            $sql = 'DELETE FROM ' . $course_user_table . '
5210
-                    WHERE c_id ="' . $courseId . '" AND status="1" AND relation_type = 0 ' . $cond;
5209
+            $sql = 'DELETE FROM '.$course_user_table.'
5210
+                    WHERE c_id ="' . $courseId.'" AND status="1" AND relation_type = 0 '.$cond;
5211 5211
             Database::query($sql);
5212 5212
         }
5213 5213
 
@@ -5215,12 +5215,12 @@  discard block
 block discarded – undo
5215 5215
             foreach ($teachers as $userId) {
5216 5216
                 $userId = intval($userId);
5217 5217
                 // We check if the teacher is already subscribed in this course
5218
-                $sql = 'SELECT 1 FROM ' . $course_user_table . '
5219
-                        WHERE user_id = "' . $userId . '" AND c_id = "' . $courseId . '" ';
5218
+                $sql = 'SELECT 1 FROM '.$course_user_table.'
5219
+                        WHERE user_id = "' . $userId.'" AND c_id = "'.$courseId.'" ';
5220 5220
                 $result = Database::query($sql);
5221 5221
                 if (Database::num_rows($result)) {
5222
-                    $sql = 'UPDATE ' . $course_user_table . ' SET status = "1"
5223
-                            WHERE c_id = "' . $courseId . '" AND user_id = "' . $userId . '"  ';
5222
+                    $sql = 'UPDATE '.$course_user_table.' SET status = "1"
5223
+                            WHERE c_id = "' . $courseId.'" AND user_id = "'.$userId.'"  ';
5224 5224
                 } else {
5225 5225
                     $userCourseCategory = '0';
5226 5226
                     if (isset($teacherBackup[$userId]) &&
@@ -5230,9 +5230,9 @@  discard block
 block discarded – undo
5230 5230
                         $userCourseCategory = $courseUserData['user_course_cat'];
5231 5231
                     }
5232 5232
 
5233
-                    $sql = "INSERT INTO " . $course_user_table . " SET
5234
-                            c_id = " . $courseId . ",
5235
-                            user_id = " . $userId . ",
5233
+                    $sql = "INSERT INTO ".$course_user_table." SET
5234
+                            c_id = " . $courseId.",
5235
+                            user_id = " . $userId.",
5236 5236
                             status = '1',
5237 5237
                             is_tutor = '0',
5238 5238
                             sort = '0',
@@ -5584,8 +5584,8 @@  discard block
 block discarded – undo
5584 5584
     {
5585 5585
         $tbl_main_categories = Database:: get_main_table(TABLE_MAIN_COURSE);
5586 5586
         $sql = 'SELECT title
5587
-                FROM ' . $tbl_main_categories . '
5588
-                WHERE code = "' . Database::escape_string($code) . '"';
5587
+                FROM ' . $tbl_main_categories.'
5588
+                WHERE code = "' . Database::escape_string($code).'"';
5589 5589
         $result = Database::query($sql);
5590 5590
         if ($col = Database::fetch_array($result)) {
5591 5591
             return $col['title'];
@@ -5766,7 +5766,7 @@  discard block
 block discarded – undo
5766 5766
             foreach ($group_list as $this_group) {
5767 5767
                 if (is_array($to_already_selected)) {
5768 5768
                     if (!in_array(
5769
-                        "GROUP:" . $this_group['id'],
5769
+                        "GROUP:".$this_group['id'],
5770 5770
                         $to_already_selected
5771 5771
                     )
5772 5772
                     ) { // $to_already_selected is the array containing the groups (and users) that are already selected
@@ -5774,8 +5774,8 @@  discard block
 block discarded – undo
5774 5774
                         $user_disabled = ($this_group['userNb'] > 0) ? "" : "disabled=disabled";
5775 5775
                         $result[] = array(
5776 5776
                             'disabled' => $user_disabled,
5777
-                            'value' => "GROUP:" . $this_group['id'],
5778
-                            'content' => "G: " . $this_group['name'] . " - " . $this_group['userNb'] . " " . $user_label
5777
+                            'value' => "GROUP:".$this_group['id'],
5778
+                            'content' => "G: ".$this_group['name']." - ".$this_group['userNb']." ".$user_label
5779 5779
                         );
5780 5780
                     }
5781 5781
                 }
@@ -5787,13 +5787,13 @@  discard block
 block discarded – undo
5787 5787
             foreach ($user_list as $user) {
5788 5788
                 if (is_array($to_already_selected)) {
5789 5789
                     if (!in_array(
5790
-                        "USER:" . $user['user_id'],
5790
+                        "USER:".$user['user_id'],
5791 5791
                         $to_already_selected
5792 5792
                     )
5793 5793
                     ) { // $to_already_selected is the array containing the users (and groups) that are already selected
5794 5794
 
5795 5795
                         $result[] = array(
5796
-                            'value' => "USER:" . $user['user_id'],
5796
+                            'value' => "USER:".$user['user_id'],
5797 5797
                             'content' => api_get_person_name($user['firstname'], $user['lastname'])
5798 5798
                         );
5799 5799
                     }
@@ -5822,7 +5822,7 @@  discard block
 block discarded – undo
5822 5822
     {
5823 5823
         $category_id = intval($category_id);
5824 5824
         $info = Database::fetch_array(
5825
-            Database::query('SELECT c_id FROM ' . Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY) . '
5825
+            Database::query('SELECT c_id FROM '.Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY).'
5826 5826
             WHERE id=' . $category_id), 'ASSOC'
5827 5827
         );
5828 5828
         return $info ? $info['c_id'] : false;
@@ -5838,15 +5838,14 @@  discard block
 block discarded – undo
5838 5838
     public static function getCoursesWithoutSession($startDate = null, $endDate = null, $includeClosed = false)
5839 5839
     {
5840 5840
         $dateConditional = ($startDate && $endDate) ?
5841
-            " WHERE session_id IN (SELECT id FROM " . Database::get_main_table(TABLE_MAIN_SESSION) .
5842
-            " WHERE access_start_date = '$startDate' AND access_end_date = '$endDate')" :
5843
-            null;
5841
+            " WHERE session_id IN (SELECT id FROM ".Database::get_main_table(TABLE_MAIN_SESSION).
5842
+            " WHERE access_start_date = '$startDate' AND access_end_date = '$endDate')" : null;
5844 5843
         $visibility = ($includeClosed ? '' : 'visibility NOT IN (0, 4) AND ');
5845 5844
 
5846 5845
         $query = "SELECT id, code, title
5847
-                FROM " . Database::get_main_table(TABLE_MAIN_COURSE). "
5846
+                FROM " . Database::get_main_table(TABLE_MAIN_COURSE)."
5848 5847
                 WHERE $visibility code NOT IN (
5849
-                    SELECT DISTINCT course_code FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE) . $dateConditional . ")
5848
+                    SELECT DISTINCT course_code FROM ".Database::get_main_table(TABLE_MAIN_SESSION_COURSE).$dateConditional.")
5850 5849
                 ORDER BY id";
5851 5850
 
5852 5851
         $result = Database::query($query);
@@ -5879,7 +5878,7 @@  discard block
 block discarded – undo
5879 5878
                 FROM $courseTable c
5880 5879
                 INNER JOIN $courseUserTable cru ON c.id = cru.c_id
5881 5880
                 WHERE (
5882
-                    cru.user_id IN (" . implode(', ', $userIdList) . ")
5881
+                    cru.user_id IN (".implode(', ', $userIdList).")
5883 5882
                     AND cru.relation_type = 0
5884 5883
                 )";
5885 5884
 
@@ -5894,7 +5893,7 @@  discard block
 block discarded – undo
5894 5893
                         INNER JOIN $courseAccessUrlTable crau ON c.id = crau.c_id
5895 5894
                         WHERE crau.access_url_id = $accessUrlId
5896 5895
                             AND (
5897
-                            cru.id_user IN (" . implode(', ', $userIdList) . ") AND
5896
+                            cru.id_user IN (".implode(', ', $userIdList).") AND
5898 5897
                             cru.relation_type = 0
5899 5898
                         )";
5900 5899
             }
@@ -5947,7 +5946,7 @@  discard block
 block discarded – undo
5947 5946
                         $result = $objExercise->read($exercise_redirect);
5948 5947
 
5949 5948
                         if (!empty($exercise_redirect) && !empty($result)) {
5950
-                            $form_data['action'] = api_get_path(WEB_CODE_PATH) . 'exercise/overview.php?exerciseId='.$exercise_redirect.'&cidReq='.$course_info['code'];
5949
+                            $form_data['action'] = api_get_path(WEB_CODE_PATH).'exercise/overview.php?exerciseId='.$exercise_redirect.'&cidReq='.$course_info['code'];
5951 5950
                             $form_data['message'] .= '<br />'.get_lang('YouCanAccessTheExercise');
5952 5951
                             $form_data['button'] = Display::button(
5953 5952
                                 'next',
@@ -6003,7 +6002,7 @@  discard block
 block discarded – undo
6003 6002
 
6004 6003
         $without_special_courses = '';
6005 6004
         if (!empty($special_course_list)) {
6006
-            $without_special_courses = ' AND course.id NOT IN ("'.implode('","',$special_course_list).'")';
6005
+            $without_special_courses = ' AND course.id NOT IN ("'.implode('","', $special_course_list).'")';
6007 6006
         }
6008 6007
 
6009 6008
         //AND course_rel_user.relation_type<>".COURSE_RELATION_TYPE_RRHH."
@@ -6067,11 +6066,11 @@  discard block
 block discarded – undo
6067 6066
 
6068 6067
         if (api_is_platform_admin()) {
6069 6068
             if ($loadDirs) {
6070
-                $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>';
6071
-                $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>';
6069
+                $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>';
6070
+                $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>';
6072 6071
                 $params['right_actions'] .= Display::div('', array('id' => 'document_result_'.$course_info['real_id'].'_0', 'class'=>'document_preview_container'));
6073 6072
             } else {
6074
-                $params['right_actions'].= '<a class="btn btn-default btn-sm" title="'.get_lang('Edit').'" href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::returnFontAwesomeIcon('pencil').'</a>';
6073
+                $params['right_actions'] .= '<a class="btn btn-default btn-sm" title="'.get_lang('Edit').'" href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::returnFontAwesomeIcon('pencil').'</a>';
6075 6074
             }
6076 6075
 
6077 6076
             if ($course_info['status'] == COURSEMANAGER) {
@@ -6080,11 +6079,11 @@  discard block
 block discarded – undo
6080 6079
         } else {
6081 6080
             if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) {
6082 6081
                 if ($loadDirs) {
6083
-                    $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>';
6082
+                    $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>';
6084 6083
                     $params['right_actions'] .= Display::div('', array('id' => 'document_result_'.$course_info['real_id'].'_0', 'class'=>'document_preview_container'));
6085 6084
                 } else {
6086 6085
                     if ($course_info['status'] == COURSEMANAGER) {
6087
-                        $params['right_actions'].= '<a class="btn btn-default btn-sm" title="'.get_lang('Edit').'" href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::returnFontAwesomeIcon('pencil').'</a>';
6086
+                        $params['right_actions'] .= '<a class="btn btn-default btn-sm" title="'.get_lang('Edit').'" href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::returnFontAwesomeIcon('pencil').'</a>';
6088 6087
                     }
6089 6088
                 }
6090 6089
             }
@@ -6095,7 +6094,7 @@  discard block
 block discarded – undo
6095 6094
             $course_title_url = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/?id_session=0';
6096 6095
             $course_title = Display::url($course_info['title'], $course_title_url);
6097 6096
         } else {
6098
-            $course_title = $course_info['title'].' '.Display::tag('span',get_lang('CourseClosed'), array('class'=>'item_closed'));
6097
+            $course_title = $course_info['title'].' '.Display::tag('span', get_lang('CourseClosed'), array('class'=>'item_closed'));
6099 6098
         }
6100 6099
 
6101 6100
         // Start displaying the course block itself
@@ -6221,11 +6220,11 @@  discard block
 block discarded – undo
6221 6220
 
6222 6221
             if (api_is_platform_admin()) {
6223 6222
                 if ($load_dirs) {
6224
-                    $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>';
6225
-                    $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>';
6223
+                    $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>';
6224
+                    $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>';
6226 6225
                     $params['right_actions'] .= Display::div('', array('id' => 'document_result_'.$course_info['real_id'].'_0', 'class'=>'document_preview_container'));
6227 6226
                 } else {
6228
-                    $params['right_actions'].= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>';
6227
+                    $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>';
6229 6228
                 }
6230 6229
 
6231 6230
                 if ($course_info['status'] == COURSEMANAGER) {
@@ -6234,11 +6233,11 @@  discard block
 block discarded – undo
6234 6233
             } else {
6235 6234
                 if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) {
6236 6235
                     if ($load_dirs) {
6237
-                        $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>';
6236
+                        $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>';
6238 6237
                         $params['right_actions'] .= Display::div('', array('id' => 'document_result_'.$course_info['real_id'].'_0', 'class'=>'document_preview_container'));
6239 6238
                     } else {
6240 6239
                         if ($course_info['status'] == COURSEMANAGER) {
6241
-                            $params['right_actions'].= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>';
6240
+                            $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>';
6242 6241
                         }
6243 6242
                     }
6244 6243
                 }
@@ -6250,7 +6249,7 @@  discard block
 block discarded – undo
6250 6249
                 $course_title_url = api_get_path(WEB_COURSE_PATH).$course_info['code'].'/index.php?id_session=0';
6251 6250
                 $course_title = Display::url($course_info['title'], $course_title_url);
6252 6251
             } else {
6253
-                $course_title = $course_info['title']." ".Display::tag('span',get_lang('CourseClosed'), array('class'=>'item_closed'));
6252
+                $course_title = $course_info['title']." ".Display::tag('span', get_lang('CourseClosed'), array('class'=>'item_closed'));
6254 6253
             }
6255 6254
 
6256 6255
             // Start displaying the course block itself
Please login to merge, or discard this patch.
main/inc/lib/userportal.lib.php 2 patches
Doc Comments   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -476,6 +476,7 @@  discard block
 block discarded – undo
476 476
     * retrieves all the courses that the user has already subscribed to
477 477
     * @author Patrick Cool <[email protected]>, Ghent University, Belgium
478 478
     * @param int $user_id: the id of the user
479
+    * @param integer $user_id
479 480
     * @return array an array containing all the information of the courses of the given user
480 481
     */
481 482
     public function get_courses_of_user($user_id)
@@ -526,8 +527,8 @@  discard block
 block discarded – undo
526 527
 
527 528
     /**
528 529
      * @todo use the template system
529
-     * @param $title
530
-     * @param $content
530
+     * @param string $title
531
+     * @param string $content
531 532
      * @param string $id
532 533
      * @param array $params
533 534
      * @param string $idAccordion
@@ -1361,8 +1362,8 @@  discard block
 block discarded – undo
1361 1362
 
1362 1363
     /**
1363 1364
      * Return HTML code for personal user course category
1364
-     * @param $id
1365
-     * @param $title
1365
+     * @param integer $id
1366
+     * @param string $title
1366 1367
      * @return string
1367 1368
      */
1368 1369
     private static function getHtmlForUserCategory($id, $title)
@@ -1383,7 +1384,7 @@  discard block
 block discarded – undo
1383 1384
     /**
1384 1385
      * return HTML code for course display in session view
1385 1386
      * @param array $courseInfo
1386
-     * @param $userCategoryId
1387
+     * @param integer $userCategoryId
1387 1388
      * @param bool $displayButton
1388 1389
      * @param $loadDirs
1389 1390
      * @return string
Please login to merge, or discard this patch.
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
                 );
49 49
 
50 50
                 foreach ($exercises as $exercise_item) {
51
-                    $exercise_item['course_code']     = $course_code;
52
-                    $exercise_item['session_id']     = $session_id;
53
-                    $exercise_item['tms']     = api_strtotime($exercise_item['end_time'], 'UTC');
51
+                    $exercise_item['course_code'] = $course_code;
52
+                    $exercise_item['session_id'] = $session_id;
53
+                    $exercise_item['tms'] = api_strtotime($exercise_item['end_time'], 'UTC');
54 54
 
55 55
                     $exercise_list[] = $exercise_item;
56 56
                 }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         // Including the page for the news
107 107
         $html = '';
108 108
         if (!empty($_GET['include']) && preg_match('/^[a-zA-Z0-9_-]*\.html$/', $_GET['include'])) {
109
-            $open = @(string)file_get_contents($this->home.$_GET['include']);
109
+            $open = @(string) file_get_contents($this->home.$_GET['include']);
110 110
             $html = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
111 111
         } else {
112 112
             // Hiding home top when user not connected.
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
                     $home_top_temp = file_get_contents($this->home.'home_top.html');
137 137
                 } else {
138 138
                     if (file_exists($this->default_home.'home_top.html')) {
139
-                        $home_top_temp = file_get_contents($this->default_home . 'home_top.html');
139
+                        $home_top_temp = file_get_contents($this->default_home.'home_top.html');
140 140
                     }
141 141
                 }
142 142
             }
143 143
 
144 144
 			if (trim($home_top_temp) == '' && api_is_platform_admin()) {
145
-				$home_top_temp = '<div class="welcome-mascot">' . get_lang('PortalHomepageDefaultIntroduction') . '</div>';
145
+				$home_top_temp = '<div class="welcome-mascot">'.get_lang('PortalHomepageDefaultIntroduction').'</div>';
146 146
 			} else {
147
-				$home_top_temp = '<div class="welcome-home-top-temp">' . $home_top_temp . '</div>';
147
+				$home_top_temp = '<div class="welcome-home-top-temp">'.$home_top_temp.'</div>';
148 148
 			}
149 149
 			$open = str_replace('{rel_path}', api_get_path(REL_PATH), $home_top_temp);
150 150
 			$html = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
 
163 163
         $html = '';
164 164
         // Notice
165
-        $home_notice = @(string)file_get_contents($this->home.'home_notice_'.$user_selected_language.'.html');
165
+        $home_notice = @(string) file_get_contents($this->home.'home_notice_'.$user_selected_language.'.html');
166 166
         if (empty($home_notice)) {
167
-            $home_notice = @(string)file_get_contents($this->home.'home_notice.html');
167
+            $home_notice = @(string) file_get_contents($this->home.'home_notice.html');
168 168
         }
169 169
 
170 170
         if (!empty($home_notice)) {
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
         }
198 198
 
199 199
         $html = '';
200
-        $home_menu = @(string)file_get_contents($this->home.'home_menu_'.$user_selected_language.'.html');
200
+        $home_menu = @(string) file_get_contents($this->home.'home_menu_'.$user_selected_language.'.html');
201 201
         if (!empty($home_menu)) {
202 202
             $home_menu_content = '<ul class="nav nav-pills nav-stacked">';
203 203
             $home_menu_content .= api_to_system_encoding($home_menu, api_detect_encoding(strip_tags($home_menu)));
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
         // Get list of courses in category $category.
242 242
         $sql = "SELECT * FROM $main_course_table cours
243
-                WHERE category_code = '" . $category . "'
243
+                WHERE category_code = '".$category."'
244 244
                 ORDER BY title, UPPER(visual_code)";
245 245
 
246 246
         // Showing only the courses of the current access_url_id.
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
                     FROM $main_category_table t1
287 287
                     LEFT JOIN $main_category_table t2 ON t1.code=t2.parent_id
288 288
                     LEFT JOIN $main_course_table t3 ON (t3.category_code = t1.code $platform_visible_courses)
289
-                    WHERE t1.parent_id ". (empty($category) ? "IS NULL" : "='$category'")."
289
+                    WHERE t1.parent_id ".(empty($category) ? "IS NULL" : "='$category'")."
290 290
                     GROUP BY t1.name,t1.code,t1.parent_id,t1.children_count 
291 291
                     ORDER BY t1.tree_pos, t1.name";
292 292
 
@@ -361,10 +361,10 @@  discard block
 block discarded – undo
361 361
         }
362 362
         $result .= $htmlTitre;
363 363
         if ($thereIsSubCat) {
364
-            $result .=  $htmlListCat;
364
+            $result .= $htmlListCat;
365 365
         }
366 366
         while ($categoryName = Database::fetch_array($resCats)) {
367
-            $result .= '<h3>' . $categoryName['name'] . "</h3>\n";
367
+            $result .= '<h3>'.$categoryName['name']."</h3>\n";
368 368
         }
369 369
         $numrows = Database::num_rows($sql_result_courses);
370 370
         $courses_list_string = '';
@@ -462,12 +462,12 @@  discard block
 block discarded – undo
462 462
         if ($courses_shown > 0) {
463 463
             // Only display the list of courses and categories if there was more than
464 464
                     // 0 courses visible to the world (we're in the anonymous list here).
465
-            $result .=  $courses_list_string;
465
+            $result .= $courses_list_string;
466 466
         }
467 467
         if ($category != '') {
468
-            $result .=  '<p><a href="'.api_get_self().'"> ' .
468
+            $result .= '<p><a href="'.api_get_self().'"> '.
469 469
                 Display :: return_icon('back.png', get_lang('BackToHomePage')).
470
-                get_lang('BackToHomePage') . '</a></p>';
470
+                get_lang('BackToHomePage').'</a></p>';
471 471
         }
472 472
         return $result;
473 473
     }
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
             if (!empty($title)) {
563 563
                 $html .= '<div class="panel-heading">'.$title.'</div>';
564 564
             }
565
-            $html.= '<div class="panel-body">'.$content.'</div>';
565
+            $html .= '<div class="panel-body">'.$content.'</div>';
566 566
             $html = Display::div($html, $params);
567 567
         }
568 568
 
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
             $usergroup_list = $usergroup->get_usergroup_by_user(api_get_user_id());
601 601
             $classes = '';
602 602
             if (!empty($usergroup_list)) {
603
-                foreach($usergroup_list as $group_id) {
603
+                foreach ($usergroup_list as $group_id) {
604 604
                     $data = $usergroup->get($group_id);
605 605
                     $data['name'] = Display::url($data['name'], api_get_path(WEB_CODE_PATH).'user/classes.php?id='.$data['id']);
606 606
                     $classes .= Display::tag('li', $data['name']);
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
             if (api_is_platform_admin()) {
610 610
                 $classes .= Display::tag(
611 611
                     'li',
612
-                    Display::url(get_lang('AddClasses') ,api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add')
612
+                    Display::url(get_lang('AddClasses'), api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add')
613 613
                 );
614 614
             }
615 615
             if (!empty($classes)) {
@@ -659,18 +659,18 @@  discard block
 block discarded – undo
659 659
                 $link = '?f=social';
660 660
             }
661 661
             $profile_content .= '<li class="inbox-message-social"><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php'.$link.'">'.
662
-                Display::return_icon('inbox.png',get_lang('Inbox'),null,ICON_SIZE_SMALL).get_lang('Inbox').$cant_msg.' </a></li>';
662
+                Display::return_icon('inbox.png', get_lang('Inbox'), null, ICON_SIZE_SMALL).get_lang('Inbox').$cant_msg.' </a></li>';
663 663
             $profile_content .= '<li class="new-message-social"><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php'.$link.'">'.
664
-                Display::return_icon('new-message.png',get_lang('Compose'),null,ICON_SIZE_SMALL).get_lang('Compose').' </a></li>';
664
+                Display::return_icon('new-message.png', get_lang('Compose'), null, ICON_SIZE_SMALL).get_lang('Compose').' </a></li>';
665 665
 
666 666
             if (api_get_setting('allow_social_tool') == 'true') {
667 667
                 $total_invitations = Display::badge($total_invitations);
668
-                $profile_content .= '<li class="invitations-social"><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php">'.Display::return_icon('invitations.png',get_lang('PendingInvitations'),null,ICON_SIZE_SMALL).get_lang('PendingInvitations').$total_invitations.'</a></li>';
668
+                $profile_content .= '<li class="invitations-social"><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php">'.Display::return_icon('invitations.png', get_lang('PendingInvitations'), null, ICON_SIZE_SMALL).get_lang('PendingInvitations').$total_invitations.'</a></li>';
669 669
             }
670 670
 
671 671
             if (isset($_configuration['allow_my_files_link_in_homepage']) && $_configuration['allow_my_files_link_in_homepage']) {
672 672
                 $myFiles = '<li class="myfiles-social"><a href="'.api_get_path(WEB_PATH).'main/social/myfiles.php">'.
673
-                    Display::return_icon('sn-files.png',get_lang('Files'),null,ICON_SIZE_SMALL).get_lang('MyFiles').'</a></li>';
673
+                    Display::return_icon('sn-files.png', get_lang('Files'), null, ICON_SIZE_SMALL).get_lang('MyFiles').'</a></li>';
674 674
 
675 675
                 if (api_get_setting('allow_my_files') === 'false') {
676 676
                     $myFiles = '';
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 
683 683
         $editProfileUrl = Display::getProfileEditionLink($user_id);
684 684
 
685
-        $profile_content .= '<li class="profile-social"><a href="' . $editProfileUrl . '">'.
685
+        $profile_content .= '<li class="profile-social"><a href="'.$editProfileUrl.'">'.
686 686
             Display::return_icon(
687 687
                 'edit-profile.png',
688 688
                 get_lang('EditProfile'),
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
 
933 933
                             $actions = null;
934 934
                             if (api_is_platform_admin()) {
935
-                                $actions = api_get_path(WEB_CODE_PATH) .'session/resume_session.php?id_session='.$session_id;
935
+                                $actions = api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$session_id;
936 936
                             }
937 937
 
938 938
                             $coachId = $session_box['id_coach'];
@@ -942,12 +942,12 @@  discard block
 block discarded – undo
942 942
                             $params['category_id'] = $session_box['category_id'];
943 943
                             $params['title'] = $session_box['title'];
944 944
                             $params['id_coach'] = $coachId;
945
-                            $params['coach_url'] = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=get_user_popup&user_id=' . $coachId;
945
+                            $params['coach_url'] = api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=get_user_popup&user_id='.$coachId;
946 946
                             $params['coach_name'] = !empty($session_box['coach']) ? $session_box['coach'] : null;
947 947
                             $params['coach_avatar'] = UserManager::getUserPicture($coachId, USER_IMAGE_SIZE_SMALL);
948 948
                             $params['date'] = $session_box['dates'];
949 949
                             $params['image'] = isset($imageField['value']) ? $imageField['value'] : null;
950
-                            $params['duration'] = isset($session_box['duration']) ? ' ' . $session_box['duration'] : null;
950
+                            $params['duration'] = isset($session_box['duration']) ? ' '.$session_box['duration'] : null;
951 951
                             $params['edit_actions'] = $actions;
952 952
                             $params['show_description'] = $session_box['show_description'];
953 953
                             $params['description'] = $session_box['description'];
@@ -1051,7 +1051,7 @@  discard block
 block discarded – undo
1051 1051
                                 $sessionParams[0]['date'] = $session_box['dates'];
1052 1052
                                 $sessionParams[0]['course_list_session_style'] = $coursesListSessionStyle;
1053 1053
                                 $sessionParams[0]['title'] = $session_box['title'];
1054
-                                $sessionParams[0]['subtitle'] = (!empty($session_box['coach']) ? $session_box['coach'] . ' | ': '') . $session_box['dates'];
1054
+                                $sessionParams[0]['subtitle'] = (!empty($session_box['coach']) ? $session_box['coach'].' | ' : '').$session_box['dates'];
1055 1055
                                 $sessionParams[0]['show_actions'] = api_is_platform_admin();
1056 1056
                                 $sessionParams[0]['courses'] = $html_courses_session;
1057 1057
                                 $sessionParams[0]['show_simple_session_info'] = false;
@@ -1102,13 +1102,13 @@  discard block
 block discarded – undo
1102 1102
                             if (
1103 1103
                                 !empty($session_category_start_date)
1104 1104
                             ) {
1105
-                                $categoryParams['subtitle'] = get_lang('From') . ' ' . $session_category_start_date;
1105
+                                $categoryParams['subtitle'] = get_lang('From').' '.$session_category_start_date;
1106 1106
                             }
1107 1107
 
1108 1108
                             if (
1109 1109
                                 !empty($session_category_end_date)
1110 1110
                             ) {
1111
-                                $categoryParams['subtitle'] = get_lang('Until') . ' ' . $session_category_end_date;
1111
+                                $categoryParams['subtitle'] = get_lang('Until').' '.$session_category_end_date;
1112 1112
                             }
1113 1113
                         }
1114 1114
 
@@ -1133,7 +1133,7 @@  discard block
 block discarded – undo
1133 1133
 
1134 1134
             $this->tpl->assign('all_courses', $allCoursesInSessions);
1135 1135
             $this->tpl->assign('session', $listSession);
1136
-            $this->tpl->assign('show_tutor', (api_get_setting('show_session_coach')==='true' ? true : false));
1136
+            $this->tpl->assign('show_tutor', (api_get_setting('show_session_coach') === 'true' ? true : false));
1137 1137
             $this->tpl->assign('gamification_mode', $gameModeIsActive);
1138 1138
 
1139 1139
             if (api_get_configuration_value('view_grid_courses')) {
@@ -1148,7 +1148,7 @@  discard block
 block discarded – undo
1148 1148
         }
1149 1149
 
1150 1150
         return [
1151
-            'html' => $specialCourseList . $sessions_with_category.$sessions_with_no_category.$listCourse,
1151
+            'html' => $specialCourseList.$sessions_with_category.$sessions_with_no_category.$listCourse,
1152 1152
             'session_count' => $sessionCount,
1153 1153
             'course_count' => $courseCount
1154 1154
         ];
@@ -1282,7 +1282,7 @@  discard block
 block discarded – undo
1282 1282
                         $htmlCategory .= '<div class="panel panel-default">';
1283 1283
                     }
1284 1284
                     $htmlCategory .= '<div class="panel-body">';
1285
-                    $coursesInfo =  $listCourse['course'];
1285
+                    $coursesInfo = $listCourse['course'];
1286 1286
 
1287 1287
                     $htmlCategory .= self::getHtmlForCourse(
1288 1288
                         $coursesInfo,
@@ -1299,7 +1299,7 @@  discard block
 block discarded – undo
1299 1299
                             $listCategorySession['catSessionName']
1300 1300
                         );
1301 1301
                         // list of session
1302
-                        $htmlSession = '';    // start
1302
+                        $htmlSession = ''; // start
1303 1303
                         foreach ($listCategorySession['sessionList'] as $k => $listSession) {
1304 1304
                             // add session
1305 1305
                             $htmlSession .= '<div class="session-view-row">';
@@ -1316,8 +1316,8 @@  discard block
 block discarded – undo
1316 1316
                         $htmlSessionCategory .= $htmlSession;
1317 1317
                     }
1318 1318
                     $htmlSessionCategory .= '</div>'; // end session cat block
1319
-                    $htmlCategory .=  $htmlSessionCategory .'</div></div>' ;
1320
-                    $htmlCategory .= '';   // end course block
1319
+                    $htmlCategory .= $htmlSessionCategory.'</div></div>';
1320
+                    $htmlCategory .= ''; // end course block
1321 1321
                 }
1322 1322
                 $userCategoryHtml .= $htmlCategory;
1323 1323
             }
@@ -1344,11 +1344,11 @@  discard block
 block discarded – undo
1344 1344
                 }
1345 1345
             }
1346 1346
             $htmlCategory .= '';
1347
-            $userCategoryHtml .= $htmlCategory;   // end user cat block
1347
+            $userCategoryHtml .= $htmlCategory; // end user cat block
1348 1348
             if ($userCategoryId != 0) {
1349 1349
                 $userCategoryHtml .= '</div>';
1350 1350
             }
1351
-            $html .= $userCategoryHtml;   //
1351
+            $html .= $userCategoryHtml; //
1352 1352
         }
1353 1353
         $html .= '</div>';
1354 1354
 
@@ -1489,11 +1489,11 @@  discard block
 block discarded – undo
1489 1489
         $html = '';
1490 1490
 
1491 1491
         if ($categorySessionId == 0) {
1492
-            $class1 = 'session-view-lvl-2';    // session
1493
-            $class2 = 'session-view-lvl-4';    // got to course in session link
1492
+            $class1 = 'session-view-lvl-2'; // session
1493
+            $class2 = 'session-view-lvl-4'; // got to course in session link
1494 1494
         } else {
1495
-            $class1 = 'session-view-lvl-3';    // session
1496
-            $class2 = 'session-view-lvl-5';    // got to course in session link
1495
+            $class1 = 'session-view-lvl-3'; // session
1496
+            $class2 = 'session-view-lvl-5'; // got to course in session link
1497 1497
         }
1498 1498
 
1499 1499
         $icon = Display::return_icon(
@@ -1521,7 +1521,7 @@  discard block
 block discarded – undo
1521 1521
         if ($listA['userCatTitle'] == $listB['userCatTitle']) {
1522 1522
             if ($listA['title'] == $listB['title']) {
1523 1523
                 return 0;
1524
-            } else if($listA['title'] > $listB['title']) {
1524
+            } else if ($listA['title'] > $listB['title']) {
1525 1525
                 return 1;
1526 1526
             } else {
1527 1527
                 return -1;
@@ -1542,7 +1542,7 @@  discard block
 block discarded – undo
1542 1542
     {
1543 1543
         if ($listA['title'] == $listB['title']) {
1544 1544
             return 0;
1545
-        } else if($listA['title'] > $listB['title']) {
1545
+        } else if ($listA['title'] > $listB['title']) {
1546 1546
             return 1;
1547 1547
         } else {
1548 1548
             return -1;
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Entity/Session.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
     }
397 397
 
398 398
     /**
399
-     * @param $courses
399
+     * @param ArrayCollection $courses
400 400
      */
401 401
     public function setCourses($courses)
402 402
     {
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
     }
876 876
 
877 877
     /**
878
-     * @return array
878
+     * @return string[]
879 879
      */
880 880
     public static function getStatusList()
881 881
     {
@@ -926,8 +926,8 @@  discard block
 block discarded – undo
926 926
     }
927 927
 
928 928
     /**
929
-     * @param $start
930
-     * @param $end
929
+     * @param \DateTime $start
930
+     * @param \DateTime $end
931 931
      * @return bool
932 932
      */
933 933
     private function compareDates($start, $end)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
             Criteria::expr()->eq('user', $user)
503 503
         );
504 504
 
505
-        if (!is_null($status))  {
505
+        if (!is_null($status)) {
506 506
             $criteria->andWhere(
507 507
                 Criteria::expr()->eq('status', $status)
508 508
             );
@@ -1051,7 +1051,7 @@  discard block
 block discarded – undo
1051 1051
     {
1052 1052
         // If the session is registered in the course session list.
1053 1053
         $exists = $this->getCourses()->exists(
1054
-            function ($key, $element) use ($course) {
1054
+            function($key, $element) use ($course) {
1055 1055
                 /** @var SessionRelCourse $element */
1056 1056
                 return $course->getId() == $element->getCourse()->getId();
1057 1057
             }
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Framework/PageController.php 1 patch
Doc Comments   +11 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,6 +109,8 @@  discard block
 block discarded – undo
109 109
      * @param string Longer content to show (usually a <ul> list)
110 110
      * @param string ID to be added to the HTML attributes for the block
111 111
      * @param array Array of attributes to add to the HTML block
112
+     * @param string $title
113
+     * @param string $id
112 114
      * @return string HTML <div> block
113 115
      * @todo use the menu builder
114 116
      */
@@ -647,6 +649,10 @@  discard block
 block discarded – undo
647 649
 
648 650
     }
649 651
 
652
+    /**
653
+     * @param string $filter
654
+     * @param integer $page
655
+     */
650 656
     function returnSpecialCourses($user_id, $filter, $page)
651 657
     {
652 658
         if (empty($user_id)) {
@@ -745,6 +751,10 @@  discard block
 block discarded – undo
745 751
         return $html;
746 752
     }
747 753
 
754
+    /**
755
+     * @param string $filter
756
+     * @param integer $page
757
+     */
748 758
     public function returnSessionsCategories($user_id, $filter, $page)
749 759
     {
750 760
         if (empty($user_id)) {
@@ -1177,7 +1187,7 @@  discard block
 block discarded – undo
1177 1187
      * Shows a welcome message when the user doesn't have any content in
1178 1188
      * the course list
1179 1189
      * @param object A Template object used to declare variables usable in the given template
1180
-     * @return void
1190
+     * @return false|null
1181 1191
      */
1182 1192
     public function return_welcome_to_course_block($tpl)
1183 1193
     {
Please login to merge, or discard this patch.
main/work/work.lib.php 1 patch
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -36,27 +36,27 @@  discard block
 block discarded – undo
36 36
 
37 37
     if (!empty($id)) {
38 38
         $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&gradebook='.$gradebook.'&id='.$my_back_id.'">'.
39
-            Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).'</a>';
39
+            Display::return_icon('back.png', get_lang('BackToWorksList'), '', ICON_SIZE_MEDIUM).'</a>';
40 40
     }
41 41
 
42 42
     if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath') {
43 43
         // Create dir
44 44
         if (empty($id)) {
45 45
             $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=create_dir&gradebook='.$gradebook.'">';
46
-            $display_output .= Display::return_icon('new_work.png', get_lang('CreateAssignment'),'',ICON_SIZE_MEDIUM).'</a>';
46
+            $display_output .= Display::return_icon('new_work.png', get_lang('CreateAssignment'), '', ICON_SIZE_MEDIUM).'</a>';
47 47
         }
48 48
         if (empty($id)) {
49 49
             // Options
50 50
             $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=settings&gradebook='.$gradebook.'">';
51
-            $display_output .= Display::return_icon('settings.png', get_lang('EditToolOptions'),'',ICON_SIZE_MEDIUM).'</a>';
51
+            $display_output .= Display::return_icon('settings.png', get_lang('EditToolOptions'), '', ICON_SIZE_MEDIUM).'</a>';
52 52
         }
53
-        $display_output .= '<a id="open-view-list" href="#">' . Display::return_icon('listwork.png', get_lang('ViewStudents'),'',ICON_SIZE_MEDIUM) . '</a>';
53
+        $display_output .= '<a id="open-view-list" href="#">'.Display::return_icon('listwork.png', get_lang('ViewStudents'), '', ICON_SIZE_MEDIUM).'</a>';
54 54
 
55 55
     }
56 56
 
57 57
     if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath' && api_is_allowed_to_session_edit(false, true)) {
58 58
         // Delete all files
59
-        if (api_get_setting('permanently_remove_deleted_files') == 'true'){
59
+        if (api_get_setting('permanently_remove_deleted_files') == 'true') {
60 60
             $message = get_lang('ConfirmYourChoiceDeleteAllfiles');
61 61
         } else {
62 62
             $message = get_lang('ConfirmYourChoice');
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
  */
114 114
 function two_digits($number)
115 115
 {
116
-    $number = (int)$number;
116
+    $number = (int) $number;
117 117
     return ($number < 10) ? '0'.$number : $number;
118 118
 }
119 119
 
@@ -511,10 +511,10 @@  discard block
 block discarded – undo
511 511
 
512 512
     $columnModel = array(
513 513
         array('name'=>'type', 'index'=>'type', 'width'=>'30', 'align'=>'center', 'sortable' => 'false'),
514
-        array('name'=>'title', 'index'=>'title', 'width'=>'250',   'align'=>'left'),
515
-        array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'80',  'align'=>'center', 'sortable'=>'false'),
516
-        array('name'=>'feedback', 'index'=>'feedback', 'width'=>'80',  'align'=>'center', 'sortable'=>'false'),
517
-        array('name'=>'last_upload', 'index'=>'feedback', 'width'=>'125',  'align'=>'center', 'sortable'=>'false')
514
+        array('name'=>'title', 'index'=>'title', 'width'=>'250', 'align'=>'left'),
515
+        array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'80', 'align'=>'center', 'sortable'=>'false'),
516
+        array('name'=>'feedback', 'index'=>'feedback', 'width'=>'80', 'align'=>'center', 'sortable'=>'false'),
517
+        array('name'=>'last_upload', 'index'=>'feedback', 'width'=>'125', 'align'=>'center', 'sortable'=>'false')
518 518
     );
519 519
 
520 520
     if ($courseInfo['show_score'] == 0) {
@@ -551,10 +551,10 @@  discard block
 block discarded – undo
551 551
 {
552 552
     $columnModel = array(
553 553
         array('name'=>'type', 'index'=>'type', 'width'=>'35', 'align'=>'center', 'sortable' => 'false'),
554
-        array('name'=>'title', 'index'=>'title',  'width'=>'300',   'align'=>'left', 'wrap_cell' => "true"),
555
-        array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'125',  'align'=>'center'),
556
-        array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'125',  'align'=>'center'),
557
-        array('name'=>'amount', 'index'=>'amount', 'width'=>'110',  'align'=>'center', 'sortable' => 'false'),
554
+        array('name'=>'title', 'index'=>'title', 'width'=>'300', 'align'=>'left', 'wrap_cell' => "true"),
555
+        array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'125', 'align'=>'center'),
556
+        array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'125', 'align'=>'center'),
557
+        array('name'=>'amount', 'index'=>'amount', 'width'=>'110', 'align'=>'center', 'sortable' => 'false'),
558 558
         array('name'=>'actions', 'index'=>'actions', 'width'=>'110', 'align'=>'left', 'sortable'=>'false')
559 559
     );
560 560
 
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
         return false;
756 756
     }
757 757
 
758
-    $base_work_dir = api_get_path(SYS_COURSE_PATH) .$_course['path'].'/work';
758
+    $base_work_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].'/work';
759 759
     $work_data_url = $base_work_dir.$work_data['url'];
760 760
     $check = Security::check_abs_path($work_data_url.'/', $base_work_dir.'/');
761 761
 
@@ -839,7 +839,7 @@  discard block
 block discarded – undo
839 839
 function get_work_path($id)
840 840
 {
841 841
     $table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
842
-    $course_id  = api_get_course_int_id();
842
+    $course_id = api_get_course_int_id();
843 843
     $sql = 'SELECT url FROM '.$table.'
844 844
             WHERE c_id = '.$course_id.' AND id='.intval($id);
845 845
     $res = Database::query($sql);
@@ -962,9 +962,9 @@  discard block
 block discarded – undo
962 962
     if ($handle = @opendir($directory)) {
963 963
         while (false !== ($file = readdir($handle))) {
964 964
             if ($file != '.' && $file != '..') {
965
-                if (is_dir($directory. '/' . $file)) {
966
-                    $array_items = array_merge($array_items, directory_to_array($directory. '/' . $file));
967
-                    $file = $directory . '/' . $file;
965
+                if (is_dir($directory.'/'.$file)) {
966
+                    $array_items = array_merge($array_items, directory_to_array($directory.'/'.$file));
967
+                    $file = $directory.'/'.$file;
968 968
                     $array_items[] = preg_replace("/\/\//si", '/', $file);
969 969
                 }
970 970
             }
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
             if (is_dir($path_dir.'/'.$entry)) {
1042 1042
                 $count_dir++;
1043 1043
                 if ($recurse) {
1044
-                    $count += count_dir($path_dir . '/' . $entry, $recurse);
1044
+                    $count += count_dir($path_dir.'/'.$entry, $recurse);
1045 1045
                 }
1046 1046
             } else {
1047 1047
                 $count++;
@@ -1319,11 +1319,11 @@  discard block
 block discarded – undo
1319 1319
         $courseInfo
1320 1320
     );
1321 1321
 
1322
-    if (!in_array($direction, array('asc','desc'))) {
1322
+    if (!in_array($direction, array('asc', 'desc'))) {
1323 1323
         $direction = 'desc';
1324 1324
     }
1325 1325
     if (!empty($where_condition)) {
1326
-        $where_condition = ' AND ' . $where_condition;
1326
+        $where_condition = ' AND '.$where_condition;
1327 1327
     }
1328 1328
 
1329 1329
     $column = !empty($column) ? Database::escape_string($column) : 'sent_date';
@@ -1476,7 +1476,7 @@  discard block
 block discarded – undo
1476 1476
         $direction = 'desc';
1477 1477
     }
1478 1478
     if (!empty($where_condition)) {
1479
-        $where_condition = ' AND ' . $where_condition;
1479
+        $where_condition = ' AND '.$where_condition;
1480 1480
     }
1481 1481
 
1482 1482
     $column = !empty($column) ? Database::escape_string($column) : 'sent_date';
@@ -1535,7 +1535,7 @@  discard block
 block discarded – undo
1535 1535
             );
1536 1536
 
1537 1537
             $work['amount'] = Display::label(
1538
-                $countUniqueAttempts . '/' .
1538
+                $countUniqueAttempts.'/'.
1539 1539
                 $totalUsers,
1540 1540
                 'success'
1541 1541
             );
@@ -1584,7 +1584,7 @@  discard block
 block discarded – undo
1584 1584
                         array(),
1585 1585
                         ICON_SIZE_SMALL
1586 1586
                     ),
1587
-                    api_get_path(WEB_CODE_PATH) . 'work/downloadfolder.inc.php?id=' . $workId . '&' . api_get_cidreq()
1587
+                    api_get_path(WEB_CODE_PATH).'work/downloadfolder.inc.php?id='.$workId.'&'.api_get_cidreq()
1588 1588
                 );
1589 1589
             } else {
1590 1590
                 $downloadLink = Display::url(
@@ -1668,7 +1668,7 @@  discard block
 block discarded – undo
1668 1668
     $userCondition = " AND u.user_id = $studentId ";
1669 1669
     $sessionCondition = api_get_session_condition($sessionId, true, false, 'w.session_id');
1670 1670
     $workCondition = " AND w_rel.work_id = $workId";
1671
-    $workParentCondition  = " AND w.parent_id = $workId";
1671
+    $workParentCondition = " AND w.parent_id = $workId";
1672 1672
 
1673 1673
     $sql = "(
1674 1674
                 $select1 FROM $userTable u
@@ -1775,7 +1775,7 @@  discard block
 block discarded – undo
1775 1775
         }
1776 1776
 
1777 1777
         if ($allowEdition && !empty($itemId)) {
1778
-            $deleteLink  = Display::url($deleteIcon, $urlDelete.'&item_id='.$itemId.'&id='.$workId);
1778
+            $deleteLink = Display::url($deleteIcon, $urlDelete.'&item_id='.$itemId.'&id='.$workId);
1779 1779
         } else {
1780 1780
             $deleteLink = null;
1781 1781
         }
@@ -1853,7 +1853,7 @@  discard block
 block discarded – undo
1853 1853
     $start = intval($start);
1854 1854
     $limit = intval($limit);
1855 1855
 
1856
-    if (!in_array($direction, array('asc','desc'))) {
1856
+    if (!in_array($direction, array('asc', 'desc'))) {
1857 1857
         $direction = 'desc';
1858 1858
     }
1859 1859
 
@@ -1923,7 +1923,7 @@  discard block
 block discarded – undo
1923 1923
         $work_assignment = get_work_assignment_by_id($work_id);
1924 1924
 
1925 1925
         if (!empty($studentId)) {
1926
-            $where_condition.= " AND u.user_id = ".intval($studentId);
1926
+            $where_condition .= " AND u.user_id = ".intval($studentId);
1927 1927
         }
1928 1928
 
1929 1929
         $sql = " $select
@@ -1933,7 +1933,7 @@  discard block
 block discarded – undo
1933 1933
                     $extra_conditions 
1934 1934
                     $where_condition 
1935 1935
                     $condition_session
1936
-                    AND u.status != " . INVITEE . "
1936
+                    AND u.status != ".INVITEE."
1937 1937
                 ORDER BY $column $direction";
1938 1938
 
1939 1939
         if (!empty($start) && !empty($limit)) {
@@ -1988,7 +1988,7 @@  discard block
 block discarded – undo
1988 1988
                     $qualification_string = Display::label('-');
1989 1989
                 } else {
1990 1990
                     $label = 'info';
1991
-                    $relativeScore = $work['qualification']/$work_data['qualification'];
1991
+                    $relativeScore = $work['qualification'] / $work_data['qualification'];
1992 1992
                     if ($relativeScore < 0.5) {
1993 1993
                         $label = 'important';
1994 1994
                     } elseif ($relativeScore < 0.75) {
@@ -2041,7 +2041,7 @@  discard block
 block discarded – undo
2041 2041
                 // If URL is present then there's a file to download keep BC.
2042 2042
                 if ($work['contains_file'] || !empty($work['url'])) {
2043 2043
                     $link_to_download = '<a href="'.$url.'download.php?id='.$item_id.'&'.api_get_cidreq().'">'.
2044
-                        Display::return_icon('save.png', get_lang('Save'),array(), ICON_SIZE_SMALL).'</a> ';
2044
+                        Display::return_icon('save.png', get_lang('Save'), array(), ICON_SIZE_SMALL).'</a> ';
2045 2045
                 }
2046 2046
 
2047 2047
                 $feedback = null;
@@ -2051,7 +2051,7 @@  discard block
 block discarded – undo
2051 2051
                         $feedback .= ' ';
2052 2052
                     }
2053 2053
                     $feedback .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'.
2054
-                    $count . ' ' . Display::returnFontAwesomeIcon('comments-o') . '</a> ';
2054
+                    $count.' '.Display::returnFontAwesomeIcon('comments-o').'</a> ';
2055 2055
                 }
2056 2056
 
2057 2057
                 $work['qualification'] = $qualification_string.$feedback;
@@ -2059,10 +2059,10 @@  discard block
 block discarded – undo
2059 2059
 
2060 2060
                 // Date.
2061 2061
                 $work_date = api_convert_and_format_date($work['sent_date']);
2062
-                $date = date_to_str_ago($work['sent_date']). ' ' . $add_string . ' ' . $work_date;
2062
+                $date = date_to_str_ago($work['sent_date']).' '.$add_string.' '.$work_date;
2063 2063
 
2064 2064
                 $work['sent_date_from_db'] = $work['sent_date'];
2065
-                $work['sent_date'] = '<div class="work-date" title="'.$date.'">' . $work['sent_date'] . '</div>';
2065
+                $work['sent_date'] = '<div class="work-date" title="'.$date.'">'.$work['sent_date'].'</div>';
2066 2066
 
2067 2067
                 // Actions.
2068 2068
                 $correction = '';
@@ -2080,8 +2080,8 @@  discard block
 block discarded – undo
2080 2080
                         Display::return_icon('default.png', get_lang('View'), array(), ICON_SIZE_SMALL).'</a> ';
2081 2081
 
2082 2082
                     if ($unoconv && empty($work['contains_file'])) {
2083
-                        $action .=  '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=export_to_doc&item_id='.$item_id.'" title="'.get_lang('ExportToDoc').'" >'.
2084
-                            Display::return_icon('export_doc.png', get_lang('ExportToDoc'),array(), ICON_SIZE_SMALL).'</a> ';
2083
+                        $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=export_to_doc&item_id='.$item_id.'" title="'.get_lang('ExportToDoc').'" >'.
2084
+                            Display::return_icon('export_doc.png', get_lang('ExportToDoc'), array(), ICON_SIZE_SMALL).'</a> ';
2085 2085
                     }
2086 2086
                     $loadingText = addslashes(get_lang('Loading'));
2087 2087
                     $uploadedText = addslashes(get_lang('Uploaded'));
@@ -2128,7 +2128,7 @@  discard block
 block discarded – undo
2128 2128
 
2129 2129
                     if ($locked) {
2130 2130
                         if ($qualification_exists) {
2131
-                            $action .= Display::return_icon('rate_work_na.png', get_lang('CorrectAndRate'),array(), ICON_SIZE_SMALL);
2131
+                            $action .= Display::return_icon('rate_work_na.png', get_lang('CorrectAndRate'), array(), ICON_SIZE_SMALL);
2132 2132
                         } else {
2133 2133
                             $action .= Display::return_icon('edit_na.png', get_lang('Comment'), array(), ICON_SIZE_SMALL);
2134 2134
                         }
@@ -2144,26 +2144,26 @@  discard block
 block discarded – undo
2144 2144
 
2145 2145
                     if ($work['contains_file']) {
2146 2146
                         if ($locked) {
2147
-                            $action .= Display::return_icon('move_na.png', get_lang('Move'),array(), ICON_SIZE_SMALL);
2147
+                            $action .= Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
2148 2148
                         } else {
2149 2149
                             $action .= '<a href="'.$url.'work.php?'.api_get_cidreq().'&action=move&item_id='.$item_id.'&id='.$work['parent_id'].'" title="'.get_lang('Move').'">'.
2150
-                                Display::return_icon('move.png', get_lang('Move'),array(), ICON_SIZE_SMALL).'</a>';
2150
+                                Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
2151 2151
                         }
2152 2152
                     }
2153 2153
 
2154 2154
                     if ($work['accepted'] == '1') {
2155 2155
                         $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=make_invisible&item_id='.$item_id.'" title="'.get_lang('Invisible').'" >'.
2156
-                            Display::return_icon('visible.png', get_lang('Invisible'),array(), ICON_SIZE_SMALL).'</a>';
2156
+                            Display::return_icon('visible.png', get_lang('Invisible'), array(), ICON_SIZE_SMALL).'</a>';
2157 2157
                     } else {
2158 2158
                         $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=make_visible&item_id='.$item_id.'" title="'.get_lang('Visible').'" >'.
2159
-                            Display::return_icon('invisible.png', get_lang('Visible'),array(), ICON_SIZE_SMALL).'</a> ';
2159
+                            Display::return_icon('invisible.png', get_lang('Visible'), array(), ICON_SIZE_SMALL).'</a> ';
2160 2160
                     }
2161 2161
 
2162 2162
                     if ($locked) {
2163 2163
                         $action .= Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL);
2164 2164
                     } else {
2165
-                        $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=delete&item_id='.$item_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'" >'.
2166
-                            Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
2165
+                        $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=delete&item_id='.$item_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'" >'.
2166
+                            Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
2167 2167
                     }
2168 2168
                 } elseif ($is_author && (empty($work['qualificator_id']) || $work['qualificator_id'] == 0)) {
2169 2169
                     $action .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'.
@@ -2174,8 +2174,8 @@  discard block
 block discarded – undo
2174 2174
                             $action .= '<a href="'.$url.'edit.php?'.api_get_cidreq().'&item_id='.$item_id.'&id='.$work['parent_id'].'" title="'.get_lang('Modify').'">'.
2175 2175
                                 Display::return_icon('edit.png', get_lang('Comment'), array(), ICON_SIZE_SMALL).'</a>';
2176 2176
                         }
2177
-                        $action .= ' <a href="'.$url.'work_list.php?'.api_get_cidreq().'&action=delete&item_id='.$item_id.'&id='.$work['parent_id'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'"  >'.
2178
-                            Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
2177
+                        $action .= ' <a href="'.$url.'work_list.php?'.api_get_cidreq().'&action=delete&item_id='.$item_id.'&id='.$work['parent_id'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'"  >'.
2178
+                            Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
2179 2179
                     } else {
2180 2180
                         $action .= Display::return_icon('edit_na.png', get_lang('Modify'), array(), ICON_SIZE_SMALL);
2181 2181
                     }
@@ -2215,7 +2215,7 @@  discard block
 block discarded – undo
2215 2215
     $_course = api_get_course_info();
2216 2216
     $task_id = $task_data['id'];
2217 2217
     $task_title = !empty($task_data['title']) ? $task_data['title'] : basename($task_data['url']);
2218
-    $subject = '[' . api_get_setting('siteName') . '] ';
2218
+    $subject = '['.api_get_setting('siteName').'] ';
2219 2219
 
2220 2220
     // The body can be as long as you wish, and any combination of text and variables
2221 2221
     $content = get_lang('ReminderToSubmitPendingTask')."\n".get_lang('CourseName').' : '.$_course['name']."\n";
@@ -2224,7 +2224,7 @@  discard block
 block discarded – undo
2224 2224
     $mails_sent_to = array();
2225 2225
     foreach ($list_users as $user) {
2226 2226
         $name_user = api_get_person_name($user[1], $user[0], null, PERSON_NAME_EMAIL_ADDRESS);
2227
-        $dear_line = get_lang('Dear')." ".api_get_person_name($user[1], $user[0]) .", \n\n";
2227
+        $dear_line = get_lang('Dear')." ".api_get_person_name($user[1], $user[0]).", \n\n";
2228 2228
         $body      = $dear_line.$content;
2229 2229
         MessageManager::send_message($user[3], $subject, $body);
2230 2230
         $mails_sent_to[] = $name_user;
@@ -2253,22 +2253,22 @@  discard block
 block discarded – undo
2253 2253
     } else {
2254 2254
         $students = CourseManager::get_student_list_from_course_code($courseCode, true, $sessionId);
2255 2255
     }
2256
-    $emailsubject = '[' . api_get_setting('siteName') . '] '.get_lang('HomeworkCreated');
2256
+    $emailsubject = '['.api_get_setting('siteName').'] '.get_lang('HomeworkCreated');
2257 2257
     $currentUser = api_get_user_info(api_get_user_id());
2258 2258
     if (!empty($students)) {
2259
-        foreach($students as $student) {
2259
+        foreach ($students as $student) {
2260 2260
             $user_info = api_get_user_info($student["user_id"]);
2261
-            if(!empty($user_info["mail"])) {
2261
+            if (!empty($user_info["mail"])) {
2262 2262
                 $name_user = api_get_person_name(
2263 2263
                     $user_info["firstname"],
2264 2264
                     $user_info["lastname"],
2265 2265
                     null,
2266 2266
                     PERSON_NAME_EMAIL_ADDRESS
2267 2267
                 );
2268
-                $link = api_get_path(WEB_CODE_PATH) . 'work/work_list_all.php?' . api_get_cidreq() . '&id=' . $workId;
2268
+                $link = api_get_path(WEB_CODE_PATH).'work/work_list_all.php?'.api_get_cidreq().'&id='.$workId;
2269 2269
                 $emailbody = get_lang('Dear')." ".$name_user.",\n\n";
2270 2270
                 $emailbody .= get_lang('HomeworkHasBeenCreatedForTheCourse')." ".$courseCode.". "."\n\n".
2271
-                    '<a href="'. $link . '">' . get_lang('PleaseCheckHomeworkPage') . '</a>';
2271
+                    '<a href="'.$link.'">'.get_lang('PleaseCheckHomeworkPage').'</a>';
2272 2272
                 $emailbody .= "\n\n".api_get_person_name($currentUser["firstname"], $currentUser["lastname"]);
2273 2273
 
2274 2274
                 $additionalParameters = array(
@@ -2310,7 +2310,7 @@  discard block
 block discarded – undo
2310 2310
     $url = Database::escape_string($url);
2311 2311
     $sql = "SELECT id FROM $work_table WHERE url='$url'";
2312 2312
     $result = Database::query($sql);
2313
-    if (Database::num_rows($result)> 0) {
2313
+    if (Database::num_rows($result) > 0) {
2314 2314
         $row = Database::fetch_row($result);
2315 2315
         if (empty($row)) {
2316 2316
             return false;
@@ -2431,7 +2431,7 @@  discard block
 block discarded – undo
2431 2431
     }
2432 2432
 
2433 2433
     if (!empty($studentId)) {
2434
-        $sql_users.= " AND u.user_id = ".intval($studentId);
2434
+        $sql_users .= " AND u.user_id = ".intval($studentId);
2435 2435
     }
2436 2436
 
2437 2437
     $group_id = api_get_group_id();
@@ -2441,7 +2441,7 @@  discard block
 block discarded – undo
2441 2441
         $groupInfo = GroupManager::get_group_properties($group_id);
2442 2442
         $group_user_list = GroupManager::get_subscribed_users($groupInfo['iid']);
2443 2443
         if (!empty($group_user_list)) {
2444
-            foreach($group_user_list as $group_user) {
2444
+            foreach ($group_user_list as $group_user) {
2445 2445
                 $new_group_user_list[] = $group_user['user_id'];
2446 2446
             }
2447 2447
         }
@@ -2863,7 +2863,7 @@  discard block
 block discarded – undo
2863 2863
 function getWorkComments($work)
2864 2864
 {
2865 2865
     $commentTable = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT_COMMENT);
2866
-    $userTable= Database::get_main_table(TABLE_MAIN_USER);
2866
+    $userTable = Database::get_main_table(TABLE_MAIN_USER);
2867 2867
 
2868 2868
     $courseId = intval($work['c_id']);
2869 2869
     $workId = intval($work['id']);
@@ -3545,7 +3545,7 @@  discard block
 block discarded – undo
3545 3545
             null,
3546 3546
             PERSON_NAME_EMAIL_ADDRESS
3547 3547
         );
3548
-        $subject = "[" . api_get_setting('siteName') . "] ".get_lang('SendMailBody')."\n ".get_lang('CourseName').": ".$courseInfo['name']."  ";
3548
+        $subject = "[".api_get_setting('siteName')."] ".get_lang('SendMailBody')."\n ".get_lang('CourseName').": ".$courseInfo['name']."  ";
3549 3549
         foreach ($user_list as $user_data) {
3550 3550
             $to_user_id = $user_data['user_id'];
3551 3551
             $user_info = api_get_user_info($to_user_id);
@@ -3622,7 +3622,7 @@  discard block
 block discarded – undo
3622 3622
 
3623 3623
     $title = $values['title'];
3624 3624
     $description = $values['description'];
3625
-    $contains_file = isset($values['contains_file']) && !empty($values['contains_file']) ? intval($values['contains_file']): 0;
3625
+    $contains_file = isset($values['contains_file']) && !empty($values['contains_file']) ? intval($values['contains_file']) : 0;
3626 3626
 
3627 3627
     $saveWork = true;
3628 3628
     $filename = null;
@@ -4042,8 +4042,8 @@  discard block
 block discarded – undo
4042 4042
                     LINK_STUDENTPUBLICATION,
4043 4043
                     $workId,
4044 4044
                     $params['new_dir'],
4045
-                    (float)$params['weight'],
4046
-                    (float)$params['qualification'],
4045
+                    (float) $params['weight'],
4046
+                    (float) $params['qualification'],
4047 4047
                     $params['description'],
4048 4048
                     1,
4049 4049
                     api_get_session_id()
@@ -4330,8 +4330,8 @@  discard block
 block discarded – undo
4330 4330
     $number_of_setting = Database::num_rows($result);
4331 4331
 
4332 4332
     if ($number_of_setting == 1) {
4333
-        $query = "UPDATE " . $table_course_setting . " SET
4334
-                  value='" . Database::escape_string($studentDeleteOwnPublication) . "'
4333
+        $query = "UPDATE ".$table_course_setting." SET
4334
+                  value='" . Database::escape_string($studentDeleteOwnPublication)."'
4335 4335
                   WHERE variable = 'student_delete_own_publication' AND c_id = $courseId";
4336 4336
         Database::query($query);
4337 4337
     } else {
@@ -4370,9 +4370,9 @@  discard block
 block discarded – undo
4370 4370
     $work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
4371 4371
     $item_id = intval($item_id);
4372 4372
     $course_id = $course_info['real_id'];
4373
-    $sql = "UPDATE  " . $work_table . "
4373
+    $sql = "UPDATE  ".$work_table."
4374 4374
             SET accepted = 0
4375
-            WHERE c_id = $course_id AND id = '" . $item_id . "'";
4375
+            WHERE c_id = $course_id AND id = '".$item_id."'";
4376 4376
     Database::query($sql);
4377 4377
     api_item_property_update(
4378 4378
         $course_info,
@@ -4524,7 +4524,7 @@  discard block
 block discarded – undo
4524 4524
                 $courseCode,
4525 4525
                 $sessionId,
4526 4526
                 $limitString,
4527
-                $orderBy ,
4527
+                $orderBy,
4528 4528
                 STUDENT,
4529 4529
                 $getCount
4530 4530
             );
@@ -4860,8 +4860,8 @@  discard block
 block discarded – undo
4860 4860
     if (!empty($sessionId)) {
4861 4861
         $sessionInfo = api_get_session_info($sessionId);
4862 4862
         if (!empty($sessionInfo)) {
4863
-            $header .= ' - ' . $sessionInfo['name'];
4864
-            $header .= '<br />' . $sessionInfo['description'];
4863
+            $header .= ' - '.$sessionInfo['name'];
4864
+            $header .= '<br />'.$sessionInfo['description'];
4865 4865
             $teachers = SessionManager::getCoachesByCourseSessionToString(
4866 4866
                 $sessionId,
4867 4867
                 $courseInfo['real_id']
@@ -4877,12 +4877,12 @@  discard block
 block discarded – undo
4877 4877
     $expiresOn = null;
4878 4878
 
4879 4879
     if (!empty($assignment) && isset($assignment['expires_on'])) {
4880
-        $content .= '<br /><strong>' . get_lang('ExpirationDate') . '</strong>: ' . api_get_local_time($assignment['expires_on']);
4880
+        $content .= '<br /><strong>'.get_lang('ExpirationDate').'</strong>: '.api_get_local_time($assignment['expires_on']);
4881 4881
         $expiresOn = api_get_local_time($assignment['expires_on']);
4882 4882
     }
4883 4883
 
4884 4884
     if (!empty($workData['description'])) {
4885
-        $content .= '<br /><strong>' . get_lang('Description') . '</strong>: ' . $workData['description'];
4885
+        $content .= '<br /><strong>'.get_lang('Description').'</strong>: '.$workData['description'];
4886 4886
     }
4887 4887
 
4888 4888
     $workList = get_work_user_list(null, null, null, null, $workId);
@@ -4903,7 +4903,7 @@  discard block
 block discarded – undo
4903 4903
                 );
4904 4904
 
4905 4905
                 $column = 0;
4906
-                foreach($headers as $header) {
4906
+                foreach ($headers as $header) {
4907 4907
                     $table->setHeaderContents(0, $column, $header);
4908 4908
                     $column++;
4909 4909
                 }
@@ -4951,7 +4951,7 @@  discard block
 block discarded – undo
4951 4951
 
4952 4952
                 if (!empty($content)) {
4953 4953
                     $params = array(
4954
-                        'filename' => $workData['title'] . '_' . api_get_local_time(),
4954
+                        'filename' => $workData['title'].'_'.api_get_local_time(),
4955 4955
                         'pdf_title' => api_replace_dangerous_char($workData['title']),
4956 4956
                         'course_code' => $courseInfo['code'],
4957 4957
                         'add_signatures' => false
@@ -4982,7 +4982,7 @@  discard block
 block discarded – undo
4982 4982
     $tempZipFile = api_get_path(SYS_ARCHIVE_PATH).api_get_unique_id().".zip";
4983 4983
     $coursePath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/work/';
4984 4984
 
4985
-    $zip  = new PclZip($tempZipFile);
4985
+    $zip = new PclZip($tempZipFile);
4986 4986
 
4987 4987
     $workPerUser = getWorkPerUser($userId);
4988 4988
 
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Security/Authorization/Voter/SessionVoter.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
132 132
                 if ($session->hasUserInCourse($user, $course)) {
133 133
                     $user->addRole('ROLE_CURRENT_SESSION_COURSE_STUDENT');
134 134
 
135
-                     // Session duration per student.
135
+                        // Session duration per student.
136 136
                     if (!empty($session->getDuration())) {
137 137
                         $duration = $session->getDuration() * 24 * 60 * 60;
138 138
 
Please login to merge, or discard this patch.