Completed
Push — 1.11.x ( 69878b...1da93a )
by José
64:32 queued 39:16
created
main/inc/lib/thematic.lib.php 2 patches
Doc Comments   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -242,6 +242,9 @@  discard block
 block discarded – undo
242 242
     /**
243 243
      * get thematic list
244 244
      * @param	int		Thematic id (optional), get list by id
245
+     * @param integer $thematic_id
246
+     * @param string $course_code
247
+     * @param integer $session_id
245 248
      * @return	array	Thematic data
246 249
      */
247 250
     public static function get_thematic_list(
@@ -799,6 +802,7 @@  discard block
 block discarded – undo
799 802
     /**
800 803
      * delete  thematic advance
801 804
      * @param	int		Thematic advance id
805
+     * @param integer $thematic_advance_id
802 806
      * @return	int		Affected rows
803 807
      */
804 808
     public function thematic_advance_destroy($thematic_advance_id)
@@ -1116,6 +1120,7 @@  discard block
 block discarded – undo
1116 1120
     /**
1117 1121
      * update done thematic advances from thematic details interface
1118 1122
      * @param 	int		Thematic id
1123
+     * @param integer $thematic_advance_id
1119 1124
      * @return	int		Affected rows
1120 1125
      */
1121 1126
     public function update_done_thematic_advances($thematic_advance_id)
@@ -1343,6 +1348,7 @@  discard block
 block discarded – undo
1343 1348
      * Get average of advances by thematic
1344 1349
      * @param	int		Thematic id
1345 1350
      * @param	string	Course code (optional)
1351
+     * @param string $course_code
1346 1352
      * @return 	float	Average of thematic advances
1347 1353
      */
1348 1354
     public function get_average_of_advances_by_thematic($thematic_id, $course_code = null)
@@ -1407,6 +1413,7 @@  discard block
 block discarded – undo
1407 1413
      * @param	string	Content
1408 1414
      * @param	string	Date and time
1409 1415
      * @param	int		Duration in hours
1416
+     * @param integer $id
1410 1417
      * @return void
1411 1418
      */
1412 1419
     public function set_thematic_advance_attributes(
@@ -1437,7 +1444,7 @@  discard block
 block discarded – undo
1437 1444
 
1438 1445
     /**
1439 1446
      * get thematic id
1440
-     * @return void
1447
+     * @return integer
1441 1448
      */
1442 1449
     public function get_thematic_id()
1443 1450
     {
@@ -1446,7 +1453,7 @@  discard block
 block discarded – undo
1446 1453
 
1447 1454
     /**
1448 1455
      * Get thematic plan titles by default
1449
-     * @return array
1456
+     * @return string[]
1450 1457
      */
1451 1458
     public function get_default_thematic_plan_title()
1452 1459
     {
@@ -1463,7 +1470,7 @@  discard block
 block discarded – undo
1463 1470
 
1464 1471
     /**
1465 1472
      * Get thematic plan icons by default
1466
-     * @return array
1473
+     * @return string[]
1467 1474
      */
1468 1475
     public function get_default_thematic_plan_icon()
1469 1476
     {
@@ -1480,7 +1487,7 @@  discard block
 block discarded – undo
1480 1487
 
1481 1488
     /**
1482 1489
      * Get questions by default for help
1483
-     * @return array
1490
+     * @return string[]
1484 1491
      */
1485 1492
     public function get_default_question()
1486 1493
     {
Please login to merge, or discard this patch.
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $from = intval($from);
75 75
         $number_of_items = intval($number_of_items);
76 76
 
77
-        if (!in_array($direction, array('ASC','DESC'))) {
77
+        if (!in_array($direction, array('ASC', 'DESC'))) {
78 78
             $direction = 'ASC';
79 79
         }
80 80
 
@@ -97,24 +97,24 @@  discard block
 block discarded – undo
97 97
             $thematic[1] = '<a href="index.php?'.api_get_cidreq().'&action=thematic_details&thematic_id='.$thematic[0].'">'.
98 98
                 Security::remove_XSS($thematic[1], STUDENT).$session_star.'</a>';
99 99
             if (api_is_allowed_to_edit(null, true)) {
100
-                $actions  = '';
100
+                $actions = '';
101 101
 
102 102
                 if (api_get_session_id()) {
103 103
                     if (api_get_session_id() == $thematic[3]) {
104 104
                         $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic[0].'">'.
105
-                            Display::return_icon('lesson_plan.png',get_lang('ThematicPlan'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
105
+                            Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
106 106
                         $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic[0].'">'.
107
-                            Display::return_icon('lesson_plan_calendar.png',get_lang('ThematicAdvance'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
107
+                            Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
108 108
 
109 109
                         $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$thematic[0].'">'.
110
-                            Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>';
110
+                            Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>';
111 111
                         $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$thematic[0].'">'.
112
-                            Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
112
+                            Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
113 113
                     } else {
114
-                        $actions .= Display::return_icon('lesson_plan_na.png',get_lang('ThematicPlan'),'',ICON_SIZE_SMALL).'&nbsp;';
115
-                        $actions .= Display::return_icon('lesson_plan_calendar_na.png',get_lang('ThematicAdvance'),'',ICON_SIZE_SMALL).'&nbsp;';
116
-                        $actions .= Display::return_icon('edit_na.png',get_lang('Edit'),'',ICON_SIZE_SMALL);
117
-                        $actions .= Display::return_icon('delete_na.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'&nbsp;';
114
+                        $actions .= Display::return_icon('lesson_plan_na.png', get_lang('ThematicPlan'), '', ICON_SIZE_SMALL).'&nbsp;';
115
+                        $actions .= Display::return_icon('lesson_plan_calendar_na.png', get_lang('ThematicAdvance'), '', ICON_SIZE_SMALL).'&nbsp;';
116
+                        $actions .= Display::return_icon('edit_na.png', get_lang('Edit'), '', ICON_SIZE_SMALL);
117
+                        $actions .= Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'&nbsp;';
118 118
                         $actions .= Display::url(
119 119
                             Display::return_icon('cd.gif', get_lang('Copy')),
120 120
                             'index.php?'.api_get_cidreq().'&action=thematic_copy&thematic_id='.$thematic[0]
@@ -122,26 +122,26 @@  discard block
 block discarded – undo
122 122
                     }
123 123
                 } else {
124 124
                     $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic[0].'">'.
125
-                        Display::return_icon('lesson_plan.png',get_lang('ThematicPlan'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
125
+                        Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
126 126
                     $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic[0].'">'.
127
-                        Display::return_icon('lesson_plan_calendar.png',get_lang('ThematicAdvance'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
127
+                        Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
128 128
 
129 129
                     if ($thematic[2] > 1) {
130 130
                         $actions .= '<a href="'.api_get_self().'?action=moveup&'.api_get_cidreq().'&thematic_id='.$thematic[0].'">'.
131
-                            Display::return_icon('up.png', get_lang('Up'),'',ICON_SIZE_SMALL).'</a>';
131
+                            Display::return_icon('up.png', get_lang('Up'), '', ICON_SIZE_SMALL).'</a>';
132 132
                     } else {
133
-                        $actions .= Display::return_icon('up_na.png','&nbsp;','',ICON_SIZE_SMALL);
133
+                        $actions .= Display::return_icon('up_na.png', '&nbsp;', '', ICON_SIZE_SMALL);
134 134
                     }
135 135
                     if ($thematic[2] < self::get_max_thematic_item()) {
136 136
                         $actions .= '<a href="'.api_get_self().'?action=movedown&a'.api_get_cidreq().'&thematic_id='.$thematic[0].'">'.
137
-                            Display::return_icon('down.png',get_lang('Down'),'',ICON_SIZE_SMALL).'</a>';
137
+                            Display::return_icon('down.png', get_lang('Down'), '', ICON_SIZE_SMALL).'</a>';
138 138
                     } else {
139
-                        $actions .= Display::return_icon('down_na.png','&nbsp;','',ICON_SIZE_SMALL);
139
+                        $actions .= Display::return_icon('down_na.png', '&nbsp;', '', ICON_SIZE_SMALL);
140 140
                     }
141 141
                     $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$thematic[0].'">'.
142
-                        Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>';
142
+                        Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>';
143 143
                     $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$thematic[0].'">'.
144
-                        Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
144
+                        Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
145 145
                 }
146 146
                 $thematics[] = array($thematic[0], $thematic[1], $actions);
147 147
             }
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 
376 376
         if (is_array($thematic_id)) {
377 377
             foreach ($thematic_id as $id) {
378
-                $id	= intval($id);
378
+                $id = intval($id);
379 379
                 $sql = "UPDATE $tbl_thematic SET active = 0
380 380
                         WHERE c_id = $course_id AND id = $id";
381 381
                 $result = Database::query($sql);
@@ -391,8 +391,8 @@  discard block
 block discarded – undo
391 391
                     );
392 392
                 }
393 393
             }
394
-        } else  {
395
-            $thematic_id	= intval($thematic_id);
394
+        } else {
395
+            $thematic_id = intval($thematic_id);
396 396
             $sql = "UPDATE $tbl_thematic SET active = 0
397 397
                     WHERE c_id = $course_id AND id = $thematic_id";
398 398
             $result = Database::query($sql);
@@ -429,8 +429,8 @@  discard block
 block discarded – undo
429 429
         $new_thematic_id = $thematic_copy->thematic_save();
430 430
         if (!empty($new_thematic_id)) {
431 431
             $thematic_advanced = self::get_thematic_advance_by_thematic_id($thematic_id);
432
-            if(!empty($thematic_advanced)) {
433
-                foreach($thematic_advanced as $item) {
432
+            if (!empty($thematic_advanced)) {
433
+                foreach ($thematic_advanced as $item) {
434 434
                     $thematic = new Thematic();
435 435
                     $thematic->set_thematic_advance_attributes(
436 436
                         0,
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
         $column = intval($column);
495 495
         $from   = intval($from);
496 496
         $number_of_items = intval($number_of_items);
497
-        if (!in_array($direction, array('ASC','DESC'))) {
497
+        if (!in_array($direction, array('ASC', 'DESC'))) {
498 498
             $direction = 'ASC';
499 499
         }
500 500
         $data = array();
@@ -527,8 +527,8 @@  discard block
 block discarded – undo
527 527
                     $thematic_advance[1] = api_get_local_time($thematic_advance[1]);
528 528
                     $thematic_advance[1] = api_format_date($thematic_advance[1], DATE_TIME_FORMAT_LONG);
529 529
                     $actions  = '';
530
-                    $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('edit.png',get_lang('Edit'),'',22).'</a>';
531
-                    $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('delete.png',get_lang('Delete'),'',22).'</a></center>';
530
+                    $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('edit.png', get_lang('Edit'), '', 22).'</a>';
531
+                    $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('delete.png', get_lang('Delete'), '', 22).'</a></center>';
532 532
                     $data[] = array($i, $thematic_advance[1], $thematic_advance[2], $thematic_advance[3], $actions);
533 533
                     $i++;
534 534
                 }
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 
593 593
                 $session_star = '';
594 594
                 if (api_is_allowed_to_edit(null, true)) {
595
-                    if ($thematic_advance['session_id'] !=0) {
595
+                    if ($thematic_advance['session_id'] != 0) {
596 596
                         $session_star = api_get_session_image(api_get_session_id(), $uinfo['status']);
597 597
                     }
598 598
                 }
@@ -618,13 +618,13 @@  discard block
 block discarded – undo
618 618
 
619 619
         foreach ($data as $thematic_id => $thematic_plan_data) {
620 620
             $new_thematic_plan_data = array();
621
-            foreach($thematic_plan_data as $thematic_item) {
621
+            foreach ($thematic_plan_data as $thematic_item) {
622 622
                 $thematic_simple_list[] = $thematic_item['description_type'];
623 623
                 $new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item;
624 624
             }
625 625
 
626 626
             if (!empty($thematic_simple_list)) {
627
-                foreach($thematic_simple_list as $item) {
627
+                foreach ($thematic_simple_list as $item) {
628 628
                     $default_thematic_plan_title[$item] = $new_thematic_plan_data[$item]['title'];
629 629
                 }
630 630
             }
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
                     }
641 641
                     if (!empty($data[$thematic_id][$id]['title']) && !empty($data[$thematic_id][$id]['description'])) {
642 642
                         if (api_is_allowed_to_edit(null, true)) {
643
-                            if ($data[$thematic_id][$id]['session_id'] !=0) {
643
+                            if ($data[$thematic_id][$id]['session_id'] != 0) {
644 644
                                 $session_star = api_get_session_image(api_get_session_id(), $uinfo['status']);
645 645
                             }
646 646
                         }
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
             if ($no_data) {
654 654
                 $return .= '<div><em>'.get_lang('StillDoNotHaveAThematicPlan').'</em></div>';
655 655
             }
656
-            $return  .= '</div>';
656
+            $return .= '</div>';
657 657
             $final_return[$thematic_id] = $return;
658 658
         }
659 659
 
@@ -866,18 +866,18 @@  discard block
 block discarded – undo
866 866
             api_get_session_id()
867 867
         );
868 868
 
869
-        $thematic_plan_complete_list  = array();
869
+        $thematic_plan_complete_list = array();
870 870
         $thematic_plan_id_list = array();
871 871
 
872 872
         if (!empty($items_from_course)) {
873
-            foreach($items_from_course as $item) {
873
+            foreach ($items_from_course as $item) {
874 874
                 $thematic_plan_id_list[] = $item['ref'];
875 875
                 $thematic_plan_complete_list[$item['ref']] = $item;
876 876
             }
877 877
         }
878 878
 
879 879
         if (!empty($items_from_session)) {
880
-            foreach($items_from_session as $item) {
880
+            foreach ($items_from_session as $item) {
881 881
                 $thematic_plan_id_list[] = $item['ref'];
882 882
                 $thematic_plan_complete_list[$item['ref']] = $item;
883 883
             }
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
                 if (!isset($thematic_id) && !isset($description_type)) {
901 901
                     // group all data group by thematic id
902 902
                     $tmp = array();
903
-                    while ($row = Database::fetch_array($rs,'ASSOC')) {
903
+                    while ($row = Database::fetch_array($rs, 'ASSOC')) {
904 904
                         $tmp[] = $row['thematic_id'];
905 905
                         if (in_array($row['thematic_id'], $tmp)) {
906 906
                             $row['session_id'] = $thematic_plan_complete_list[$row['id']];
@@ -908,7 +908,7 @@  discard block
 block discarded – undo
908 908
                         }
909 909
                     }
910 910
                 } else {
911
-                    while ($row = Database::fetch_array($rs,'ASSOC')) {
911
+                    while ($row = Database::fetch_array($rs, 'ASSOC')) {
912 912
                         $row['session_id'] = $thematic_plan_complete_list[$row['id']];
913 913
                         $data[] = $row;
914 914
                     }
@@ -943,8 +943,8 @@  discard block
 block discarded – undo
943 943
         );
944 944
 
945 945
         $elements_to_show = array();
946
-        foreach($list as $value) {
947
-            $elements_to_show[]= $value['ref'];
946
+        foreach ($list as $value) {
947
+            $elements_to_show[] = $value['ref'];
948 948
         }
949 949
         $condition = '';
950 950
         if (!empty($elements_to_show)) {
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
                     c_id = $course_id AND
957 957
                     thematic_id = $thematic_id AND
958 958
                     description_type = '$description_type'";
959
-        $rs	 = Database::query($sql);
959
+        $rs = Database::query($sql);
960 960
 
961 961
         $affected_rows = 0;
962 962
         if (Database::num_rows($rs) > 0) {
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
             $diff = array_diff($all, $a_thematic_advance_ids);
1191 1191
             if (!empty($diff)) {
1192 1192
                 $upd = "UPDATE $tbl_thematic_advance SET done_advance = 0
1193
-    			        WHERE c_id = $course_id AND id IN(".implode(',',$diff).") ";
1193
+    			        WHERE c_id = $course_id AND id IN(".implode(',', $diff).") ";
1194 1194
                 Database::query($upd);
1195 1195
             }
1196 1196
 
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
             $course_code = api_get_course_id();
1306 1306
         }
1307 1307
         if (api_get_session_id()) {
1308
-            $thematic_data = $this->get_thematic_list(null, $course_code );
1308
+            $thematic_data = $this->get_thematic_list(null, $course_code);
1309 1309
         } else {
1310 1310
             $thematic_data = $this->get_thematic_list(null, $course_code, 0);
1311 1311
         }
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
             }
1362 1362
             // calculate average by thematic
1363 1363
             $count_total_advances = count($advances);
1364
-            $average = round(($count_done_advances*100)/$count_total_advances);
1364
+            $average = round(($count_done_advances * 100) / $count_total_advances);
1365 1365
         }
1366 1366
 
1367 1367
         return $average;
@@ -1451,12 +1451,12 @@  discard block
 block discarded – undo
1451 1451
     public function get_default_thematic_plan_title()
1452 1452
     {
1453 1453
         $default_thematic_plan_titles = array();
1454
-        $default_thematic_plan_titles[1]= get_lang('Objectives');
1455
-        $default_thematic_plan_titles[2]= get_lang('SkillToAcquire');
1456
-        $default_thematic_plan_titles[3]= get_lang('Methodology');
1457
-        $default_thematic_plan_titles[4]= get_lang('Infrastructure');
1458
-        $default_thematic_plan_titles[5]= get_lang('Assessment');
1459
-        $default_thematic_plan_titles[6]= get_lang('Others');
1454
+        $default_thematic_plan_titles[1] = get_lang('Objectives');
1455
+        $default_thematic_plan_titles[2] = get_lang('SkillToAcquire');
1456
+        $default_thematic_plan_titles[3] = get_lang('Methodology');
1457
+        $default_thematic_plan_titles[4] = get_lang('Infrastructure');
1458
+        $default_thematic_plan_titles[5] = get_lang('Assessment');
1459
+        $default_thematic_plan_titles[6] = get_lang('Others');
1460 1460
 
1461 1461
         return $default_thematic_plan_titles;
1462 1462
     }
@@ -1468,12 +1468,12 @@  discard block
 block discarded – undo
1468 1468
     public function get_default_thematic_plan_icon()
1469 1469
     {
1470 1470
         $default_thematic_plan_icon = array();
1471
-        $default_thematic_plan_icon[1]= 'icons/32/objective.png';
1472
-        $default_thematic_plan_icon[2]= 'icons/32/skills.png';
1473
-        $default_thematic_plan_icon[3]= 'icons/32/strategy.png';
1474
-        $default_thematic_plan_icon[4]= 'icons/32/laptop.png';
1475
-        $default_thematic_plan_icon[5]= 'icons/32/assessment.png';
1476
-        $default_thematic_plan_icon[6]= 'icons/32/wizard.png';
1471
+        $default_thematic_plan_icon[1] = 'icons/32/objective.png';
1472
+        $default_thematic_plan_icon[2] = 'icons/32/skills.png';
1473
+        $default_thematic_plan_icon[3] = 'icons/32/strategy.png';
1474
+        $default_thematic_plan_icon[4] = 'icons/32/laptop.png';
1475
+        $default_thematic_plan_icon[5] = 'icons/32/assessment.png';
1476
+        $default_thematic_plan_icon[6] = 'icons/32/wizard.png';
1477 1477
 
1478 1478
         return $default_thematic_plan_icon;
1479 1479
     }
@@ -1485,11 +1485,11 @@  discard block
 block discarded – undo
1485 1485
     public function get_default_question()
1486 1486
     {
1487 1487
         $question = array();
1488
-        $question[1]= get_lang('ObjectivesQuestions');
1489
-        $question[2]= get_lang('SkillToAcquireQuestions');
1490
-        $question[3]= get_lang('MethodologyQuestions');
1491
-        $question[4]= get_lang('InfrastructureQuestions');
1492
-        $question[5]= get_lang('AssessmentQuestions');
1488
+        $question[1] = get_lang('ObjectivesQuestions');
1489
+        $question[2] = get_lang('SkillToAcquireQuestions');
1490
+        $question[3] = get_lang('MethodologyQuestions');
1491
+        $question[4] = get_lang('InfrastructureQuestions');
1492
+        $question[5] = get_lang('AssessmentQuestions');
1493 1493
 
1494 1494
         return $question;
1495 1495
     }
Please login to merge, or discard this patch.
main/inc/lib/social.lib.php 4 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1761,7 +1761,9 @@
 block discarded – undo
1761 1761
             $friendHtml.= '<ul class="nav nav-list">';
1762 1762
             $j = 1;
1763 1763
             for ($k=0; $k < $number_friends; $k++) {
1764
-                if ($j > $number_of_images) break;
1764
+                if ($j > $number_of_images) {
1765
+                    break;
1766
+                }
1765 1767
 
1766 1768
                 if (isset($friends[$k])) {
1767 1769
                     $friend = $friends[$k];
Please login to merge, or discard this patch.
Doc Comments   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -67,6 +67,8 @@  discard block
 block discarded – undo
67 67
      * @param int user id
68 68
      * @param int user friend id
69 69
      * @param string
70
+     * @param integer $user_id
71
+     * @param integer $user_friend
70 72
      * @author isaac flores paz
71 73
      */
72 74
     public static function get_relation_between_contacts($user_id, $user_friend)
@@ -98,6 +100,8 @@  discard block
 block discarded – undo
98 100
      * @param int group id
99 101
      * @param string name to search
100 102
      * @param bool true will load firstname, lastname, and image name
103
+     * @param integer $user_id
104
+     * @param integer $id_group
101 105
      * @return array
102 106
      * @author Julio Montoya <[email protected]> Cleaning code, function renamed, $load_extra_info option added
103 107
      * @author isaac flores paz
@@ -174,6 +178,9 @@  discard block
 block discarded – undo
174 178
      * @param int user friend id
175 179
      * @param string title of the message
176 180
      * @param string content of the message
181
+     * @param integer $user_id
182
+     * @param string $message_title
183
+     * @param string $message_content
177 184
      * @return boolean
178 185
      * @author isaac flores paz
179 186
      * @author Julio Montoya <[email protected]> Cleaning code
@@ -248,6 +255,7 @@  discard block
 block discarded – undo
248 255
      * Get number messages of the inbox
249 256
      * @author isaac flores paz
250 257
      * @param int user receiver id
258
+     * @param integer $user_receiver_id
251 259
      * @return int
252 260
      */
253 261
     public static function get_message_number_invitation_by_user_id($user_receiver_id)
@@ -290,6 +298,7 @@  discard block
 block discarded – undo
290 298
      * Get invitation list sent by user
291 299
      * @author Julio Montoya <[email protected]>
292 300
      * @param int user id
301
+     * @param integer $user_id
293 302
      * @return array()
294 303
      */
295 304
     public static function get_list_invitation_sent_by_user_id($user_id)
@@ -332,6 +341,7 @@  discard block
 block discarded – undo
332 341
      * Denies invitation
333 342
      * @param int user sender id
334 343
      * @param int user receiver id
344
+     * @param integer $user_receiver_id
335 345
      * @author isaac flores paz
336 346
      * @author Julio Montoya <[email protected]> Cleaning code
337 347
      */
@@ -426,7 +436,7 @@  discard block
 block discarded – undo
426 436
      * @param string $subject
427 437
      * @param string $content
428 438
      *
429
-     * @return string message invitation
439
+     * @return false|null message invitation
430 440
      */
431 441
     public static function sendInvitationToUser($userId, $subject = '', $content = '')
432 442
     {
@@ -1223,7 +1233,7 @@  discard block
 block discarded – undo
1223 1233
      * @param string $messageContent of the message
1224 1234
      * @param int $messageId id parent
1225 1235
      * @param string $messageStatus status type of message
1226
-     * @return boolean
1236
+     * @return false|string
1227 1237
      * @author Yannick Warnier
1228 1238
      */
1229 1239
     public static function sendWallMessage($userId, $friendId, $messageContent, $messageId = 0, $messageStatus = '')
@@ -1315,7 +1325,7 @@  discard block
 block discarded – undo
1315 1325
      * Gets all messages from someone's wall (within specific limits)
1316 1326
      * @param int $userId id of wall shown
1317 1327
      * @param string $messageStatus status wall message
1318
-     * @param int|string $parentId id message (Post main)
1328
+     * @param integer|null $parentId id message (Post main)
1319 1329
      * @param date $start Date from which we want to show the messages, in UTC time
1320 1330
      * @param int $limit Limit for the number of parent messages we want to show
1321 1331
      * @param int $offset Wall message query offset
@@ -1600,7 +1610,7 @@  discard block
 block discarded – undo
1600 1610
 
1601 1611
     /**
1602 1612
      * verify if Url Exist - Using Curl
1603
-     * @param $uri url
1613
+     * @param string $uri url
1604 1614
      *
1605 1615
      * @return boolean
1606 1616
      */
@@ -1626,7 +1636,7 @@  discard block
 block discarded – undo
1626 1636
     /**
1627 1637
     * Delete messages delete logic
1628 1638
     * @param int $id id message to delete.
1629
-    * @return bool status query
1639
+    * @return Statement|null status query
1630 1640
     */
1631 1641
     public static function deleteMessage($id)
1632 1642
     {
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1408,7 +1408,7 @@  discard block
 block discarded – undo
1408 1408
             $media .= '<div class="col-md-2 col-xs-2 social-post-answers">';
1409 1409
             $media .= '<div class="user-image pull-right">';
1410 1410
             $media .= '<a href="'.$url.'" ><img src="'. $users[$userIdLoop]['avatar'] .
1411
-                       '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>';
1411
+                        '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>';
1412 1412
             $media .= '</div>';
1413 1413
             $media .= '</div>';
1414 1414
             $media .= '<div class="col-md-9 col-xs-9 social-post-answers">';
@@ -1623,10 +1623,10 @@  discard block
 block discarded – undo
1623 1623
     }
1624 1624
 
1625 1625
     /**
1626
-    * Delete messages delete logic
1627
-    * @param int $id id message to delete.
1628
-    * @return bool status query
1629
-    */
1626
+     * Delete messages delete logic
1627
+     * @param int $id id message to delete.
1628
+     * @return bool status query
1629
+     */
1630 1630
     public static function deleteMessage($id)
1631 1631
     {
1632 1632
         $id = intval($id);
Please login to merge, or discard this patch.
Spacing   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -113,12 +113,12 @@  discard block
 block discarded – undo
113 113
                     friend_user_id<>'.((int) $user_id).' AND
114 114
                     user_id='.((int) $user_id);
115 115
         if (isset($id_group) && $id_group > 0) {
116
-            $sql.=' AND relation_type='.$id_group;
116
+            $sql .= ' AND relation_type='.$id_group;
117 117
         }
118 118
         if (isset($search_name)) {
119 119
             $search_name = trim($search_name);
120 120
             $search_name = str_replace(' ', '', $search_name);
121
-            $sql.=' AND friend_user_id IN (
121
+            $sql .= ' AND friend_user_id IN (
122 122
                 SELECT user_id FROM '.$tbl_my_user.'
123 123
                 WHERE
124 124
                     firstName LIKE "%'.Database::escape_string($search_name).'%" OR
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
     {
433 433
         $user_info = api_get_user_info($userId);
434 434
         $success = get_lang('MessageSentTo');
435
-        $success.= ' : '.api_get_person_name($user_info['firstName'], $user_info['lastName']);
435
+        $success .= ' : '.api_get_person_name($user_info['firstName'], $user_info['lastName']);
436 436
 
437 437
         if (isset($subject) && isset($content) && isset($userId)) {
438 438
             $result = MessageManager::send_message($userId, $subject, $content);
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
         );
498 498
 
499 499
         //$valor = api_get_settings_params();
500
-        $course_path = api_get_path(SYS_COURSE_PATH).$course_directory;   // course path
500
+        $course_path = api_get_path(SYS_COURSE_PATH).$course_directory; // course path
501 501
         if (api_get_setting('course_images_in_courses_list') === 'true') {
502 502
             if (file_exists($course_path.'/course-pic85x85.png')) {
503 503
                 $image = $my_course['course_info']['course_image'];
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
         if ($course_visibility != COURSE_VISIBILITY_HIDDEN &&
526 526
             ($course_visibility != COURSE_VISIBILITY_CLOSED || $user_in_course_status == COURSEMANAGER)
527 527
         ) {
528
-            $result .= '<span class="title">' . $course_title . '<span>';
528
+            $result .= '<span class="title">'.$course_title.'<span>';
529 529
         } else {
530 530
             $result .= $course_title." ".get_lang('CourseClosed');
531 531
         }
@@ -733,57 +733,57 @@  discard block
 block discarded – undo
733 733
             $links = '<ul class="nav nav-pills nav-stacked">';
734 734
             $active = $show == 'home' ? 'active' : null;
735 735
             $links .= '
736
-                <li class="home-icon ' . $active . '">
737
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php">
738
-                        ' . $homeIcon . ' ' . get_lang('Home') . '
736
+                <li class="home-icon ' . $active.'">
737
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/home.php">
738
+                        ' . $homeIcon.' '.get_lang('Home').'
739 739
                     </a>
740 740
                 </li>';
741 741
             $active = $show == 'messages' ? 'active' : null;
742 742
             $links .= '
743
-                <li class="messages-icon ' . $active . '">
744
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social">
745
-                        ' . $messagesIcon . ' ' . get_lang('Messages') . $count_unread_message . '
743
+                <li class="messages-icon ' . $active.'">
744
+                    <a href="' . api_get_path(WEB_CODE_PATH).'messages/inbox.php?f=social">
745
+                        ' . $messagesIcon.' '.get_lang('Messages').$count_unread_message.'
746 746
                     </a>
747 747
                 </li>';
748 748
 
749 749
             //Invitations
750 750
             $active = $show == 'invitations' ? 'active' : null;
751 751
             $links .= '
752
-                <li class="invitations-icon ' . $active . '">
753
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">
754
-                        ' . $invitationsIcon . ' ' . get_lang('Invitations') . $total_invitations . '
752
+                <li class="invitations-icon ' . $active.'">
753
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/invitations.php">
754
+                        ' . $invitationsIcon.' '.get_lang('Invitations').$total_invitations.'
755 755
                     </a>
756 756
                 </li>';
757 757
 
758 758
             //Shared profile and groups
759 759
             $active = $show == 'shared_profile' ? 'active' : null;
760 760
             $links .= '
761
-                <li class="shared-profile-icon' . $active . '">
762
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php">
763
-                        ' . $sharedProfileIcon . ' ' . get_lang('ViewMySharedProfile') . '
761
+                <li class="shared-profile-icon' . $active.'">
762
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/profile.php">
763
+                        ' . $sharedProfileIcon.' '.get_lang('ViewMySharedProfile').'
764 764
                     </a>
765 765
                 </li>';
766 766
             $active = $show == 'friends' ? 'active' : null;
767 767
             $links .= '
768
-                <li class="friends-icon ' . $active . '">
769
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php">
770
-                        ' . $friendsIcon . ' ' . get_lang('Friends') . '
768
+                <li class="friends-icon ' . $active.'">
769
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/friends.php">
770
+                        ' . $friendsIcon.' '.get_lang('Friends').'
771 771
                     </a>
772 772
                 </li>';
773 773
             $active = $show == 'browse_groups' ? 'active' : null;
774 774
             $links .= '
775
-                <li class="browse-groups-icon ' . $active . '">
776
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php">
777
-                        ' . $groupsIcon . ' ' . get_lang('SocialGroups') . '
775
+                <li class="browse-groups-icon ' . $active.'">
776
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/groups.php">
777
+                        ' . $groupsIcon.' '.get_lang('SocialGroups').'
778 778
                     </a>
779 779
                 </li>';
780 780
 
781 781
             //Search users
782 782
             $active = $show == 'search' ? 'active' : null;
783 783
             $links .= '
784
-                <li class="search-icon ' . $active . '">
785
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php">
786
-                        ' . $searchIcon . ' ' . get_lang('Search') . '
784
+                <li class="search-icon ' . $active.'">
785
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/search.php">
786
+                        ' . $searchIcon.' '.get_lang('Search').'
787 787
                     </a>
788 788
                 </li>';
789 789
 
@@ -791,9 +791,9 @@  discard block
 block discarded – undo
791 791
             $active = $show == 'myfiles' ? 'active' : null;
792 792
 
793 793
             $myFiles = '
794
-                <li class="myfiles-icon ' . $active . '">
795
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php">
796
-                        ' . $filesIcon . ' ' . get_lang('MyFiles') . '
794
+                <li class="myfiles-icon ' . $active.'">
795
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/myfiles.php">
796
+                        ' . $filesIcon.' '.get_lang('MyFiles').'
797 797
                     </a>
798 798
                 </li>';
799 799
 
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
                 $myFiles = '';
802 802
             }
803 803
             $links .= $myFiles;
804
-            $links .='</ul>';
804
+            $links .= '</ul>';
805 805
 
806 806
             $html .= Display::panelCollapse(
807 807
                 get_lang('SocialNetwork'),
@@ -822,57 +822,57 @@  discard block
 block discarded – undo
822 822
         }
823 823
 
824 824
         if ($show == 'shared_profile') {
825
-            $links =  '<ul class="nav nav-pills nav-stacked">';
825
+            $links = '<ul class="nav nav-pills nav-stacked">';
826 826
             // My own profile
827 827
             if ($show_full_profile && $user_id == intval(api_get_user_id())) {
828 828
                 $links .= '
829
-                    <li class="home-icon ' . $active . '">
830
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php">
831
-                            ' . $homeIcon . ' ' . get_lang('Home') . '
829
+                    <li class="home-icon ' . $active.'">
830
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/home.php">
831
+                            ' . $homeIcon.' '.get_lang('Home').'
832 832
                         </a>
833 833
                     </li>
834
-                    <li class="messages-icon ' . $active . '">
835
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social">
836
-                            ' . $messagesIcon . ' ' . get_lang('Messages') . $count_unread_message . '
834
+                    <li class="messages-icon ' . $active.'">
835
+                        <a href="' . api_get_path(WEB_CODE_PATH).'messages/inbox.php?f=social">
836
+                            ' . $messagesIcon.' '.get_lang('Messages').$count_unread_message.'
837 837
                         </a>
838 838
                     </li>';
839 839
                 $active = $show == 'invitations' ? 'active' : null;
840 840
                 $links .= '
841
-                    <li class="invitations-icon' . $active . '">
842
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">
843
-                            ' . $invitationsIcon . ' ' . get_lang('Invitations') . $total_invitations . '
841
+                    <li class="invitations-icon' . $active.'">
842
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/invitations.php">
843
+                            ' . $invitationsIcon.' '.get_lang('Invitations').$total_invitations.'
844 844
                         </a>
845 845
                     </li>';
846 846
 
847 847
                 $links .= '
848 848
                     <li class="shared-profile-icon active">
849
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php">
850
-                            ' . $sharedProfileIcon . ' ' . get_lang('ViewMySharedProfile') . '
849
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/profile.php">
850
+                            ' . $sharedProfileIcon.' '.get_lang('ViewMySharedProfile').'
851 851
                         </a>
852 852
                     </li>
853 853
                     <li class="friends-icon">
854
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php">
855
-                            ' . $friendsIcon . ' ' . get_lang('Friends') . '
854
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/friends.php">
855
+                            ' . $friendsIcon.' '.get_lang('Friends').'
856 856
                         </a>
857 857
                     </li>
858 858
                     <li class="browse-groups-icon">
859
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php">
860
-                            ' . $groupsIcon . ' ' . get_lang('SocialGroups') . '
859
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/groups.php">
860
+                            ' . $groupsIcon.' '.get_lang('SocialGroups').'
861 861
                         </a>
862 862
                     </li>';
863 863
                 $active = $show == 'search' ? 'active' : null;
864 864
                 $links .= '
865
-                    <li class="search-icon ' . $active . '">
866
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php">
867
-                            ' . $searchIcon . ' ' . get_lang('Search') . '
865
+                    <li class="search-icon ' . $active.'">
866
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/search.php">
867
+                            ' . $searchIcon.' '.get_lang('Search').'
868 868
                         </a>
869 869
                     </li>';
870 870
                 $active = $show == 'myfiles' ? 'active' : null;
871 871
 
872 872
                 $myFiles = '
873
-                    <li class="myfiles-icon ' . $active . '">
874
-                     <a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php">
875
-                            ' . $filesIcon . ' ' . get_lang('MyFiles') . '
873
+                    <li class="myfiles-icon ' . $active.'">
874
+                     <a href="' . api_get_path(WEB_CODE_PATH).'social/myfiles.php">
875
+                            ' . $filesIcon.' '.get_lang('MyFiles').'
876 876
                         </a>
877 877
                     </li>';
878 878
 
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
                 $links .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/invitations.php">'.Display::return_icon('invitation.png', get_lang('YouAlreadySentAnInvitation')).'&nbsp;&nbsp;'.get_lang('YouAlreadySentAnInvitation').'</a></li>';
919 919
             } else {
920 920
                 if (!$show_full_profile) {
921
-                    $links .= '<li><a class="btn-to-send-invitation" href="#" data-send-to="' . $user_id . '" title="'.get_lang('SendInvitation').'">'.Display :: return_icon('invitation.png', get_lang('SocialInvitationToFriends')).'&nbsp;'.get_lang('SendInvitation').'</a></li>';
921
+                    $links .= '<li><a class="btn-to-send-invitation" href="#" data-send-to="'.$user_id.'" title="'.get_lang('SendInvitation').'">'.Display :: return_icon('invitation.png', get_lang('SocialInvitationToFriends')).'&nbsp;'.get_lang('SendInvitation').'</a></li>';
922 922
                 }
923 923
             }
924 924
 
@@ -1025,7 +1025,7 @@  discard block
 block discarded – undo
1025 1025
         foreach ($user_list as $uid) {
1026 1026
             $user_info = api_get_user_info($uid, $checkIfUserOnline = true);
1027 1027
             $lastname = $user_info['lastname'];
1028
-            $firstname =  $user_info['firstname'];
1028
+            $firstname = $user_info['firstname'];
1029 1029
             $completeName = $firstname.', '.$lastname;
1030 1030
 
1031 1031
             $user_rol = $user_info['status'] == 1 ? Display::return_icon('teacher.png', get_lang('Teacher'), null, ICON_SIZE_TINY) : Display::return_icon('user.png', get_lang('Student'), null, ICON_SIZE_TINY);
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
             }
1044 1044
             $img = '<img class="img-responsive img-circle" title="'.$completeName.'" alt="'.$completeName.'" src="'.$userPicture.'">';
1045 1045
 
1046
-            $url =  null;
1046
+            $url = null;
1047 1047
             // Anonymous users can't have access to the profile
1048 1048
             if (!api_is_anonymous()) {
1049 1049
                 if (api_get_setting('allow_social_tool') === 'true') {
@@ -1198,13 +1198,13 @@  discard block
 block discarded – undo
1198 1198
             case SOCIAL_CENTER_PLUGIN:
1199 1199
                 $social_plugins = array(1, 2);
1200 1200
                 if (is_array($social_plugins) && count($social_plugins) > 0) {
1201
-                    $content.= '<div id="social-plugins">';
1201
+                    $content .= '<div id="social-plugins">';
1202 1202
                     foreach ($social_plugins as $plugin) {
1203
-                        $content.= '<div class="social-plugin-item">';
1204
-                        $content.= $plugin;
1205
-                        $content.= '</div>';
1203
+                        $content .= '<div class="social-plugin-item">';
1204
+                        $content .= $plugin;
1205
+                        $content .= '</div>';
1206 1206
                     }
1207
-                    $content.= '</div>';
1207
+                    $content .= '</div>';
1208 1208
                 }
1209 1209
                 break;
1210 1210
             case SOCIAL_LEFT_PLUGIN:
@@ -1275,12 +1275,12 @@  discard block
 block discarded – undo
1275 1275
         if (!in_array($extension, $allowedTypes)) {
1276 1276
             $flag = false;
1277 1277
         } else {
1278
-            $newFileName = uniqid('') . '.' . $extension;
1278
+            $newFileName = uniqid('').'.'.$extension;
1279 1279
             if (!file_exists($pathMessageAttach)) {
1280 1280
                 @mkdir($pathMessageAttach, api_get_permissions_for_new_directories(), true);
1281 1281
             }
1282 1282
 
1283
-            $newPath = $pathMessageAttach . $newFileName;
1283
+            $newPath = $pathMessageAttach.$newFileName;
1284 1284
             if (is_uploaded_file($fileAttach['tmp_name'])) {
1285 1285
                 @copy($fileAttach['tmp_name'], $newPath);
1286 1286
             }
@@ -1289,9 +1289,9 @@  discard block
 block discarded – undo
1289 1289
             $medium = self::resize_picture($newPath, IMAGE_WALL_MEDIUM_SIZE);
1290 1290
 
1291 1291
             $big = new Image($newPath);
1292
-            $ok = $small && $small->send_image($pathMessageAttach . IMAGE_WALL_SMALL . '_' . $newFileName) &&
1293
-                $medium && $medium->send_image($pathMessageAttach . IMAGE_WALL_MEDIUM .'_' . $newFileName) &&
1294
-                $big && $big->send_image($pathMessageAttach . IMAGE_WALL_BIG . '_' . $newFileName);
1292
+            $ok = $small && $small->send_image($pathMessageAttach.IMAGE_WALL_SMALL.'_'.$newFileName) &&
1293
+                $medium && $medium->send_image($pathMessageAttach.IMAGE_WALL_MEDIUM.'_'.$newFileName) &&
1294
+                $big && $big->send_image($pathMessageAttach.IMAGE_WALL_BIG.'_'.$newFileName);
1295 1295
 
1296 1296
             // Insert
1297 1297
             $newFileName = $social.$newFileName;
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
             $start = '0000-00-00';
1386 1386
         }
1387 1387
 
1388
-        $isOwnWall = (api_get_user_id() == $userId  && $userId == $friendId);
1388
+        $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId);
1389 1389
         $messages = self::getWallMessages($userId, MESSAGE_STATUS_WALL, $idMessage, $start, $limit, $offset);
1390 1390
         $formattedList = '<div class="sub-mediapost">';
1391 1391
         $users = array();
@@ -1400,20 +1400,20 @@  discard block
 block discarded – undo
1400 1400
             }
1401 1401
 
1402 1402
             $nameComplete = api_is_western_name_order()
1403
-                ? $users[$userIdLoop]['firstname'] .' ' . $users[$userIdLoop]['lastname']
1404
-                : $users[$userIdLoop]['lastname'] . ' ' . $users[$userIdLoop]['firstname'];
1403
+                ? $users[$userIdLoop]['firstname'].' '.$users[$userIdLoop]['lastname']
1404
+                : $users[$userIdLoop]['lastname'].' '.$users[$userIdLoop]['firstname'];
1405 1405
             $url = api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$userIdLoop;
1406 1406
             $media = '';
1407 1407
             $media .= '<div class="rep-post">';
1408 1408
             $media .= '<div class="col-md-2 col-xs-2 social-post-answers">';
1409 1409
             $media .= '<div class="user-image pull-right">';
1410
-            $media .= '<a href="'.$url.'" ><img src="'. $users[$userIdLoop]['avatar'] .
1410
+            $media .= '<a href="'.$url.'" ><img src="'.$users[$userIdLoop]['avatar'].
1411 1411
                        '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>';
1412 1412
             $media .= '</div>';
1413 1413
             $media .= '</div>';
1414 1414
             $media .= '<div class="col-md-9 col-xs-9 social-post-answers">';
1415 1415
             $media .= '<div class="user-data">';
1416
-            $media .= '<div class="username">' . '<a href="'.$url.'">'.$nameComplete.'</a> <span>'.Security::remove_XSS($message['content']).'</span></div>';
1416
+            $media .= '<div class="username">'.'<a href="'.$url.'">'.$nameComplete.'</a> <span>'.Security::remove_XSS($message['content']).'</span></div>';
1417 1417
             $media .= '<div class="time timeago" title="'.$date.'">'.$date.'</div>';
1418 1418
             $media .= '<br />';
1419 1419
             $media .= '</div>';
@@ -1456,12 +1456,12 @@  discard block
 block discarded – undo
1456 1456
      * @param   int     $offset     Wall messages offset
1457 1457
      * @return  array   $data       return user's starting wall messages along with message extra data
1458 1458
      */
1459
-    public static function getWallMessagesPostHTML($userId, $friendId = 0, $start = null, $limit = 10, $offset= 0)
1459
+    public static function getWallMessagesPostHTML($userId, $friendId = 0, $start = null, $limit = 10, $offset = 0)
1460 1460
     {
1461 1461
         if (empty($start)) {
1462 1462
             $start = '0000-00-00';
1463 1463
         }
1464
-        $isOwnWall = (api_get_user_id() == $userId  && $userId == $friendId);
1464
+        $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId);
1465 1465
         $messages = self::getWallMessages($userId, MESSAGE_STATUS_WALL_POST, null, $start, $limit, $offset);
1466 1466
         $users = array();
1467 1467
         $data = array();
@@ -1520,7 +1520,7 @@  discard block
 block discarded – undo
1520 1520
 
1521 1521
         $htmlReceiver = '';
1522 1522
         if ($authorId != $receiverId) {
1523
-            $htmlReceiver = ' > <a href="'.$urlReceiver.'">' . $nameCompleteReceiver . '</a> ';
1523
+            $htmlReceiver = ' > <a href="'.$urlReceiver.'">'.$nameCompleteReceiver.'</a> ';
1524 1524
         }
1525 1525
 
1526 1526
         $wallImage = '';
@@ -1555,7 +1555,7 @@  discard block
 block discarded – undo
1555 1555
         $html .= '<div class="img-post">';
1556 1556
         $html .= $wallImage;
1557 1557
         $html .= '</div>';
1558
-        $html .= '<p>'. Security::remove_XSS($message['content']).'</p>';
1558
+        $html .= '<p>'.Security::remove_XSS($message['content']).'</p>';
1559 1559
         $html .= '</div>';
1560 1560
         $html .= '</div>'; // end mediaPost
1561 1561
 
@@ -1731,18 +1731,18 @@  discard block
 block discarded – undo
1731 1731
         if ($number_friends != 0) {
1732 1732
             if ($number_friends > $number_of_images) {
1733 1733
                 if (api_get_user_id() == $user_id) {
1734
-                    $friendHtml.= ' <span><a href="friends.php">'.get_lang('SeeAll').'</a></span>';
1734
+                    $friendHtml .= ' <span><a href="friends.php">'.get_lang('SeeAll').'</a></span>';
1735 1735
                 } else {
1736
-                    $friendHtml.= ' <span>'
1736
+                    $friendHtml .= ' <span>'
1737 1737
                         .'<a href="'.api_get_path(WEB_CODE_PATH).'social/profile_friends_and_groups.inc.php'
1738 1738
                         .'?view=friends&height=390&width=610&user_id='.$user_id.'"'
1739 1739
                         .'class="ajax" data-title="'.get_lang('SeeAll').'" title="'.get_lang('SeeAll').'" >'.get_lang('SeeAll').'</a></span>';
1740 1740
                 }
1741 1741
             }
1742 1742
 
1743
-            $friendHtml.= '<ul class="nav nav-list">';
1743
+            $friendHtml .= '<ul class="nav nav-list">';
1744 1744
             $j = 1;
1745
-            for ($k=0; $k < $number_friends; $k++) {
1745
+            for ($k = 0; $k < $number_friends; $k++) {
1746 1746
                 if ($j > $number_of_images) break;
1747 1747
 
1748 1748
                 if (isset($friends[$k])) {
@@ -1756,26 +1756,26 @@  discard block
 block discarded – undo
1756 1756
                         $statusIcon = Display::span('', array('class' => 'offline_user_in_text'));
1757 1757
                     }
1758 1758
 
1759
-                    $friendHtml.= '<li>';
1760
-                    $friendHtml.= '<div>';
1759
+                    $friendHtml .= '<li>';
1760
+                    $friendHtml .= '<div>';
1761 1761
 
1762 1762
                     // the height = 92 must be the same in the image_friend_network span style in default.css
1763 1763
                     $friends_profile = UserManager::getUserPicture($friend['friend_user_id'], USER_IMAGE_SIZE_SMALL);
1764
-                    $friendHtml.= '<img src="'.$friends_profile.'" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$name_user.'"/>';
1764
+                    $friendHtml .= '<img src="'.$friends_profile.'" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$name_user.'"/>';
1765 1765
                     $link_shared = (empty($link_shared)) ? '' : '&'.$link_shared;
1766
-                    $friendHtml.= $statusIcon .'<a href="profile.php?' .'u=' . $friend['friend_user_id'] . $link_shared . '">' . $name_user .'</a>';
1767
-                    $friendHtml.= '</div>';
1768
-                    $friendHtml.= '</li>';
1766
+                    $friendHtml .= $statusIcon.'<a href="profile.php?'.'u='.$friend['friend_user_id'].$link_shared.'">'.$name_user.'</a>';
1767
+                    $friendHtml .= '</div>';
1768
+                    $friendHtml .= '</li>';
1769 1769
                 }
1770 1770
                 $j++;
1771 1771
             }
1772
-            $friendHtml.='</ul>';
1772
+            $friendHtml .= '</ul>';
1773 1773
         } else {
1774
-            $friendHtml.= '<div class="">'.get_lang('NoFriendsInYourContactList').'<br />'
1775
-                .'<a class="btn btn-primary" href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '. get_lang('TryAndFindSomeFriends').'</a></div>';
1774
+            $friendHtml .= '<div class="">'.get_lang('NoFriendsInYourContactList').'<br />'
1775
+                .'<a class="btn btn-primary" href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '.get_lang('TryAndFindSomeFriends').'</a></div>';
1776 1776
         }
1777 1777
 
1778
-        $friendHtml = Display::panel($friendHtml, get_lang('SocialFriend').' (' . $number_friends . ')' );
1778
+        $friendHtml = Display::panel($friendHtml, get_lang('SocialFriend').' ('.$number_friends.')');
1779 1779
 
1780 1780
         return $friendHtml;
1781 1781
     }
@@ -1796,9 +1796,9 @@  discard block
 block discarded – undo
1796 1796
 
1797 1797
         if ($number_friends != 0) {
1798 1798
 
1799
-            $friendHtml.= '<div class="list-group">';
1799
+            $friendHtml .= '<div class="list-group">';
1800 1800
             $j = 1;
1801
-            for ($k=0; $k < $number_friends; $k++) {
1801
+            for ($k = 0; $k < $number_friends; $k++) {
1802 1802
                 if ($j > $number_of_images) {
1803 1803
                     break;
1804 1804
                 }
@@ -1808,11 +1808,11 @@  discard block
 block discarded – undo
1808 1808
                     $user_info_friend = api_get_user_info($friend['friend_user_id'], true);
1809 1809
 
1810 1810
                     if ($user_info_friend['user_is_online']) {
1811
-                        $statusIcon = Display::return_icon('statusonline.png',get_lang('Online'));
1812
-                        $status=1;
1811
+                        $statusIcon = Display::return_icon('statusonline.png', get_lang('Online'));
1812
+                        $status = 1;
1813 1813
                     } else {
1814
-                        $statusIcon = Display::return_icon('statusoffline.png',get_lang('Offline'));
1815
-                        $status=0;
1814
+                        $statusIcon = Display::return_icon('statusoffline.png', get_lang('Offline'));
1815
+                        $status = 0;
1816 1816
                     }
1817 1817
 
1818 1818
                     $friendAvatarMedium = UserManager::getUserPicture($friend['friend_user_id'], USER_IMAGE_SIZE_MEDIUM);
@@ -1821,24 +1821,24 @@  discard block
 block discarded – undo
1821 1821
                     $showLinkToChat = api_is_global_chat_enabled() &&
1822 1822
                         $friend['friend_user_id'] != api_get_user_id();
1823 1823
 
1824
-                    if ($showLinkToChat){
1824
+                    if ($showLinkToChat) {
1825 1825
                         $friendHtml .= '<a onclick="javascript:chatWith(\''.$friend['friend_user_id'].'\', \''.$name_user.'\', \''.$status.'\',\''.$friendAvatarSmall.'\')" href="javascript:void(0);" class="list-group-item">';
1826
-                        $friendHtml .=  $friend_avatar.' <span class="username">' . $name_user . '</span>';
1827
-                        $friendHtml .= '<span class="status">' . $statusIcon . '</span>';
1826
+                        $friendHtml .= $friend_avatar.' <span class="username">'.$name_user.'</span>';
1827
+                        $friendHtml .= '<span class="status">'.$statusIcon.'</span>';
1828 1828
                     } else {
1829 1829
                         $link_shared = empty($link_shared) ? '' : '&'.$link_shared;
1830
-                        $friendHtml .= '<a href="profile.php?' .'u=' . $friend['friend_user_id'] . $link_shared . '" class="list-group-item">';
1831
-                        $friendHtml .=  $friend_avatar.' <span class="username-all">' . $name_user . '</span>';
1830
+                        $friendHtml .= '<a href="profile.php?'.'u='.$friend['friend_user_id'].$link_shared.'" class="list-group-item">';
1831
+                        $friendHtml .= $friend_avatar.' <span class="username-all">'.$name_user.'</span>';
1832 1832
                     }
1833 1833
 
1834 1834
                     $friendHtml .= '</a>';
1835 1835
                 }
1836 1836
                 $j++;
1837 1837
             }
1838
-            $friendHtml.='</div>';
1838
+            $friendHtml .= '</div>';
1839 1839
         } else {
1840
-            $friendHtml.= '<div class="help">'.get_lang('NoFriendsInYourContactList').' '
1841
-                .'<a href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '. get_lang('TryAndFindSomeFriends').'</a></div>';
1840
+            $friendHtml .= '<div class="help">'.get_lang('NoFriendsInYourContactList').' '
1841
+                .'<a href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '.get_lang('TryAndFindSomeFriends').'</a></div>';
1842 1842
         }
1843 1843
 
1844 1844
         return $friendHtml;
@@ -1856,7 +1856,7 @@  discard block
 block discarded – undo
1856 1856
                 'post',
1857 1857
                 api_get_path(WEB_CODE_PATH).'social/profile.php'.$userId,
1858 1858
                 null,
1859
-                array('enctype' => 'multipart/form-data') ,
1859
+                array('enctype' => 'multipart/form-data'),
1860 1860
                 FormValidator::LAYOUT_HORIZONTAL
1861 1861
             );
1862 1862
 
Please login to merge, or discard this patch.
main/inc/lib/fileDisplay.lib.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -249,7 +249,7 @@
 block discarded – undo
249 249
         'props.session_id'
250 250
     );
251 251
 
252
-    $visibility_rule = ' props.visibility ' . ($can_see_invisible ? '<> 2' : '= 1');
252
+    $visibility_rule = ' props.visibility '.($can_see_invisible ? '<> 2' : '= 1');
253 253
 
254 254
     $sql = "SELECT SUM(table1.size) FROM (
255 255
                 SELECT props.ref, size
Please login to merge, or discard this patch.
main/admin/extra_field_workflow.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 api_protect_admin_script();
16 16
 
17 17
 // setting breadcrumbs
18
-$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
18
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
19 19
 
20 20
 $tool_name = null;
21 21
 
@@ -36,16 +36,16 @@  discard block
 block discarded – undo
36 36
 $token = Security::get_token();
37 37
 
38 38
 if ($action == 'add') {
39
-    $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extraField->type,'name' => $extraField->pageName);
40
-    $interbreadcrumb[]=array(
39
+    $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extraField->type, 'name' => $extraField->pageName);
40
+    $interbreadcrumb[] = array(
41 41
         'url' => 'extra_fields.php?type='.$extraField->type.'&action=edit&id='.$extraFieldInfo['id'],
42 42
         'name' => $extraFieldInfo['display_text']
43 43
     );
44
-    $interbreadcrumb[]=array(
44
+    $interbreadcrumb[] = array(
45 45
         'url' => 'extra_field_options.php?type='.$extraField->type.'&field_id='.$extraFieldInfo['id'],
46 46
         'name' => get_lang('EditExtraFieldOptions')
47 47
     );
48
-    $interbreadcrumb[]=array('url' => '#','name' => get_lang('Add'));
48
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add'));
49 49
 } elseif ($action == 'edit') {
50 50
     $interbreadcrumb[] = array(
51 51
         'url' => 'extra_fields.php?type='.$extraField->type,
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
 $paramsNoRole = 'field_id='.$field_id.'&type='.$extraField->type;
84 84
 
85 85
 //The order is important you need to check the the $column variable in the model.ajax.php file
86
-$columns = array(get_lang('Name'), get_lang('Value'),  get_lang('Order'), get_lang('Actions'));
86
+$columns = array(get_lang('Name'), get_lang('Value'), get_lang('Order'), get_lang('Actions'));
87 87
 
88
-$htmlHeadXtra[]='<script>
88
+$htmlHeadXtra[] = '<script>
89 89
 
90 90
     function setHidden(obj) {
91 91
         var name = $(obj).attr("name");
@@ -186,9 +186,9 @@  discard block
 block discarded – undo
186 186
 if (!empty($roleId)) {
187 187
     $form->addElement('html', $table->toHtml());
188 188
     $group = array();
189
-    $group[]= $form->createElement('button', 'submit', get_lang('Save'));
190
-    $group[]= $form->createElement('button', 'select_all', get_lang('SelectAll'), array('class' => 'btn select_all'));
191
-    $group[]= $form->createElement('button', 'unselect_all', get_lang('UnSelectAll'), array('class' => 'btn unselect_all'));
189
+    $group[] = $form->createElement('button', 'submit', get_lang('Save'));
190
+    $group[] = $form->createElement('button', 'select_all', get_lang('SelectAll'), array('class' => 'btn select_all'));
191
+    $group[] = $form->createElement('button', 'unselect_all', get_lang('UnSelectAll'), array('class' => 'btn unselect_all'));
192 192
     $form->addGroup($group, '', null, ' ');
193 193
 
194 194
     $form->setDefaults(array('status' => $roleId));
Please login to merge, or discard this patch.
main/admin/dashboard_add_courses_to_user.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -36,20 +36,20 @@  discard block
 block discarded – undo
36 36
 
37 37
 // setting the name of the tool
38 38
 if (UserManager::is_admin($user_id)) {
39
-	$tool_name= get_lang('AssignCoursesToPlatformAdministrator');
39
+    $tool_name= get_lang('AssignCoursesToPlatformAdministrator');
40 40
 } else if ($user_info['status'] == SESSIONADMIN) {
41
-	$tool_name= get_lang('AssignCoursesToSessionsAdministrator');
41
+    $tool_name= get_lang('AssignCoursesToSessionsAdministrator');
42 42
 } else {
43
-	$tool_name= get_lang('AssignCoursesToHumanResourcesManager');
43
+    $tool_name= get_lang('AssignCoursesToHumanResourcesManager');
44 44
 }
45 45
 
46 46
 $add_type = 'multiple';
47 47
 if(isset($_GET['add_type']) && $_GET['add_type']!='') {
48
-	$add_type = Security::remove_XSS($_REQUEST['add_type']);
48
+    $add_type = Security::remove_XSS($_REQUEST['add_type']);
49 49
 }
50 50
 
51 51
 if (!api_is_platform_admin()) {
52
-	api_not_allowed(true);
52
+    api_not_allowed(true);
53 53
 }
54 54
 
55 55
 function search_courses($needle, $type)
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     $return = '';
61 61
     if (!empty($needle) && !empty($type)) {
62 62
         // xajax send utf8 datas... datas in db can be non-utf8 datas
63
-		$needle = Database::escape_string($needle);
63
+        $needle = Database::escape_string($needle);
64 64
 
65 65
         $assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id);
66 66
         $assigned_courses_code = array_keys($assigned_courses_to_hrm);
@@ -88,16 +88,16 @@  discard block
 block discarded – undo
88 88
                 		$without_assigned_courses ";
89 89
         }
90 90
 
91
-		$rs	= Database::query($sql);
91
+        $rs	= Database::query($sql);
92 92
 
93
-		$return .= '<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" >';
94
-		while ($course = Database :: fetch_array($rs)) {
95
-			$return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'],ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>';
96
-		}
97
-		$return .= '</select>';
98
-		$xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return));
99
-	}
100
-	return $xajax_response;
93
+        $return .= '<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" >';
94
+        while ($course = Database :: fetch_array($rs)) {
95
+            $return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'],ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>';
96
+        }
97
+        $return .= '</select>';
98
+        $xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return));
99
+    }
100
+    return $xajax_response;
101 101
 }
102 102
 
103 103
 $xajax->processRequests();
@@ -187,23 +187,23 @@  discard block
 block discarded – undo
187 187
 $assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id);
188 188
 $assigned_courses_code = array_keys($assigned_courses_to_hrm);
189 189
 foreach ($assigned_courses_code as &$value) {
190
-	$value = "'".$value."'";
190
+    $value = "'".$value."'";
191 191
 }
192 192
 
193 193
 $without_assigned_courses = '';
194 194
 if (count($assigned_courses_code) > 0) {
195
-	$without_assigned_courses = " AND c.code NOT IN(".implode(',', $assigned_courses_code).")";
195
+    $without_assigned_courses = " AND c.code NOT IN(".implode(',', $assigned_courses_code).")";
196 196
 }
197 197
 
198 198
 $needle = '%';
199 199
 $firstLetter = null;
200 200
 if (isset($_POST['firstLetterCourse'])) {
201
-	$firstLetter = $_POST['firstLetterCourse'];
202
-	$needle = Database::escape_string($firstLetter.'%');
201
+    $firstLetter = $_POST['firstLetterCourse'];
202
+    $needle = Database::escape_string($firstLetter.'%');
203 203
 }
204 204
 
205 205
 if (api_is_multiple_url_enabled()) {
206
-	$sql = " SELECT c.code, c.title
206
+    $sql = " SELECT c.code, c.title
207 207
             FROM $tbl_course c
208 208
             LEFT JOIN $tbl_course_rel_access_url a
209 209
             ON (a.c_id = c.id)
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             ORDER BY c.title";
214 214
 
215 215
 } else {
216
-	$sql= " SELECT c.code, c.title
216
+    $sql= " SELECT c.code, c.title
217 217
 	        FROM $tbl_course c
218 218
             WHERE  c.code LIKE '$needle' $without_assigned_courses
219 219
             ORDER BY c.title";
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 <input type="hidden" name="formSent" value="1" />
228 228
 <?php
229 229
 if(!empty($msg)) {
230
-	Display::display_normal_message($msg); //main API
230
+    Display::display_normal_message($msg); //main API
231 231
 }
232 232
 ?>
233 233
 
@@ -272,13 +272,13 @@  discard block
 block discarded – undo
272 272
     </div>
273 273
     <div class="col-md-4">
274 274
         <h5><?php
275
-	  	if (UserManager::is_admin($user_id)) {
276
-			echo get_lang('AssignedCoursesListToPlatformAdministrator');
277
-		} else if ($user_info['status'] == SESSIONADMIN) {
278
-			echo get_lang('AssignedCoursesListToSessionsAdministrator');
279
-		} else {
280
-			echo get_lang('AssignedCoursesListToHumanResourcesManager');
281
-		}
275
+            if (UserManager::is_admin($user_id)) {
276
+            echo get_lang('AssignedCoursesListToPlatformAdministrator');
277
+        } else if ($user_info['status'] == SESSIONADMIN) {
278
+            echo get_lang('AssignedCoursesListToSessionsAdministrator');
279
+        } else {
280
+            echo get_lang('AssignedCoursesListToHumanResourcesManager');
281
+        }
282 282
             ?>: </h5>
283 283
 
284 284
         <select id='destination' name="CoursesList[]" multiple="multiple" size="20" style="width:320px;">
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 // setting breadcrumbs
23 23
 $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
24
-$interbreadcrumb[] = array('url' => 'user_list.php','name' => get_lang('UserList'));
24
+$interbreadcrumb[] = array('url' => 'user_list.php', 'name' => get_lang('UserList'));
25 25
 
26 26
 // Database Table Definitions
27 27
 $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 
37 37
 // setting the name of the tool
38 38
 if (UserManager::is_admin($user_id)) {
39
-	$tool_name= get_lang('AssignCoursesToPlatformAdministrator');
39
+	$tool_name = get_lang('AssignCoursesToPlatformAdministrator');
40 40
 } else if ($user_info['status'] == SESSIONADMIN) {
41
-	$tool_name= get_lang('AssignCoursesToSessionsAdministrator');
41
+	$tool_name = get_lang('AssignCoursesToSessionsAdministrator');
42 42
 } else {
43
-	$tool_name= get_lang('AssignCoursesToHumanResourcesManager');
43
+	$tool_name = get_lang('AssignCoursesToHumanResourcesManager');
44 44
 }
45 45
 
46 46
 $add_type = 'multiple';
47
-if(isset($_GET['add_type']) && $_GET['add_type']!='') {
47
+if (isset($_GET['add_type']) && $_GET['add_type'] != '') {
48 48
 	$add_type = Security::remove_XSS($_REQUEST['add_type']);
49 49
 }
50 50
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 function search_courses($needle, $type)
56 56
 {
57
-    global $tbl_course, $tbl_course_rel_access_url,$user_id;
57
+    global $tbl_course, $tbl_course_rel_access_url, $user_id;
58 58
 
59 59
     $xajax_response = new xajaxResponse();
60 60
     $return = '';
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         }
70 70
         $without_assigned_courses = '';
71 71
         if (count($assigned_courses_code) > 0) {
72
-            $without_assigned_courses = " AND c.code NOT IN(".implode(',',$assigned_courses_code).")";
72
+            $without_assigned_courses = " AND c.code NOT IN(".implode(',', $assigned_courses_code).")";
73 73
         }
74 74
 
75 75
         if (api_is_multiple_url_enabled()) {
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
                 		$without_assigned_courses ";
89 89
         }
90 90
 
91
-		$rs	= Database::query($sql);
91
+		$rs = Database::query($sql);
92 92
 
93 93
 		$return .= '<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" >';
94 94
 		while ($course = Database :: fetch_array($rs)) {
95
-			$return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'],ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>';
95
+			$return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'], ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>';
96 96
 		}
97 97
 		$return .= '</select>';
98
-		$xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return));
98
+		$xajax_response -> addAssign('ajax_list_courses_multiple', 'innerHTML', api_utf8_encode($return));
99 99
 	}
100 100
 	return $xajax_response;
101 101
 }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 }
154 154
 </script>';
155 155
 
156
-$formSent=0;
156
+$formSent = 0;
157 157
 $errorMsg = $firstLetterCourse = '';
158 158
 $UserList = array();
159 159
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 if (isset($_POST['formSent']) && intval($_POST['formSent']) == 1) {
162 162
     $courses_list = isset($_POST['CoursesList']) ? $_POST['CoursesList'] : [];
163 163
     $affected_rows = CourseManager::subscribeCoursesToDrhManager($user_id, $courses_list);
164
-    if ($affected_rows)	{
164
+    if ($affected_rows) {
165 165
         $msg = get_lang('AssignedCoursesHaveBeenUpdatedSuccessfully');
166 166
     }
167 167
 }
@@ -213,20 +213,20 @@  discard block
 block discarded – undo
213 213
             ORDER BY c.title";
214 214
 
215 215
 } else {
216
-	$sql= " SELECT c.code, c.title
216
+	$sql = " SELECT c.code, c.title
217 217
 	        FROM $tbl_course c
218 218
             WHERE  c.code LIKE '$needle' $without_assigned_courses
219 219
             ORDER BY c.title";
220 220
 }
221 221
 
222 222
 
223
-$result	= Database::query($sql);
223
+$result = Database::query($sql);
224 224
 
225 225
 ?>
226 226
 <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;">
227 227
 <input type="hidden" name="formSent" value="1" />
228 228
 <?php
229
-if(!empty($msg)) {
229
+if (!empty($msg)) {
230 230
 	Display::display_normal_message($msg); //main API
231 231
 }
232 232
 ?>
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
         <div id="ajax_list_courses_multiple">
239 239
 	<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" style="width:340px;">
240 240
 	<?php while ($enreg = Database::fetch_array($result)) { ?>
241
-            <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'],ENT_QUOTES).'"';?>><?php echo $enreg['title'].' ('.$enreg['code'].')'; ?></option>
241
+            <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'], ENT_QUOTES).'"'; ?>><?php echo $enreg['title'].' ('.$enreg['code'].')'; ?></option>
242 242
 	<?php } ?>
243 243
 	</select>
244 244
         </div>
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
     </div>
247 247
     <div class="col-md-4">
248 248
         <div class="code-course">
249
-        <?php if($add_type == 'multiple') { ?>
250
-        <p><?php echo get_lang('FirstLetterCourse');?> :</p>
249
+        <?php if ($add_type == 'multiple') { ?>
250
+        <p><?php echo get_lang('FirstLetterCourse'); ?> :</p>
251 251
         <select name="firstLetterCourse" class="selectpicker form-control" onchange = "xajax_search_courses(this.value,'multiple')">
252 252
             <option value="%">--</option>
253 253
             <?php  echo Display :: get_alphabet_options($firstLetter); ?>
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
             if (is_array($assigned_courses_to_hrm)) {
287 287
                 foreach ($assigned_courses_to_hrm as $enreg) {
288 288
             ?>
289
-                <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="' . htmlspecialchars($enreg['title'], ENT_QUOTES) . '"'; ?>><?php echo $enreg['title'] . ' (' . $enreg['code'] . ')'; ?></option>
289
+                <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'], ENT_QUOTES).'"'; ?>><?php echo $enreg['title'].' ('.$enreg['code'].')'; ?></option>
290 290
             <?php
291 291
                     }
292 292
                 }
Please login to merge, or discard this patch.
main/admin/usergroup_import.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
             // 2. Check whether class doesn't exist yet.
24 24
             if ($usergroup->usergroup_exists($class['name'])) {
25 25
                 $class['line'] = $index + 2;
26
-                $class['error'] = get_lang('ClassNameExists') .
27
-                    ': <strong>' .$class['name'] . '</strong>';
26
+                $class['error'] = get_lang('ClassNameExists').
27
+                    ': <strong>'.$class['name'].'</strong>';
28 28
                 $errors[] = $class;
29 29
             }
30 30
         }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     'radio',
103 103
     'file_type',
104 104
     '',
105
-    'CSV (<a href="example_class.csv" target="_blank">' . get_lang('ExampleCSVFile') . '</a>)',
105
+    'CSV (<a href="example_class.csv" target="_blank">'.get_lang('ExampleCSVFile').'</a>)',
106 106
     'csv'
107 107
 );
108 108
 $form->addGroup($group, '', get_lang('FileType'), null);
@@ -113,12 +113,12 @@  discard block
 block discarded – undo
113 113
     $errors = validate_data($classes);
114 114
     if (count($errors) == 0) {
115 115
         $number_of_added_classes = save_data($classes);
116
-        Display::display_normal_message($number_of_added_classes . ' ' . get_lang('Added'));
116
+        Display::display_normal_message($number_of_added_classes.' '.get_lang('Added'));
117 117
     } else {
118 118
         $error_message = get_lang('ErrorsWhenImportingFile');
119 119
         $error_message .= '<ul>';
120 120
         foreach ($errors as $index => $error_class) {
121
-            $error_message .= '<li>' . $error_class['error'] . ' (' . get_lang('Line') . ' ' . $error_class['line'] . ')';
121
+            $error_message .= '<li>'.$error_class['error'].' ('.get_lang('Line').' '.$error_class['line'].')';
122 122
             $error_message .= '</li>';
123 123
         }
124 124
         $error_message .= '</ul>';
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
 $form->display();
131 131
 ?>
132
-<p><?php echo get_lang('CSVMustLookLike') . ' (' . get_lang('MandatoryFields') . ')'; ?> :</p>
132
+<p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p>
133 133
 
134 134
 <pre>
135 135
 <b>name;description;</b>users
Please login to merge, or discard this patch.
main/admin/skills_gradebook.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 // setting breadcrumbs
26 26
 
27 27
 $tool_name = get_lang('SkillsAndGradebooks');
28
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
28
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
29 29
 if ($action == 'add_skill') {
30
-    $interbreadcrumb[]=array('url' => 'skills_gradebook.php','name' => get_lang('SkillsAndGradebooks'));
30
+    $interbreadcrumb[] = array('url' => 'skills_gradebook.php', 'name' => get_lang('SkillsAndGradebooks'));
31 31
     $tool_name = get_lang('Add');
32 32
 }
33 33
 
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
 $action_links = 'function action_formatter(cellvalue, options, rowObject) {
87 87
                         //certificates
88 88
                         if (rowObject[4] == 1) {
89
-                            return \'<a href="?action=add_skill&id=\'+options.rowId+\'">'.Display::return_icon('add.png', get_lang('AddSkill'),'',ICON_SIZE_SMALL).'</a>'.'\';
89
+                            return \'<a href="?action=add_skill&id=\'+options.rowId+\'">'.Display::return_icon('add.png', get_lang('AddSkill'), '', ICON_SIZE_SMALL).'</a>'.'\';
90 90
                         } else {
91
-                            return \''.Display::return_icon('add_na.png', get_lang('YourGradebookFirstNeedsACertificateInOrderToBeLinkedToASkill'),'',ICON_SIZE_SMALL).''.'\';
91
+                            return \''.Display::return_icon('add_na.png', get_lang('YourGradebookFirstNeedsACertificateInOrderToBeLinkedToASkill'), '', ICON_SIZE_SMALL).''.'\';
92 92
                         }
93 93
                  }';
94 94
 ?>
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 $(function() {
97 97
 <?php
98 98
     // grid definition see the $career->display() function
99
-    echo Display::grid_js('gradebooks', $url, $columns, $column_model, $extra_params, array(), $action_links,true);
99
+    echo Display::grid_js('gradebooks', $url, $columns, $column_model, $extra_params, array(), $action_links, true);
100 100
 ?>
101 101
 });
102 102
 </script>
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
112 112
         $gradebook_info = $gradebook->get($id);
113 113
         $url  = api_get_self().'?action='.$action.'&id='.$id;
114
-        $form =  $gradebook->show_skill_form($id, $url, $gradebook_info['name']);
114
+        $form = $gradebook->show_skill_form($id, $url, $gradebook_info['name']);
115 115
         if ($form->validate()) {
116 116
             $values = $form->exportValues();
117 117
             $res    = $gradebook->update_skills_to_gradebook($values['id'], $values['skill']);
Please login to merge, or discard this patch.
main/admin/skills_import.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             $oskill = new Skill();
71 71
             $skill_id = $oskill->add($skill);
72 72
             $parents[$saved_id] = $skill_id;
73
-		}
73
+        }
74 74
     }
75 75
 }
76 76
 
@@ -81,12 +81,12 @@  discard block
 block discarded – undo
81 81
  */
82 82
 function parse_csv_data($file)
83 83
 {
84
-	$skills = Import :: csvToArray($file);
85
-	foreach ($skills as $index => $skill) {
86
-		$skills[$index] = $skill;
87
-	}
84
+    $skills = Import :: csvToArray($file);
85
+    foreach ($skills as $index => $skill) {
86
+        $skills[$index] = $skill;
87
+    }
88 88
 
89
-	return $skills;
89
+    return $skills;
90 90
 }
91 91
 
92 92
 /**
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
  */
95 95
 function element_start($parser, $data)
96 96
 {
97
-	$data = api_utf8_decode($data);
97
+    $data = api_utf8_decode($data);
98 98
     global $skill;
99 99
     global $current_tag;
100 100
     switch ($data) {
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
  */
112 112
 function element_end($parser, $data)
113 113
 {
114
-	$data = api_utf8_decode($data);
114
+    $data = api_utf8_decode($data);
115 115
     global $skill;
116 116
     global $skills;
117 117
     global $current_value;
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
  */
131 131
 function character_data($parser, $data)
132 132
 {
133
-	$data = trim(api_utf8_decode($data));
134
-	global $current_value;
135
-	$current_value = $data;
133
+    $data = trim(api_utf8_decode($data));
134
+    global $current_value;
135
+    $current_value = $data;
136 136
 }
137 137
 
138 138
 /**
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
     xml_parse($parser, api_utf8_encode_xml(file_get_contents($file)));
155 155
     xml_parser_free($parser);
156 156
 
157
-	return $skills;
157
+    return $skills;
158 158
 }
159 159
 
160 160
 $this_section = SECTION_PLATFORM_ADMIN;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 api_protect_admin_script(true);
162 162
 
163 163
 $tool_name = get_lang('ImportSkillsListCSV');
164
-$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
164
+$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
165 165
 
166 166
 set_time_limit(0);
167 167
 $extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC', true);
@@ -172,13 +172,13 @@  discard block
 block discarded – undo
172 172
     $file_type = $_POST['file_type'];
173 173
     Security::clear_token();
174 174
     $tok = Security::get_token();
175
-    $allowed_file_mimetype = array('csv','xml');
175
+    $allowed_file_mimetype = array('csv', 'xml');
176 176
     $error_kind_file = false;
177 177
     $error_message = '';
178 178
 
179
-    $ext_import_file = substr($_FILES['import_file']['name'], (strrpos($_FILES['import_file']['name'],'.')+1));
179
+    $ext_import_file = substr($_FILES['import_file']['name'], (strrpos($_FILES['import_file']['name'], '.') + 1));
180 180
 
181
-    if (in_array($ext_import_file,$allowed_file_mimetype)) {
181
+    if (in_array($ext_import_file, $allowed_file_mimetype)) {
182 182
         if (strcmp($file_type, 'csv') === 0 && $ext_import_file == $allowed_file_mimetype[0]) {
183 183
             $skills	= parse_csv_data($_FILES['import_file']['tmp_name']);
184 184
             $errors = validate_data($skills);
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
     }
239 239
 }
240 240
 
241
-$interbreadcrumb[] = array ("url" => 'skill_list.php', "name" => get_lang('ManageSkills'));
241
+$interbreadcrumb[] = array("url" => 'skill_list.php', "name" => get_lang('ManageSkills'));
242 242
 
243 243
 Display :: display_header($tool_name);
244 244
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 
252 252
 $toolbar = Display::toolbarButton(
253 253
     get_lang('ManageSkills'),
254
-    api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php',
254
+    api_get_path(WEB_CODE_PATH).'admin/skill_list.php',
255 255
     'list',
256 256
     'success',
257 257
     ['title' => get_lang('CreateSkill')]
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 $toolbar .= '&nbsp;&nbsp;';
260 260
 $toolbar .= Display::toolbarButton(
261 261
     get_lang('SkillsWheel'),
262
-    api_get_path(WEB_CODE_PATH) . 'admin/skills_wheel.php',
262
+    api_get_path(WEB_CODE_PATH).'admin/skills_wheel.php',
263 263
     'bullseye',
264 264
     'primary',
265 265
     ['title' => get_lang('CreateSkill')]
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 $toolbar .= '&nbsp;&nbsp;';
268 268
 $toolbar .= Display::toolbarButton(
269 269
     get_lang('BadgesManagement'),
270
-    api_get_path(WEB_CODE_PATH) . 'admin/skill_badge_list.php',
270
+    api_get_path(WEB_CODE_PATH).'admin/skill_badge_list.php',
271 271
     'shield',
272 272
     'warning',
273 273
     ['title' => get_lang('BadgesManagement')]
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 
277 277
 echo $toolbar;
278 278
 
279
-$form = new FormValidator('user_import','post','skills_import.php');
279
+$form = new FormValidator('user_import', 'post', 'skills_import.php');
280 280
 $form->addElement('header', '', $tool_name);
281 281
 $form->addElement('hidden', 'formSent');
282 282
 $form->addElement('file', 'import_file', get_lang('ImportFileLocation'));
Please login to merge, or discard this patch.
main/admin/event_type.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 $languages = api_get_languages();
54 54
 
55
-$ajaxPath = api_get_path(WEB_CODE_PATH) . 'inc/ajax/events.ajax.php';
55
+$ajaxPath = api_get_path(WEB_CODE_PATH).'inc/ajax/events.ajax.php';
56 56
 
57 57
 $action_array = array(
58 58
     array(
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
         <select class="col-md-6" multiple="1" id="eventList" onchange="confirmMessage(this.name); return false;" name="eventList">
329 329
         <?php
330 330
         foreach ($event_config as $key => $config) {
331
-            echo '<option value="' . $key . '">' . $config['name_lang_var'] . '</option>';
331
+            echo '<option value="'.$key.'">'.$config['name_lang_var'].'</option>';
332 332
         }
333 333
         ?>
334 334
         </select>
Please login to merge, or discard this patch.