Completed
Push — master ( f173a6...4a27fe )
by Angel Fernando Quiroz
37:49 queued 04:39
created
main/admin/filler.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@
 block discarded – undo
53 53
     $result .= '<table>';
54 54
     foreach ($output as $line) {
55 55
         $result .= '<tr>';
56
-	    $result .= '<td class="filler-report-data-init">'.$line['line-init'].' </td><td class="filler-report-data">'.$line['line-info'].'</td>';
57
-	    $result .= '</tr>';
56
+        $result .= '<td class="filler-report-data-init">'.$line['line-init'].' </td><td class="filler-report-data">'.$line['line-info'].'</td>';
57
+        $result .= '</tr>';
58 58
     }
59 59
     $result .= '</table>';
60 60
     $result .= '</div>';
Please login to merge, or discard this patch.
main/inc/lib/webservices/Rest.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -318,7 +318,6 @@
 block discarded – undo
318 318
     }
319 319
 
320 320
     /**
321
-     * @param int $courseId
322 321
      * @return array
323 322
      * @throws Exception
324 323
      */
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -809,7 +809,8 @@
 block discarded – undo
809 809
      * @param string $encoded
810 810
      * @return array
811 811
      */
812
-    public static function decodeParams($encoded) {
812
+    public static function decodeParams($encoded)
813
+    {
813 814
         $decoded = str_replace(['-', '_', '.'], ['+', '/', '='], $encoded);
814 815
         $mod4 = strlen($decoded) % 4;
815 816
 
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Composer/ScriptHandler.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     }
46 46
 
47 47
     /**
48
-     * @return array
48
+     * @return string[]
49 49
      */
50 50
     public static function getFoldersToDelete()
51 51
     {
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     }
96 96
 
97 97
     /**
98
-     * @return array
98
+     * @return string[]
99 99
      */
100 100
     public static function getFilesToDelete()
101 101
     {
Please login to merge, or discard this patch.
plugin/ims_lti/ImsLtiPlugin.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     /**
26 26
      * Get the class instance
27 27
      * @staticvar MsiLtiPlugin $result
28
-     * @return MsiLtiPlugin
28
+     * @return ImsLtiPlugin
29 29
      */
30 30
     public static function create()
31 31
     {
Please login to merge, or discard this patch.
plugin/ims_lti/ImsLtiTool.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -20,6 +20,9 @@
 block discarded – undo
20 20
         return $this->id;
21 21
     }
22 22
 
23
+    /**
24
+     * @return string
25
+     */
23 26
     public function getName()
24 27
     {
25 28
         return $this->name;
Please login to merge, or discard this patch.
main/gradebook/lib/be/studentpublicationlink.class.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -195,7 +195,7 @@
 block discarded – undo
195 195
         $parentId = !$assignment ? 0 : $assignment->getId();
196 196
 
197 197
         if (empty($session)) {
198
-           $dql = 'SELECT a FROM ChamiloCourseBundle:CStudentPublication a
198
+            $dql = 'SELECT a FROM ChamiloCourseBundle:CStudentPublication a
199 199
                    WHERE
200 200
                         a.cId = :course AND
201 201
                         a.active = :active AND
Please login to merge, or discard this patch.
main/notebook/index.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 
39 39
 // Tool name
40 40
 if ($action === 'addnote') {
41
-	$tool = 'NoteAddNew';
42
-	$interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq(), 'name' => get_lang('ToolNotebook'));
41
+    $tool = 'NoteAddNew';
42
+    $interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq(), 'name' => get_lang('ToolNotebook'));
43 43
 }
44 44
 if ($action === 'editnote') {
45
-	$tool = 'ModifyNote';
46
-	$interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq(), 'name' => get_lang('ToolNotebook'));
45
+    $tool = 'ModifyNote';
46
+    $interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq(), 'name' => get_lang('ToolNotebook'));
47 47
 }
48 48
 
49 49
 // Displaying the header
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         exit;
64 64
     }
65 65
 
66
-	$_SESSION['notebook_view'] = 'creation_date';
66
+    $_SESSION['notebook_view'] = 'creation_date';
67 67
 
68 68
     $form = new FormValidator(
69 69
         'note',
Please login to merge, or discard this patch.
main/lp/learnpath.class.php 4 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6038,8 +6038,8 @@  discard block
 block discarded – undo
6038 6038
             $course_id = api_get_course_int_id();
6039 6039
         }
6040 6040
 
6041
-       $creatorId = empty($creatorId) ? api_get_user_id() : $creatorId;
6042
-       $sessionId = api_get_session_id();
6041
+        $creatorId = empty($creatorId) ? api_get_user_id() : $creatorId;
6042
+        $sessionId = api_get_session_id();
6043 6043
 
6044 6044
         // Generates folder
6045 6045
         $result = $this->generate_lp_folder($courseInfo);
@@ -11114,7 +11114,7 @@  discard block
 block discarded – undo
11114 11114
         $lpItemId = [];
11115 11115
         $typeListNotToVerify = self::getChapterTypes();
11116 11116
 
11117
-	    // Using get_toc() function instead $this->items because returns the correct order of the items
11117
+        // Using get_toc() function instead $this->items because returns the correct order of the items
11118 11118
         foreach ($this->get_toc() as $item) {
11119 11119
             if (!in_array($item['type'], $typeListNotToVerify)) {
11120 11120
                 $lpItemId[] = $item['id'];
Please login to merge, or discard this patch.
Upper-Lower-Casing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
                     ];
217 217
                     $this->lp_view_id = Database::insert($lp_table, $params);
218 218
                     if (!empty($this->lp_view_id)) {
219
-                        $sql = "UPDATE $lp_table SET id = iid WHERE iid = ".$this->lp_view_id;
219
+                        $sql = "update $lp_table SET id = iid WHERE iid = ".$this->lp_view_id;
220 220
                         Database::query($sql);
221 221
                     }
222 222
                 }
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
                                         $insertId = Database::insert($itemViewTable, $params);
380 380
 
381 381
                                         if ($insertId) {
382
-                                            $sql = "UPDATE $itemViewTable SET id = iid
382
+                                            $sql = "update $itemViewTable SET id = iid
383 383
                                                     WHERE iid = $insertId";
384 384
                                             Database::query($sql);
385 385
                                         }
@@ -611,16 +611,16 @@  discard block
 block discarded – undo
611 611
         }
612 612
 
613 613
         if ($new_item_id) {
614
-            $sql = "UPDATE $tbl_lp_item SET id = iid WHERE iid = $new_item_id";
614
+            $sql = "update $tbl_lp_item SET id = iid WHERE iid = $new_item_id";
615 615
             Database::query($sql);
616 616
 
617
-            $sql = "UPDATE $tbl_lp_item
617
+            $sql = "update $tbl_lp_item
618 618
                     SET previous_item_id = $new_item_id 
619 619
                     WHERE c_id = $course_id AND id = $next";
620 620
             Database::query($sql);
621 621
 
622 622
             // Update the item that should be before the new item.
623
-            $sql = "UPDATE $tbl_lp_item
623
+            $sql = "update $tbl_lp_item
624 624
                     SET next_item_id = $new_item_id
625 625
                     WHERE c_id = $course_id AND id = $tmp_previous";
626 626
             Database::query($sql);
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
                 $file = $file_components[count($file_components) - 1];
706 706
 
707 707
                 // Store the mp3 file in the lp_item table.
708
-                $sql = "UPDATE $tbl_lp_item SET
708
+                $sql = "update $tbl_lp_item SET
709 709
                             audio = '".Database::escape_string($file)."'
710 710
                         WHERE id = '" . intval($new_item_id)."'";
711 711
                 Database::query($sql);
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
                 $id = Database::insert($tbl_lp, $params);
853 853
 
854 854
                 if ($id > 0) {
855
-                    $sql = "UPDATE $tbl_lp SET id = iid WHERE iid = $id";
855
+                    $sql = "update $tbl_lp SET id = iid WHERE iid = $id";
856 856
                     Database::query($sql);
857 857
 
858 858
                     // Insert into item_property.
@@ -1201,19 +1201,19 @@  discard block
 block discarded – undo
1201 1201
         }
1202 1202
         Database::query($sql_del);
1203 1203
         // Now update surrounding items.
1204
-        $sql_upd = "UPDATE $lp_item SET next_item_id = $next
1204
+        $sql_upd = "update $lp_item SET next_item_id = $next
1205 1205
                     WHERE c_id = ".$course_id." AND id = $previous";
1206 1206
         Database::query($sql_upd);
1207
-        $sql_upd = "UPDATE $lp_item SET previous_item_id = $previous
1207
+        $sql_upd = "update $lp_item SET previous_item_id = $previous
1208 1208
                     WHERE c_id = ".$course_id." AND id = $next";
1209 1209
         Database::query($sql_upd);
1210 1210
         // Now update all following items with new display order.
1211
-        $sql_all = "UPDATE $lp_item SET display_order = display_order-1
1211
+        $sql_all = "update $lp_item SET display_order = display_order-1
1212 1212
                     WHERE c_id = ".$course_id." AND lp_id = $lp AND parent_item_id = $parent AND display_order > $display";
1213 1213
         Database::query($sql_all);
1214 1214
 
1215 1215
         //Removing prerequisites since the item will not longer exist
1216
-        $sql_all = "UPDATE $lp_item SET prerequisite = '' WHERE c_id = ".$course_id." AND prerequisite = $id";
1216
+        $sql_all = "update $lp_item SET prerequisite = '' WHERE c_id = ".$course_id." AND prerequisite = $id";
1217 1217
         Database::query($sql_all);
1218 1218
 
1219 1219
         // Remove from search engine if enabled.
@@ -1424,7 +1424,7 @@  discard block
 block discarded – undo
1424 1424
 
1425 1425
             // TODO: htmlspecialchars to be checked for encoding related problems.
1426 1426
             // Update the current item with the new data.
1427
-            $sql = "UPDATE $tbl_lp_item
1427
+            $sql = "update $tbl_lp_item
1428 1428
                     SET
1429 1429
                         title = '".Database::escape_string($title)."',
1430 1430
                         description = '" . Database::escape_string($description)."',
@@ -1821,12 +1821,12 @@  discard block
 block discarded – undo
1821 1821
             $index = 0;
1822 1822
             // Loop through all ordered items and stop at the first item that is
1823 1823
             // not a directory *and* that has not been completed yet.
1824
-            while (!empty($this->ordered_items[$index]) AND
1825
-                is_a($this->items[$this->ordered_items[$index]], 'learnpathItem') AND
1824
+            while (!empty($this->ordered_items[$index]) and
1825
+                is_a($this->items[$this->ordered_items[$index]], 'learnpathItem') and
1826 1826
                 (
1827
-                    $this->items[$this->ordered_items[$index]]->get_type() == 'dir' OR
1827
+                    $this->items[$this->ordered_items[$index]]->get_type() == 'dir' or
1828 1828
                     $this->items[$this->ordered_items[$index]]->is_done() === true
1829
-                ) AND $index < $this->max_ordered_items) {
1829
+                ) and $index < $this->max_ordered_items) {
1830 1830
                 $index++;
1831 1831
             }
1832 1832
             $this->last = $this->current;
@@ -2012,7 +2012,7 @@  discard block
 block discarded – undo
2012 2012
         if ($this->debug > 2) {
2013 2013
             error_log('New LP - Now looking at ordered_items['.($index).'] - type is '.$this->items[$this->ordered_items[$index]]->type, 0);
2014 2014
         }
2015
-        while (!empty ($this->ordered_items[$index]) AND ($this->items[$this->ordered_items[$index]]->get_type() == 'dir') AND $index < $this->max_ordered_items) {
2015
+        while (!empty ($this->ordered_items[$index]) and ($this->items[$this->ordered_items[$index]]->get_type() == 'dir') and $index < $this->max_ordered_items) {
2016 2016
             $index++;
2017 2017
             if ($index == $this->max_ordered_items) {
2018 2018
                 if ($this->items[$this->ordered_items[$index]]->get_type() == 'dir') {
@@ -3584,7 +3584,7 @@  discard block
 block discarded – undo
3584 3584
         }
3585 3585
         $search = '';
3586 3586
         // Use $attempt_num to enable multi-views management (disabled so far).
3587
-        if ($attempt_num != 0 AND intval(strval($attempt_num)) == $attempt_num) {
3587
+        if ($attempt_num != 0 and intval(strval($attempt_num)) == $attempt_num) {
3588 3588
             $search = 'AND view_count = '.$attempt_num;
3589 3589
         }
3590 3590
         // When missing $attempt_num, search for a unique lp_view record for this lp and user.
@@ -3613,7 +3613,7 @@  discard block
 block discarded – undo
3613 3613
             $id = Database::insert_id();
3614 3614
             $this->lp_view_id = $id;
3615 3615
 
3616
-            $sql = "UPDATE $lp_view_table SET id = iid WHERE iid = $id";
3616
+            $sql = "update $lp_view_table SET id = iid WHERE iid = $id";
3617 3617
             Database::query($sql);
3618 3618
         }
3619 3619
 
@@ -3751,7 +3751,7 @@  discard block
 block discarded – undo
3751 3751
                     $previous_previous = $row2['previous_item_id'];
3752 3752
                     // Update previous_previous item (switch "next" with current).
3753 3753
                     if ($previous_previous != 0) {
3754
-                        $sql_upd2 = "UPDATE $tbl_lp_item SET
3754
+                        $sql_upd2 = "update $tbl_lp_item SET
3755 3755
                                         next_item_id = $id
3756 3756
                                     WHERE c_id = ".$course_id." AND id = $previous_previous";
3757 3757
                         if ($this->debug > 2) {
@@ -3761,7 +3761,7 @@  discard block
 block discarded – undo
3761 3761
                     }
3762 3762
                     // Update previous item (switch with current).
3763 3763
                     if ($previous != 0) {
3764
-                        $sql_upd2 = "UPDATE $tbl_lp_item SET
3764
+                        $sql_upd2 = "update $tbl_lp_item SET
3765 3765
                                     next_item_id = $next,
3766 3766
                                     previous_item_id = $id,
3767 3767
                                     display_order = display_order +1
@@ -3774,7 +3774,7 @@  discard block
 block discarded – undo
3774 3774
 
3775 3775
                     // Update current item (switch with previous).
3776 3776
                     if ($id != 0) {
3777
-                        $sql_upd2 = "UPDATE $tbl_lp_item SET
3777
+                        $sql_upd2 = "update $tbl_lp_item SET
3778 3778
                                         next_item_id = $previous,
3779 3779
                                         previous_item_id = $previous_previous,
3780 3780
                                         display_order = display_order-1
@@ -3786,7 +3786,7 @@  discard block
 block discarded – undo
3786 3786
                     }
3787 3787
                     // Update next item (new previous item).
3788 3788
                     if ($next != 0) {
3789
-                        $sql_upd2 = "UPDATE $tbl_lp_item SET previous_item_id = $previous
3789
+                        $sql_upd2 = "update $tbl_lp_item SET previous_item_id = $previous
3790 3790
                                      WHERE c_id = ".$course_id." AND id = $next";
3791 3791
                         if ($this->debug > 2) {
3792 3792
                             error_log($sql_upd2, 0);
@@ -3814,13 +3814,13 @@  discard block
 block discarded – undo
3814 3814
                     $next_next = $row2['next_item_id'];
3815 3815
                     // Update previous item (switch with current).
3816 3816
                     if ($previous != 0) {
3817
-                        $sql_upd2 = "UPDATE $tbl_lp_item SET next_item_id = $next
3817
+                        $sql_upd2 = "update $tbl_lp_item SET next_item_id = $next
3818 3818
                                      WHERE c_id = ".$course_id." AND id = $previous";
3819 3819
                         Database::query($sql_upd2);
3820 3820
                     }
3821 3821
                     // Update current item (switch with previous).
3822 3822
                     if ($id != 0) {
3823
-                        $sql_upd2 = "UPDATE $tbl_lp_item SET
3823
+                        $sql_upd2 = "update $tbl_lp_item SET
3824 3824
                                      previous_item_id = $next, next_item_id = $next_next, display_order = display_order+1
3825 3825
                                      WHERE c_id = ".$course_id." AND id = $id";
3826 3826
                         Database::query($sql_upd2);
@@ -3828,7 +3828,7 @@  discard block
 block discarded – undo
3828 3828
 
3829 3829
                     // Update next item (new previous item).
3830 3830
                     if ($next != 0) {
3831
-                        $sql_upd2 = "UPDATE $tbl_lp_item SET
3831
+                        $sql_upd2 = "update $tbl_lp_item SET
3832 3832
                                      previous_item_id = $previous, next_item_id = $id, display_order = display_order-1
3833 3833
                                      WHERE c_id = ".$course_id." AND id = $next";
3834 3834
                         Database::query($sql_upd2);
@@ -3836,7 +3836,7 @@  discard block
 block discarded – undo
3836 3836
 
3837 3837
                     // Update next_next item (switch "previous" with current).
3838 3838
                     if ($next_next != 0) {
3839
-                        $sql_upd2 = "UPDATE $tbl_lp_item SET
3839
+                        $sql_upd2 = "update $tbl_lp_item SET
3840 3840
                                      previous_item_id = $id
3841 3841
                                      WHERE c_id = ".$course_id." AND id = $next_next";
3842 3842
                         Database::query($sql_upd2);
@@ -3884,7 +3884,7 @@  discard block
 block discarded – undo
3884 3884
             $i = 1;
3885 3885
             while ($row = Database::fetch_array($res)) {
3886 3886
                 if ($row['display_order'] != $i) { // If we find a gap in the order, we need to fix it.
3887
-                    $sql = "UPDATE $lp_table SET display_order = $i
3887
+                    $sql = "update $lp_table SET display_order = $i
3888 3888
                             WHERE c_id = $courseId AND id = ".$row['id'];
3889 3889
                     Database::query($sql);
3890 3890
                 }
@@ -3897,10 +3897,10 @@  discard block
 block discarded – undo
3897 3897
         if ($num > 1) { // If there's only one element, no need to sort.
3898 3898
             $order = $lps[$lp_id]['display_order'];
3899 3899
             if ($order > 1) { // If it's the first element, no need to move up.
3900
-                $sql = "UPDATE $lp_table SET display_order = $order
3900
+                $sql = "update $lp_table SET display_order = $order
3901 3901
                         WHERE c_id = $courseId AND id = ".$lp_order[$order - 1];
3902 3902
                 Database::query($sql);
3903
-                $sql = "UPDATE $lp_table SET display_order = ".($order - 1)."
3903
+                $sql = "update $lp_table SET display_order = ".($order - 1)."
3904 3904
                         WHERE c_id = $courseId AND id = ".$lp_id;
3905 3905
                 Database::query($sql);
3906 3906
             }
@@ -3946,7 +3946,7 @@  discard block
 block discarded – undo
3946 3946
                 $max = $i;
3947 3947
                 if ($row['display_order'] != $i) { // If we find a gap in the order, we need to fix it.
3948 3948
                     $need_fix = true;
3949
-                    $sql_u = "UPDATE $lp_table SET display_order = $i
3949
+                    $sql_u = "update $lp_table SET display_order = $i
3950 3950
                               WHERE c_id = ".$courseId." AND id = ".$row['id'];
3951 3951
                     Database::query($sql_u);
3952 3952
                 }
@@ -3959,10 +3959,10 @@  discard block
 block discarded – undo
3959 3959
         if ($num > 1) { // If there's only one element, no need to sort.
3960 3960
             $order = $lps[$lp_id]['display_order'];
3961 3961
             if ($order < $max) { // If it's the first element, no need to move up.
3962
-                $sql_u1 = "UPDATE $lp_table SET display_order = $order
3962
+                $sql_u1 = "update $lp_table SET display_order = $order
3963 3963
                            WHERE c_id = ".$courseId." AND id = ".$lp_order[$order + 1];
3964 3964
                 Database::query($sql_u1);
3965
-                $sql_u2 = "UPDATE $lp_table SET display_order = ".($order + 1)."
3965
+                $sql_u2 = "update $lp_table SET display_order = ".($order + 1)."
3966 3966
                            WHERE c_id = ".$courseId." AND id = ".$lp_id;
3967 3967
                 Database::query($sql_u2);
3968 3968
             }
@@ -4185,11 +4185,11 @@  discard block
 block discarded – undo
4185 4185
                 Database::query($sql);
4186 4186
                 $insertId = Database::insert_id();
4187 4187
                 if ($insertId) {
4188
-                    $sql = "UPDATE $tbl_tool SET id = iid WHERE iid = $insertId";
4188
+                    $sql = "update $tbl_tool SET id = iid WHERE iid = $insertId";
4189 4189
                     Database::query($sql);
4190 4190
                 }
4191 4191
             } elseif ($set_visibility == 'v' && $num > 0) {
4192
-                $sql = "UPDATE $tbl_tool SET
4192
+                $sql = "update $tbl_tool SET
4193 4193
                             c_id = $course_id,
4194 4194
                             name = '$name',
4195 4195
                             link = '$link',
@@ -4245,7 +4245,7 @@  discard block
 block discarded – undo
4245 4245
         $view_id = Database::insert_id();
4246 4246
 
4247 4247
         if ($view_id) {
4248
-            $sql = "UPDATE $lp_view_table SET id = iid WHERE iid = $view_id";
4248
+            $sql = "update $lp_view_table SET id = iid WHERE iid = $view_id";
4249 4249
             Database::query($sql);
4250 4250
             $this->lp_view_id = $view_id;
4251 4251
             $this->attempt = $this->attempt + 1;
@@ -4358,7 +4358,7 @@  discard block
 block discarded – undo
4358 4358
             if ($this->debug > 2) {
4359 4359
                 error_log('New LP - Saving current item ('.$this->current.') for later review', 0);
4360 4360
             }
4361
-            $sql = "UPDATE $table SET
4361
+            $sql = "update $table SET
4362 4362
                         last_item = ".intval($this->get_current_item_id())."
4363 4363
                     WHERE
4364 4364
                         c_id = $course_id AND
@@ -4376,7 +4376,7 @@  discard block
 block discarded – undo
4376 4376
             list($progress,) = $this->get_progress_bar_text('%');
4377 4377
             if ($progress >= 0 && $progress <= 100) {
4378 4378
                 $progress = (int) $progress;
4379
-                $sql = "UPDATE $table SET
4379
+                $sql = "update $table SET
4380 4380
                             progress = $progress
4381 4381
                         WHERE
4382 4382
                             c_id = ".$course_id." AND
@@ -4449,7 +4449,7 @@  discard block
 block discarded – undo
4449 4449
             $lp = $this->get_id();
4450 4450
             if ($lp != 0) {
4451 4451
                 $tbl_lp = Database::get_course_table(TABLE_LP_MAIN);
4452
-                $sql = "UPDATE $tbl_lp SET default_encoding = '$enc' 
4452
+                $sql = "update $tbl_lp SET default_encoding = '$enc' 
4453 4453
                         WHERE c_id = ".$course_id." AND id = ".$lp;
4454 4454
                 $res = Database::query($sql);
4455 4455
                 return $res;
@@ -4474,7 +4474,7 @@  discard block
 block discarded – undo
4474 4474
 
4475 4475
         if ($lp != 0) {
4476 4476
             $tbl_lp = Database::get_course_table(TABLE_LP_MAIN);
4477
-            $sql = "UPDATE $tbl_lp SET js_lib = '$lib' 
4477
+            $sql = "update $tbl_lp SET js_lib = '$lib' 
4478 4478
                     WHERE c_id = ".$course_id." AND id = ".$lp;
4479 4479
             $res = Database::query($sql);
4480 4480
             return $res;
@@ -4499,7 +4499,7 @@  discard block
 block discarded – undo
4499 4499
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
4500 4500
         $course_id = api_get_course_int_id();
4501 4501
         $lp_id = $this->get_id();
4502
-        $sql = "UPDATE $lp_table SET
4502
+        $sql = "update $lp_table SET
4503 4503
                 content_maker = '".Database::escape_string($this->maker)."'
4504 4504
                 WHERE c_id = ".$course_id." AND id = '$lp_id'";
4505 4505
         if ($this->debug > 2) {
@@ -4526,7 +4526,7 @@  discard block
 block discarded – undo
4526 4526
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
4527 4527
         $lp_id = $this->get_id();
4528 4528
         $course_id = $this->course_info['real_id'];
4529
-        $sql = "UPDATE $lp_table SET
4529
+        $sql = "update $lp_table SET
4530 4530
                 name = '".Database::escape_string($this->name)."'
4531 4531
                 WHERE c_id = ".$course_id." AND id = '$lp_id'";
4532 4532
         if ($this->debug > 2) {
@@ -4539,7 +4539,7 @@  discard block
 block discarded – undo
4539 4539
             $session_condition = api_get_session_condition($session_id);
4540 4540
             $tbl_tool = Database::get_course_table(TABLE_TOOL_LIST);
4541 4541
             $link = 'lp/lp_controller.php?action=view&lp_id='.$lp_id.'&id_session='.$session_id;
4542
-            $sql = "UPDATE $tbl_tool SET name = '$this->name'
4542
+            $sql = "update $tbl_tool SET name = '$this->name'
4543 4543
             	    WHERE
4544 4544
             	        c_id = $course_id AND
4545 4545
             	        (link='$link' AND image='scormbuilder.gif' $session_condition)";
@@ -4642,7 +4642,7 @@  discard block
 block discarded – undo
4642 4642
         $this->theme = $name;
4643 4643
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
4644 4644
         $lp_id = $this->get_id();
4645
-        $sql = "UPDATE $lp_table SET theme = '".Database::escape_string($this->theme)."'
4645
+        $sql = "update $lp_table SET theme = '".Database::escape_string($this->theme)."'
4646 4646
                 WHERE c_id = ".$course_id." AND id = '$lp_id'";
4647 4647
         if ($this->debug > 2) {
4648 4648
             error_log('New LP - lp updated with new theme : '.$this->theme, 0);
@@ -4667,7 +4667,7 @@  discard block
 block discarded – undo
4667 4667
         $this->preview_image = $name;
4668 4668
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
4669 4669
         $lp_id = $this->get_id();
4670
-        $sql = "UPDATE $lp_table SET
4670
+        $sql = "update $lp_table SET
4671 4671
                 preview_image = '".Database::escape_string($this->preview_image)."'
4672 4672
                 WHERE c_id = ".$course_id." AND id = '$lp_id'";
4673 4673
         if ($this->debug > 2) {
@@ -4691,7 +4691,7 @@  discard block
 block discarded – undo
4691 4691
         $this->author = $name;
4692 4692
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
4693 4693
         $lp_id = $this->get_id();
4694
-        $sql = "UPDATE $lp_table SET author = '".Database::escape_string($name)."'
4694
+        $sql = "update $lp_table SET author = '".Database::escape_string($name)."'
4695 4695
                 WHERE c_id = ".$course_id." AND id = '$lp_id'";
4696 4696
         if ($this->debug > 2) {
4697 4697
             error_log('New LP - lp updated with new preview author : '.$this->author, 0);
@@ -4716,7 +4716,7 @@  discard block
 block discarded – undo
4716 4716
             $this->hide_toc_frame = $hide;
4717 4717
             $lp_table = Database::get_course_table(TABLE_LP_MAIN);
4718 4718
             $lp_id = $this->get_id();
4719
-            $sql = "UPDATE $lp_table SET
4719
+            $sql = "update $lp_table SET
4720 4720
                     hide_toc_frame = '".(int) $this->hide_toc_frame."'
4721 4721
                     WHERE c_id = ".$course_id." AND id = '$lp_id'";
4722 4722
             if ($this->debug > 2) {
@@ -4744,7 +4744,7 @@  discard block
 block discarded – undo
4744 4744
         $this->prerequisite = intval($prerequisite);
4745 4745
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
4746 4746
         $lp_id = $this->get_id();
4747
-        $sql = "UPDATE $lp_table SET prerequisite = '".$this->prerequisite."'
4747
+        $sql = "update $lp_table SET prerequisite = '".$this->prerequisite."'
4748 4748
                 WHERE c_id = ".$course_id." AND id = '$lp_id'";
4749 4749
         if ($this->debug > 2) {
4750 4750
             error_log('New LP - lp updated with new preview requisite : '.$this->requisite, 0);
@@ -4770,7 +4770,7 @@  discard block
 block discarded – undo
4770 4770
         $this->proximity = $name;
4771 4771
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
4772 4772
         $lp_id = $this->get_id();
4773
-        $sql = "UPDATE $lp_table SET
4773
+        $sql = "update $lp_table SET
4774 4774
                     content_local = '".Database::escape_string($name)."'
4775 4775
                 WHERE c_id = ".$course_id." AND id = '$lp_id'";
4776 4776
         if ($this->debug > 2) {
@@ -4807,7 +4807,7 @@  discard block
 block discarded – undo
4807 4807
         $this->use_max_score = $use_max_score;
4808 4808
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
4809 4809
         $lp_id = $this->get_id();
4810
-        $sql = "UPDATE $lp_table SET
4810
+        $sql = "update $lp_table SET
4811 4811
                     use_max_score = '".$this->use_max_score."'
4812 4812
                 WHERE c_id = ".$course_id." AND id = '$lp_id'";
4813 4813
 
@@ -4900,7 +4900,7 @@  discard block
 block discarded – undo
4900 4900
         $this->modified_on = api_get_utc_datetime();
4901 4901
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
4902 4902
         $lp_id = $this->get_id();
4903
-        $sql = "UPDATE $lp_table SET modified_on = '".$this->modified_on."'
4903
+        $sql = "update $lp_table SET modified_on = '".$this->modified_on."'
4904 4904
                 WHERE c_id = ".$course_id." AND id = '$lp_id'";
4905 4905
         if ($this->debug > 2) {
4906 4906
             error_log('New LP - lp updated with new expired_on : '.$this->modified_on, 0);
@@ -5054,7 +5054,7 @@  discard block
 block discarded – undo
5054 5054
                     $view_mode = 'fullscreen';
5055 5055
                     break;
5056 5056
             }
5057
-            $sql = "UPDATE $lp_table SET default_view_mod = '$view_mode'
5057
+            $sql = "update $lp_table SET default_view_mod = '$view_mode'
5058 5058
                     WHERE c_id = ".$course_id." AND id = ".$this->get_id();
5059 5059
             Database::query($sql);
5060 5060
             $this->mode = $view_mode;
@@ -5092,7 +5092,7 @@  discard block
 block discarded – undo
5092 5092
                 $force = 1;
5093 5093
                 $force_return = true;
5094 5094
             }
5095
-            $sql = "UPDATE $lp_table SET force_commit = $force
5095
+            $sql = "update $lp_table SET force_commit = $force
5096 5096
                     WHERE c_id = ".$course_id." AND id = ".$this->get_id();
5097 5097
             Database::query($sql);
5098 5098
             $this->force_commit = $force_return;
@@ -5129,7 +5129,7 @@  discard block
 block discarded – undo
5129 5129
             while ($row = Database::fetch_array($res)) {
5130 5130
                 if ($row['display_order'] != $i) {
5131 5131
                     // If we find a gap in the order, we need to fix it.
5132
-                    $sql = "UPDATE $lp_table SET display_order = $i
5132
+                    $sql = "update $lp_table SET display_order = $i
5133 5133
                             WHERE c_id = ".$course_id." AND id = ".$row['id'];
5134 5134
                     Database::query($sql);
5135 5135
                 }
@@ -5161,7 +5161,7 @@  discard block
 block discarded – undo
5161 5161
             } elseif ($force == 0) {
5162 5162
                 $force = 1;
5163 5163
             }
5164
-            $sql = "UPDATE $lp_table SET prevent_reinit = $force
5164
+            $sql = "update $lp_table SET prevent_reinit = $force
5165 5165
                     WHERE c_id = ".$course_id." AND id = ".$this->get_id();
5166 5166
             Database::query($sql);
5167 5167
             $this->prevent_reinit = $force;
@@ -5233,7 +5233,7 @@  discard block
 block discarded – undo
5233 5233
         $this->prevent_reinit = $prevent_reinit;
5234 5234
         $this->seriousgame_mode = $sg_mode;
5235 5235
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
5236
-        $sql = "UPDATE $lp_table SET
5236
+        $sql = "update $lp_table SET
5237 5237
                 prevent_reinit = $prevent_reinit ,
5238 5238
                 seriousgame_mode = $sg_mode
5239 5239
                 WHERE c_id = ".$course_id." AND id = ".$this->get_id();
@@ -5298,7 +5298,7 @@  discard block
 block discarded – undo
5298 5298
             } elseif ($force == 0) {
5299 5299
                 $force = 1;
5300 5300
             }
5301
-            $sql = "UPDATE $lp_table SET seriousgame_mode = $force
5301
+            $sql = "update $lp_table SET seriousgame_mode = $force
5302 5302
 			        WHERE c_id = ".$course_id." AND id = ".$this->get_id();
5303 5303
             Database::query($sql);
5304 5304
             $this->seriousgame_mode = $force;
@@ -5333,7 +5333,7 @@  discard block
 block discarded – undo
5333 5333
             } elseif ($force == 0) {
5334 5334
                 $force = 1;
5335 5335
             }
5336
-            $sql = "UPDATE $lp_table SET debug = $force
5336
+            $sql = "update $lp_table SET debug = $force
5337 5337
                     WHERE c_id = ".$course_id." AND id = ".$this->get_id();
5338 5338
             Database::query($sql);
5339 5339
             $this->scorm_debug = $force;
@@ -10294,7 +10294,7 @@  discard block
 block discarded – undo
10294 10294
         </div>
10295 10295
     </body>
10296 10296
 </html>
10297
-EOD;
10297
+eod;
10298 10298
         if (!is_dir($archive_path.$temp_dir_short.'/document')) {
10299 10299
             @mkdir($archive_path.$temp_dir_short.'/document', api_get_permissions_for_new_directories());
10300 10300
         }
@@ -10602,12 +10602,12 @@  discard block
 block discarded – undo
10602 10602
         $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
10603 10603
         $lp_id = $this->get_id();
10604 10604
         //Cleaning prerequisites
10605
-        $sql = "UPDATE $tbl_lp_item SET prerequisite = ''
10605
+        $sql = "update $tbl_lp_item SET prerequisite = ''
10606 10606
                 WHERE c_id = ".$course_id." AND lp_id = '$lp_id'";
10607 10607
         Database::query($sql);
10608 10608
 
10609 10609
         //Cleaning mastery score for exercises
10610
-        $sql = "UPDATE $tbl_lp_item SET mastery_score = ''
10610
+        $sql = "update $tbl_lp_item SET mastery_score = ''
10611 10611
                 WHERE c_id = ".$course_id." AND lp_id = '$lp_id' AND item_type = 'quiz'";
10612 10612
         Database::query($sql);
10613 10613
     }
@@ -10633,12 +10633,12 @@  discard block
 block discarded – undo
10633 10633
                         // Current item is not a folder, so it qualifies to get a prerequisites
10634 10634
                         if ($last_item_not_dir_type == 'quiz') {
10635 10635
                             // if previous is quiz, mark its max score as default score to be achieved
10636
-                            $sql = "UPDATE $tbl_lp_item SET mastery_score = '$last_item_not_dir_max'
10636
+                            $sql = "update $tbl_lp_item SET mastery_score = '$last_item_not_dir_max'
10637 10637
                                     WHERE c_id = ".$course_id." AND lp_id = '$lp_id' AND id = '$last_item_not_dir'";
10638 10638
                             Database::query($sql);
10639 10639
                         }
10640 10640
                         // now simply update the prerequisite to set it to the last non-chapter item
10641
-                        $sql = "UPDATE $tbl_lp_item SET prerequisite = '$last_item_not_dir'
10641
+                        $sql = "update $tbl_lp_item SET prerequisite = '$last_item_not_dir'
10642 10642
                                 WHERE c_id = ".$course_id." AND lp_id = '$lp_id' AND id = '$current_item_id'";
10643 10643
                         Database::query($sql);
10644 10644
                         // record item as 'non-chapter' reference
@@ -10904,7 +10904,7 @@  discard block
 block discarded – undo
10904 10904
         $courseId = api_get_course_int_id();
10905 10905
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
10906 10906
         $lp_id = $this->get_id();
10907
-        $sql = "UPDATE $lp_table SET category_id = ".$this->categoryId."
10907
+        $sql = "update $lp_table SET category_id = ".$this->categoryId."
10908 10908
                 WHERE c_id = $courseId AND id = $lp_id";
10909 10909
         Database::query($sql);
10910 10910
 
@@ -10935,7 +10935,7 @@  discard block
 block discarded – undo
10935 10935
         $this->subscribeUsers = intval($value); ;
10936 10936
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
10937 10937
         $lp_id = $this->get_id();
10938
-        $sql = "UPDATE $lp_table SET subscribe_users = ".$this->subscribeUsers."
10938
+        $sql = "update $lp_table SET subscribe_users = ".$this->subscribeUsers."
10939 10939
                 WHERE c_id = ".$this->course_int_id." AND id = $lp_id";
10940 10940
         Database::query($sql);
10941 10941
 
@@ -11495,7 +11495,7 @@  discard block
 block discarded – undo
11495 11495
         $this->accumulateScormTime = intval($value);
11496 11496
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
11497 11497
         $lp_id = $this->get_id();
11498
-        $sql = "UPDATE $lp_table SET accumulate_scorm_time = ".$this->accumulateScormTime."
11498
+        $sql = "update $lp_table SET accumulate_scorm_time = ".$this->accumulateScormTime."
11499 11499
                 WHERE c_id = ".$this->course_int_id." AND id = $lp_id";
11500 11500
         Database::query($sql);
11501 11501
 
Please login to merge, or discard this patch.
Braces   +78 added lines, -51 removed lines patch added patch discarded remove patch
@@ -3885,7 +3885,8 @@  discard block
 block discarded – undo
3885 3885
         if ($num > 0) {
3886 3886
             $i = 1;
3887 3887
             while ($row = Database::fetch_array($res)) {
3888
-                if ($row['display_order'] != $i) { // If we find a gap in the order, we need to fix it.
3888
+                if ($row['display_order'] != $i) {
3889
+// If we find a gap in the order, we need to fix it.
3889 3890
                     $sql = "UPDATE $lp_table SET display_order = $i
3890 3891
                             WHERE c_id = $courseId AND id = ".$row['id'];
3891 3892
                     Database::query($sql);
@@ -3896,9 +3897,11 @@  discard block
 block discarded – undo
3896 3897
                 $i++;
3897 3898
             }
3898 3899
         }
3899
-        if ($num > 1) { // If there's only one element, no need to sort.
3900
+        if ($num > 1) {
3901
+// If there's only one element, no need to sort.
3900 3902
             $order = $lps[$lp_id]['display_order'];
3901
-            if ($order > 1) { // If it's the first element, no need to move up.
3903
+            if ($order > 1) {
3904
+// If it's the first element, no need to move up.
3902 3905
                 $sql = "UPDATE $lp_table SET display_order = $order
3903 3906
                         WHERE c_id = $courseId AND id = ".$lp_order[$order - 1];
3904 3907
                 Database::query($sql);
@@ -3946,7 +3949,8 @@  discard block
 block discarded – undo
3946 3949
             $i = 1;
3947 3950
             while ($row = Database::fetch_array($res)) {
3948 3951
                 $max = $i;
3949
-                if ($row['display_order'] != $i) { // If we find a gap in the order, we need to fix it.
3952
+                if ($row['display_order'] != $i) {
3953
+// If we find a gap in the order, we need to fix it.
3950 3954
                     $need_fix = true;
3951 3955
                     $sql_u = "UPDATE $lp_table SET display_order = $i
3952 3956
                               WHERE c_id = ".$courseId." AND id = ".$row['id'];
@@ -3958,9 +3962,11 @@  discard block
 block discarded – undo
3958 3962
                 $i++;
3959 3963
             }
3960 3964
         }
3961
-        if ($num > 1) { // If there's only one element, no need to sort.
3965
+        if ($num > 1) {
3966
+// If there's only one element, no need to sort.
3962 3967
             $order = $lps[$lp_id]['display_order'];
3963
-            if ($order < $max) { // If it's the first element, no need to move up.
3968
+            if ($order < $max) {
3969
+// If it's the first element, no need to move up.
3964 3970
                 $sql_u1 = "UPDATE $lp_table SET display_order = $order
3965 3971
                            WHERE c_id = ".$courseId." AND id = ".$lp_order[$order + 1];
3966 3972
                 Database::query($sql_u1);
@@ -4367,8 +4373,7 @@  discard block
 block discarded – undo
4367 4373
     public static function categoryIsVisibleForStudent(
4368 4374
         CLpCategory $category,
4369 4375
         User $user
4370
-    )
4371
-    {
4376
+    ) {
4372 4377
         $isAllowedToEdit = api_is_allowed_to_edit(null, true);
4373 4378
 
4374 4379
         if ($isAllowedToEdit) {
@@ -4397,8 +4402,7 @@  discard block
 block discarded – undo
4397 4402
     public static function categoryIsPusblished(
4398 4403
         CLpCategory $category,
4399 4404
         $courseId
4400
-    )
4401
-    {
4405
+    ) {
4402 4406
         $link = self::getCategoryLinkForTool($category->getId());
4403 4407
         $em = Database::getManager();
4404 4408
 
@@ -4701,8 +4705,9 @@  discard block
 block discarded – undo
4701 4705
         if ($this->debug > 0) {
4702 4706
             error_log('New LP - In learnpath::set_maker()', 0);
4703 4707
         }
4704
-        if (empty ($name))
4705
-            return false;
4708
+        if (empty ($name)) {
4709
+                    return false;
4710
+        }
4706 4711
         $this->maker = $name;
4707 4712
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
4708 4713
         $course_id = api_get_course_int_id();
@@ -4767,8 +4772,9 @@  discard block
 block discarded – undo
4767 4772
     public function set_terms_by_prefix($terms_string, $prefix)
4768 4773
     {
4769 4774
         $course_id = api_get_course_int_id();
4770
-        if (api_get_setting('search_enabled') !== 'true')
4771
-            return false;
4775
+        if (api_get_setting('search_enabled') !== 'true') {
4776
+                    return false;
4777
+        }
4772 4778
 
4773 4779
         if (!extension_loaded('xapian')) {
4774 4780
             return false;
@@ -4781,8 +4787,9 @@  discard block
 block discarded – undo
4781 4787
         $stored_terms = $this->get_common_index_terms_by_prefix($prefix);
4782 4788
 
4783 4789
         // Don't do anything if no change, verify only at DB, not the search engine.
4784
-        if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0))
4785
-            return false;
4790
+        if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) {
4791
+                    return false;
4792
+        }
4786 4793
 
4787 4794
         require_once 'xapian.php'; // TODO: Try catch every xapian use or make wrappers on API.
4788 4795
         require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
@@ -4972,8 +4979,9 @@  discard block
 block discarded – undo
4972 4979
         if ($this->debug > 0) {
4973 4980
             error_log('New LP - In learnpath::set_proximity()', 0);
4974 4981
         }
4975
-        if (empty ($name))
4976
-            return false;
4982
+        if (empty ($name)) {
4983
+                    return false;
4984
+        }
4977 4985
 
4978 4986
         $this->proximity = $name;
4979 4987
         $lp_table = Database::get_course_table(TABLE_LP_MAIN);
@@ -6482,10 +6490,12 @@  discard block
 block discarded – undo
6482 6490
                     if ($new_comment || $new_title) {
6483 6491
                         $tbl_doc = Database::get_course_table(TABLE_DOCUMENT);
6484 6492
                         $ct = '';
6485
-                        if ($new_comment)
6486
-                            $ct .= ", comment='".Database::escape_string($new_comment)."'";
6487
-                        if ($new_title)
6488
-                            $ct .= ", title='".Database::escape_string($new_title)."' ";
6493
+                        if ($new_comment) {
6494
+                                                    $ct .= ", comment='".Database::escape_string($new_comment)."'";
6495
+                        }
6496
+                        if ($new_title) {
6497
+                                                    $ct .= ", title='".Database::escape_string($new_title)."' ";
6498
+                        }
6489 6499
 
6490 6500
                         $sql = "UPDATE ".$tbl_doc." SET ".substr($ct, 1)."
6491 6501
                                WHERE c_id = ".$course_id." AND id = ".$document_id;
@@ -7183,8 +7193,9 @@  discard block
 block discarded – undo
7183 7193
                         $arrHide[] = $arrLP[$i]['id'];
7184 7194
                     }
7185 7195
                 } else {
7186
-                    if ($arrLP[$i]['item_type'] == 'dir')
7187
-                        $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>';
7196
+                    if ($arrLP[$i]['item_type'] == 'dir') {
7197
+                                            $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>';
7198
+                    }
7188 7199
                 }
7189 7200
             }
7190 7201
             reset($arrLP);
@@ -7201,11 +7212,13 @@  discard block
 block discarded – undo
7201 7212
 
7202 7213
         for ($i = 0; $i < count($arrLP); $i++) {
7203 7214
             if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) {
7204
-                if ($extra_info['previous_item_id'] == $arrLP[$i]['id'])
7215
+                if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) {
7216
+                                    $selected = 'selected="selected" ';
7217
+                } elseif ($action == 'add') {
7205 7218
                     $selected = 'selected="selected" ';
7206
-                elseif ($action == 'add') $selected = 'selected="selected" ';
7207
-                else
7208
-                    $selected = '';
7219
+                } else {
7220
+                                    $selected = '';
7221
+                }
7209 7222
 
7210 7223
                 $return .= '<option '.$selected.'value="'.$arrLP[$i]['id'].'">'.get_lang('After').' "'.$arrLP[$i]['title'].'"</option>';
7211 7224
             }
@@ -7232,9 +7245,11 @@  discard block
 block discarded – undo
7232 7245
                 $arrHide = array();
7233 7246
                 for ($i = 0; $i < count($arrLP); $i++) {
7234 7247
                     if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') {
7235
-                        if ($extra_info['previous_item_id'] == $arrLP[$i]['id'])
7236
-                            $s_selected_position = $arrLP[$i]['id'];
7237
-                        elseif ($action == 'add') $s_selected_position = 0;
7248
+                        if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) {
7249
+                                                    $s_selected_position = $arrLP[$i]['id'];
7250
+                        } elseif ($action == 'add') {
7251
+                            $s_selected_position = 0;
7252
+                        }
7238 7253
                         $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title'];
7239 7254
                     }
7240 7255
                 }
@@ -7438,9 +7453,11 @@  discard block
 block discarded – undo
7438 7453
             $arrHide = array();
7439 7454
             for ($i = 0; $i < count($arrLP); $i++) {
7440 7455
                 if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') {
7441
-                    if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id'])
7442
-                        $s_selected_position = $arrLP[$i]['id'];
7443
-                    elseif ($action == 'add') $s_selected_position = 0;
7456
+                    if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) {
7457
+                                            $s_selected_position = $arrLP[$i]['id'];
7458
+                    } elseif ($action == 'add') {
7459
+                        $s_selected_position = 0;
7460
+                    }
7444 7461
                     $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title'];
7445 7462
                 }
7446 7463
             }
@@ -7637,9 +7654,11 @@  discard block
 block discarded – undo
7637 7654
 
7638 7655
             for ($i = 0; $i < count($arrLP); $i++) {
7639 7656
                 if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') {
7640
-                    if ($extra_info['previous_item_id'] == $arrLP[$i]['id'])
7641
-                        $s_selected_position = $arrLP[$i]['id'];
7642
-                    elseif ($action == 'add') $s_selected_position = 0;
7657
+                    if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) {
7658
+                                            $s_selected_position = $arrLP[$i]['id'];
7659
+                    } elseif ($action == 'add') {
7660
+                        $s_selected_position = 0;
7661
+                    }
7643 7662
                     $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title'];
7644 7663
 
7645 7664
                 }
@@ -7673,8 +7692,7 @@  discard block
 block discarded – undo
7673 7692
 
7674 7693
         if (is_numeric($extra_info)) {
7675 7694
             $form->addHidden('path', $extra_info);
7676
-        }
7677
-        elseif (is_array($extra_info)) {
7695
+        } elseif (is_array($extra_info)) {
7678 7696
             $form->addHidden('path', $extra_info['path']);
7679 7697
         }
7680 7698
 
@@ -8195,9 +8213,11 @@  discard block
 block discarded – undo
8195 8213
             $arrHide = array();
8196 8214
             for ($i = 0; $i < count($arrLP); $i++) {
8197 8215
                 if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir' && $arrLP[$i]['item_type'] !== TOOL_LP_FINAL_ITEM) {
8198
-                    if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id'])
8216
+                    if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) {
8217
+                                            $s_selected_position = $arrLP[$i]['id'];
8218
+                    } elseif ($action == 'add') {
8199 8219
                         $s_selected_position = $arrLP[$i]['id'];
8200
-                    elseif ($action == 'add') $s_selected_position = $arrLP[$i]['id'];
8220
+                    }
8201 8221
 
8202 8222
                     $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title'];
8203 8223
 
@@ -8496,9 +8516,11 @@  discard block
 block discarded – undo
8496 8516
             $arrHide = array();
8497 8517
             for ($i = 0; $i < count($arrLP); $i++) {
8498 8518
                 if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') {
8499
-                    if ($extra_info['previous_item_id'] == $arrLP[$i]['id'])
8500
-                        $s_selected_position = $arrLP[$i]['id'];
8501
-                    elseif ($action == 'add') $s_selected_position = 0;
8519
+                    if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) {
8520
+                                            $s_selected_position = $arrLP[$i]['id'];
8521
+                    } elseif ($action == 'add') {
8522
+                        $s_selected_position = 0;
8523
+                    }
8502 8524
                     $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title'];
8503 8525
 
8504 8526
                 }
@@ -8692,9 +8714,11 @@  discard block
 block discarded – undo
8692 8714
             $arrHide = array();
8693 8715
             for ($i = 0; $i < count($arrLP); $i++) {
8694 8716
                 if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') {
8695
-                    if ($extra_info['previous_item_id'] == $arrLP[$i]['id'])
8696
-                        $s_selected_position = $arrLP[$i]['id'];
8697
-                    elseif ($action == 'add') $s_selected_position = 0;
8717
+                    if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) {
8718
+                                            $s_selected_position = $arrLP[$i]['id'];
8719
+                    } elseif ($action == 'add') {
8720
+                        $s_selected_position = 0;
8721
+                    }
8698 8722
                     $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title'];
8699 8723
 
8700 8724
                 }
@@ -9844,10 +9868,11 @@  discard block
 block discarded – undo
9844 9868
 
9845 9869
                 // Dependency to other files - not yet supported.
9846 9870
                 $i = 1;
9847
-                if ($inc_docs)
9848
-                foreach ($inc_docs as $doc_info) {
9871
+                if ($inc_docs) {
9872
+                                foreach ($inc_docs as $doc_info) {
9849 9873
                     if (count($doc_info) < 1 || empty($doc_info[0])) {
9850 9874
                         continue;
9875
+                }
9851 9876
                     }
9852 9877
                     $my_dep = $xmldoc->createElement('resource');
9853 9878
                     $res_id = 'RESOURCE_'.$item->get_id().'_'.$i;
@@ -10281,7 +10306,8 @@  discard block
 block discarded – undo
10281 10306
 
10282 10307
                                                 // File path is courses/CHAMILO/document/....
10283 10308
                                                 $info_file_path = explode('/', $file_path);
10284
-                                                if ($info_file_path[0] == 'courses') { // Add character "/" in file path.
10309
+                                                if ($info_file_path[0] == 'courses') {
10310
+// Add character "/" in file path.
10285 10311
                                                     $file_path_dest = 'document/'.$file_path;
10286 10312
                                                 }
10287 10313
 
@@ -11994,7 +12020,8 @@  discard block
 block discarded – undo
11994 12020
 }
11995 12021
 
11996 12022
 if (!function_exists('trim_value')) {
11997
-    function trim_value(& $value) {
12023
+    function trim_value(& $value)
12024
+    {
11998 12025
         $value = trim($value);
11999 12026
     }
12000 12027
 }
Please login to merge, or discard this patch.
Doc Comments   +23 added lines, -19 removed lines patch added patch discarded remove patch
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
      * @param int $max_time_allowed
479 479
      * @param int $userId
480 480
      *
481
-     * @return int
481
+     * @return false|string
482 482
      */
483 483
     public function add_item(
484 484
         $parent,
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
      * @param	array $courseInfo
1027 1027
      * @param	integer	Learnpath ID
1028 1028
      * @param	string	Whether to delete data or keep it (default: 'keep', others: 'remove')
1029
-     * @return	boolean	True on success, false on failure (might change that to return number of elements deleted)
1029
+     * @return	false|null	True on success, false on failure (might change that to return number of elements deleted)
1030 1030
      */
1031 1031
     public function delete($courseInfo = null, $id = null, $delete = 'keep')
1032 1032
     {
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
      * @param    integer $id Elem ID (0 if first)
1167 1167
      * @param    integer $remove Whether to remove the resource/data from the
1168 1168
      * system or leave it (default: 'keep', others 'remove')
1169
-     * @return    integer    Number of elements moved
1169
+     * @return    false|null    Number of elements moved
1170 1170
      * @todo implement resource removal
1171 1171
      */
1172 1172
     public function delete_item($id, $remove = 'keep')
@@ -1248,7 +1248,7 @@  discard block
 block discarded – undo
1248 1248
      * @param   array   $audio The array resulting of the $_FILES[mp3] element
1249 1249
      * @param   int     $max_time_allowed
1250 1250
      * @param   string  $url
1251
-     * @return  boolean True on success, false on error
1251
+     * @return  false|null True on success, false on error
1252 1252
      */
1253 1253
     public function edit_item(
1254 1254
         $id,
@@ -1769,7 +1769,7 @@  discard block
 block discarded – undo
1769 1769
 
1770 1770
     /**
1771 1771
      * Gets the first element URL.
1772
-     * @return    string    URL to load into the viewer
1772
+     * @return    false|null    URL to load into the viewer
1773 1773
      */
1774 1774
     public function first()
1775 1775
     {
@@ -2276,6 +2276,7 @@  discard block
 block discarded – undo
2276 2276
      * @param int $studentId
2277 2277
      * @param int $prerequisite
2278 2278
      * @param array $courseInfo
2279
+     * @param integer $sessionId
2279 2280
      * @return bool
2280 2281
      *
2281 2282
      */
@@ -2310,6 +2311,7 @@  discard block
 block discarded – undo
2310 2311
      * @param int $student_id
2311 2312
      * @param string Course code (optional)
2312 2313
      * @param int $sessionId
2314
+     * @param string $courseCode
2313 2315
      * @return	bool
2314 2316
      */
2315 2317
     public static function is_lp_visible_for_student(
@@ -2638,7 +2640,7 @@  discard block
 block discarded – undo
2638 2640
     /**
2639 2641
      * @param string $size
2640 2642
      * @param string $path_type
2641
-     * @return bool|string
2643
+     * @return string|false
2642 2644
      */
2643 2645
     public function get_preview_image_path($size = null, $path_type = 'web')
2644 2646
     {
@@ -2785,6 +2787,8 @@  discard block
 block discarded – undo
2785 2787
      * Returns the XML DOM document's node
2786 2788
      * @param	resource	Reference to a list of objects to search for the given ITEM_*
2787 2789
      * @param	string		The identifier to look for
2790
+     * @param DOMNodeList $children
2791
+     * @param string $id
2788 2792
      * @return	mixed		The reference to the element found with that identifier. False if not found
2789 2793
      */
2790 2794
     public function get_scorm_xml_node(& $children, $id)
@@ -2970,7 +2974,7 @@  discard block
 block discarded – undo
2970 2974
     /**
2971 2975
      * Generate and return the table of contents for this learnpath. The (flat) table returned can be
2972 2976
      * used by get_html_toc() to be ready to display
2973
-     * @return	array	TOC as a table with 4 elements per row: title, link, status and level
2977
+     * @return	boolean	TOC as a table with 4 elements per row: title, link, status and level
2974 2978
      */
2975 2979
     public function get_toc()
2976 2980
     {
@@ -3106,7 +3110,7 @@  discard block
 block discarded – undo
3106 3110
     }
3107 3111
 
3108 3112
     /**
3109
-     * @return array
3113
+     * @return string[]
3110 3114
      */
3111 3115
     public static function getChapterTypes()
3112 3116
     {
@@ -4006,7 +4010,7 @@  discard block
 block discarded – undo
4006 4010
      * Open a resource = initialise all local variables relative to this resource. Depending on the child
4007 4011
      * class, this might be redefined to allow several behaviours depending on the document type.
4008 4012
      * @param integer Resource ID
4009
-     * @return boolean True on success, false otherwise
4013
+     * @return boolean|null True on success, false otherwise
4010 4014
      */
4011 4015
     public function open($id)
4012 4016
     {
@@ -4169,7 +4173,7 @@  discard block
 block discarded – undo
4169 4173
      * Can be used as abstract
4170 4174
      * @param	integer	$lp_id Learnpath id
4171 4175
      * @param	string	$set_visibility New visibility (v/i - visible/invisible)
4172
-     * @return bool
4176
+     * @return null|false
4173 4177
      */
4174 4178
     public static function toggle_publish($lp_id, $set_visibility = 'v')
4175 4179
     {
@@ -4431,7 +4435,7 @@  discard block
 block discarded – undo
4431 4435
      * Make sure the results are saved with anoter method. This method should probably be
4432 4436
      * redefined in children classes.
4433 4437
      * To use a similar method  statically, use the create_new_attempt() method
4434
-     * @return string URL to load in the viewer
4438
+     * @return boolean URL to load in the viewer
4435 4439
      */
4436 4440
     public function restart()
4437 4441
     {
@@ -5005,7 +5009,7 @@  discard block
 block discarded – undo
5005 5009
 
5006 5010
     /**
5007 5011
      * Sets use_max_score
5008
-     * @param   string  $use_max_score Optional string giving the new location of this learnpath
5012
+     * @param   integer  $use_max_score Optional string giving the new location of this learnpath
5009 5013
      * @return  boolean True on success / False on error
5010 5014
      */
5011 5015
     public function set_use_max_score($use_max_score = 1)
@@ -5417,6 +5421,7 @@  discard block
 block discarded – undo
5417 5421
      * Register the attempt mode into db thanks to flags prevent_reinit and seriousgame_mode flags
5418 5422
      *
5419 5423
      * @param string 'seriousgame', 'single' or 'multiple'
5424
+     * @param string $mode
5420 5425
      * @return boolean
5421 5426
      * @author ndiechburg <[email protected]>
5422 5427
      **/
@@ -5459,7 +5464,7 @@  discard block
 block discarded – undo
5459 5464
     /**
5460 5465
      * Switch between multiple attempt, single attempt or serious_game mode (only for scorm)
5461 5466
      *
5462
-     * @return boolean
5467
+     * @return boolean|null
5463 5468
      * @author ndiechburg <[email protected]>
5464 5469
      **/
5465 5470
     public function switch_attempt_mode()
@@ -6784,7 +6789,7 @@  discard block
 block discarded – undo
6784 6789
     /**
6785 6790
      * Function that displays a list with al the resources that
6786 6791
      * could be added to the learning path
6787
-     * @return string
6792
+     * @return boolean
6788 6793
      */
6789 6794
     public function display_resources()
6790 6795
     {
@@ -10540,7 +10545,7 @@  discard block
 block discarded – undo
10540 10545
 
10541 10546
     /**
10542 10547
      * @param int $lp_id
10543
-     * @return bool
10548
+     * @return false|null
10544 10549
      */
10545 10550
     public function scorm_export_to_pdf($lp_id)
10546 10551
     {
@@ -11088,7 +11093,7 @@  discard block
 block discarded – undo
11088 11093
 
11089 11094
     /**
11090 11095
      * @param int $itemId
11091
-     * @return learnpathItem|false
11096
+     * @return string
11092 11097
      */
11093 11098
     public function getItem($itemId)
11094 11099
     {
@@ -11137,7 +11142,6 @@  discard block
 block discarded – undo
11137 11142
     /**
11138 11143
      * Set whether this is a learning path with the possibility to subscribe
11139 11144
      * users or not
11140
-     * @param int $subscribeUsers (0 = false, 1 = true)
11141 11145
      * @return bool
11142 11146
      */
11143 11147
     public function setSubscribeUsers($value)
@@ -11263,7 +11267,7 @@  discard block
 block discarded – undo
11263 11267
 
11264 11268
     /**
11265 11269
      * Get the item of exercise type (evaluation type)
11266
-     * @return array The final evaluation. Otherwise return false
11270
+     * @return integer The final evaluation. Otherwise return false
11267 11271
      */
11268 11272
     public function getFinalEvaluationItem()
11269 11273
     {
@@ -11480,7 +11484,7 @@  discard block
 block discarded – undo
11480 11484
     /**
11481 11485
      * Create a forum for this learning path
11482 11486
      * @param type $forumCategoryId
11483
-     * @return int The forum ID if was created. Otherwise return false
11487
+     * @return false|string The forum ID if was created. Otherwise return false
11484 11488
      */
11485 11489
     public function createForum($forumCategoryId)
11486 11490
     {
Please login to merge, or discard this patch.
main/dropbox/dropbox_init.inc.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
             $javascript .= "'".$dropbox_person->sentWork[$i]->title."'";
217 217
         }
218 218
     }
219
-	$javascript .= ");
219
+    $javascript .= ");
220 220
 
221 221
 		function checkfile(str)
222 222
 		{
@@ -326,15 +326,15 @@  discard block
 block discarded – undo
326 326
         'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?'.api_get_cidreq(),
327 327
         'name' => get_lang('Dropbox', ''),
328 328
     );
329
-	$nameTools = get_lang('ReceivedFiles');
329
+    $nameTools = get_lang('ReceivedFiles');
330 330
 
331
-	if ($action == 'addreceivedcategory') {
331
+    if ($action == 'addreceivedcategory') {
332 332
         $interbreadcrumb[] = array(
333 333
             'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?view=received&'.api_get_cidreq(),
334 334
             'name' => get_lang('ReceivedFiles'),
335 335
         );
336
-		$nameTools = get_lang('AddNewCategory');
337
-	}
336
+        $nameTools = get_lang('AddNewCategory');
337
+    }
338 338
 }
339 339
 
340 340
 if ($view == 'sent' || empty($view)) {
Please login to merge, or discard this patch.