Passed
Push — 1.10.x ( 93cae2...c1f149 )
by
unknown
53:44
created
main/announcements/announcements.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 $ctok = Security::get_existing_token();
25 25
 $stok = Security::get_token();
26 26
 
27
-$current_course_tool  = TOOL_ANNOUNCEMENT;
27
+$current_course_tool = TOOL_ANNOUNCEMENT;
28 28
 $this_section = SECTION_COURSES;
29 29
 $nameTools = get_lang('ToolAnnouncement');
30 30
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         if (!empty($sortDirection)) {
84 84
             if (!in_array(trim(strtoupper($sortDirection)), array('ASC', 'DESC'))) {
85
-                $sortDirection='ASC';
85
+                $sortDirection = 'ASC';
86 86
             }
87 87
 
88 88
             $announcementInfo = AnnouncementManager::get_by_id($course_id, $thisAnnouncementId);
@@ -207,12 +207,12 @@  discard block
 block discarded – undo
207 207
                 (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath')
208 208
             ) {
209 209
                 $html .= '<div id="no-data-view">';
210
-                $html .= '<h3>' . get_lang('Announcements') . '</h3>';
210
+                $html .= '<h3>'.get_lang('Announcements').'</h3>';
211 211
                 $html .= Display::return_icon('valves.png', '', array(), 64);
212 212
                 $html .= '<div class="controls">';
213 213
                 $html .= Display::url(
214 214
                     get_lang('AddAnnouncement'),
215
-                    api_get_self() . "?" . api_get_cidreq() . "&action=add",
215
+                    api_get_self()."?".api_get_cidreq()."&action=add",
216 216
                     array('class' => 'btn btn-primary')
217 217
                 );
218 218
                 $html .= '</div>';
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     case 'delete':
229 229
         /* Delete announcement */
230 230
         $id = intval($_GET['id']);
231
-        if (api_get_session_id()!=0 && api_is_allowed_to_session_edit(false, true) == false) {
231
+        if (api_get_session_id() != 0 && api_is_allowed_to_session_edit(false, true) == false) {
232 232
             api_not_allowed();
233 233
         }
234 234
 
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 
294 294
         // DISPLAY ADD ANNOUNCEMENT COMMAND
295 295
         $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
296
-        $url = api_get_self().'?action='.$action.'&id=' . $id . '&' . api_get_cidreq();
296
+        $url = api_get_self().'?action='.$action.'&id='.$id.'&'.api_get_cidreq();
297 297
 
298 298
         $form = new FormValidator(
299 299
             'f1',
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
                 );
335 335
                 // setting the variables for the form elements: the users who need to receive the message
336 336
                 foreach ($to as &$user) {
337
-                    $user = 'USER:' . $user;
337
+                    $user = 'USER:'.$user;
338 338
                 }
339 339
                 // setting the variables for the form elements: the message has to be sent by email
340 340
                 $email_ann = '1';
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
                         $insert_id = AnnouncementManager::add_group_announcement(
498 498
                             $data['title'],
499 499
                             $data['content'],
500
-                            array('GROUP:' . $group_id),
500
+                            array('GROUP:'.$group_id),
501 501
                             $data['users'],
502 502
                             $file,
503 503
                             $file_comment,
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
     (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath')
563 563
 ) {
564 564
     echo '<div class="actions">';
565
-    if (in_array($action, array('add', 'modify','view'))) {
565
+    if (in_array($action, array('add', 'modify', 'view'))) {
566 566
         echo "<a href='".api_get_self()."?".api_get_cidreq()."&origin=".$origin."'>".
567 567
             Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM)."</a>";
568 568
     } else {
@@ -580,12 +580,12 @@  discard block
 block discarded – undo
580 580
 }
581 581
 
582 582
 if (api_is_allowed_to_edit() && $announcement_number > 1) {
583
-    if (api_get_group_id() == 0 ) {
583
+    if (api_get_group_id() == 0) {
584 584
         if (!$show_actions)
585 585
             echo '<div class="actions">';
586 586
         if (!isset($_GET['action'])) {
587 587
             echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete_all\" onclick=\"javascript:if(!confirm('".get_lang("ConfirmYourChoice")."')) return false;\">".
588
-                Display::return_icon('delete_announce.png',get_lang('AnnouncementDeleteAll'),'',ICON_SIZE_MEDIUM)."</a>";
588
+                Display::return_icon('delete_announce.png', get_lang('AnnouncementDeleteAll'), '', ICON_SIZE_MEDIUM)."</a>";
589 589
         }
590 590
     }
591 591
 }
Please login to merge, or discard this patch.
main/inc/lib/AnnouncementManager.php 1 patch
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
                             announcement.id = '$announcement_id' AND
217 217
                             toolitemproperties.tool='announcement' AND
218 218
                             (
219
-                                toolitemproperties.to_user_id='" . api_get_user_id() . "' OR
220
-                                toolitemproperties.to_group_id IN ('0', '" . implode("', '", $group_list) . "') OR
219
+                                toolitemproperties.to_user_id='".api_get_user_id()."' OR
220
+                                toolitemproperties.to_group_id IN ('0', '" . implode("', '", $group_list)."') OR
221 221
                                 toolitemproperties.to_group_id IS NULL
222 222
                             ) AND
223 223
                             toolitemproperties.visibility='1' AND
@@ -246,13 +246,13 @@  discard block
 block discarded – undo
246 246
             $title = $result['title'];
247 247
             $content = $result['content'];
248 248
             $html .= "<table height=\"100\" width=\"100%\" cellpadding=\"5\" cellspacing=\"0\" class=\"data_table\">";
249
-            $html .= "<tr><td><h2>" . $title . "</h2></td></tr>";
249
+            $html .= "<tr><td><h2>".$title."</h2></td></tr>";
250 250
 
251 251
             if (api_is_allowed_to_edit(false, true) ||
252 252
                 (api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous())
253 253
             ) {
254
-                $modify_icons = "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&action=modify&id=" . $announcement_id . "\">" .
255
-                    Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a>";
254
+                $modify_icons = "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=modify&id=".$announcement_id."\">".
255
+                    Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>";
256 256
                 if ($result['visibility'] == 1) {
257 257
                     $image_visibility = "visible";
258 258
                     $alt_visibility = get_lang('Hide');
@@ -262,12 +262,12 @@  discard block
 block discarded – undo
262 262
                 }
263 263
                 global $stok;
264 264
 
265
-                $modify_icons .= "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&origin=" . (!empty($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '') . "&action=showhide&id=" . $announcement_id . "&sec_token=" . $stok . "\">" .
266
-                    Display::return_icon($image_visibility . '.png', $alt_visibility, '', ICON_SIZE_SMALL) . "</a>";
265
+                $modify_icons .= "<a href=\"".api_get_self()."?".api_get_cidreq()."&origin=".(!empty($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '')."&action=showhide&id=".$announcement_id."&sec_token=".$stok."\">".
266
+                    Display::return_icon($image_visibility.'.png', $alt_visibility, '', ICON_SIZE_SMALL)."</a>";
267 267
 
268 268
                 if (api_is_allowed_to_edit(false, true)) {
269
-                    $modify_icons .= "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&action=delete&id=" . $announcement_id . "&sec_token=" . $stok . "\" onclick=\"javascript:if(!confirm('" . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)) . "')) return false;\">" .
270
-                        Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) .
269
+                    $modify_icons .= "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete&id=".$announcement_id."&sec_token=".$stok."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset))."')) return false;\">".
270
+                        Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).
271 271
                         "</a>";
272 272
                 }
273 273
                 $html .= "<tr><th style='text-align:right'>$modify_icons</th></tr>";
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
             $content = self::parse_content($result['to_user_id'], $content, api_get_course_id(), api_get_session_id());
277 277
 
278 278
             $html .= "<tr><td>$content</td></tr>";
279
-            $html .= "<tr><td class=\"announcements_datum\">" . get_lang('LastUpdateDate') . " : " . api_convert_and_format_date($result['insert_date'], DATE_TIME_FORMAT_LONG) . "</td></tr>";
279
+            $html .= "<tr><td class=\"announcements_datum\">".get_lang('LastUpdateDate')." : ".api_convert_and_format_date($result['insert_date'], DATE_TIME_FORMAT_LONG)."</td></tr>";
280 280
 
281 281
             // User or group icon
282 282
             $sent_to_icon = '';
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
                 $sent_to_form = self::sent_to_form($sent_to);
289 289
                 $html .= Display::tag(
290 290
                     'td',
291
-                    get_lang('SentTo') . ' : ' . $sent_to_form,
291
+                    get_lang('SentTo').' : '.$sent_to_form,
292 292
                     array('class' => 'announcements_datum')
293 293
                 );
294 294
             }
@@ -298,15 +298,15 @@  discard block
 block discarded – undo
298 298
                 $html .= "<tr><td>";
299 299
                 $realname = $attachment_list['path'];
300 300
                 $user_filename = $attachment_list['filename'];
301
-                $full_file_name = 'download.php?'.api_get_cidreq().'&file=' . $realname;
301
+                $full_file_name = 'download.php?'.api_get_cidreq().'&file='.$realname;
302 302
                 $html .= '<br/>';
303 303
                 $html .= Display::return_icon('attachment.gif', get_lang('Attachment'));
304
-                $html .= '<a href="' . $full_file_name . ' "> ' . $user_filename . ' </a>';
305
-                $html .= ' - <span class="forum_attach_comment" >' . $attachment_list['comment'] . '</span>';
304
+                $html .= '<a href="'.$full_file_name.' "> '.$user_filename.' </a>';
305
+                $html .= ' - <span class="forum_attach_comment" >'.$attachment_list['comment'].'</span>';
306 306
                 if (api_is_allowed_to_edit(false, true)) {
307 307
                     $html .= Display::url(
308 308
                         Display::return_icon('delete.png', get_lang('Delete'), '', 16),
309
-                        api_get_self() . "?" . api_get_cidreq() . "&action=delete_attachment&id_attach=" . $attachment_list['id'] . "&sec_token=" . $stok
309
+                        api_get_self()."?".api_get_cidreq()."&action=delete_attachment&id_attach=".$attachment_list['id']."&sec_token=".$stok
310 310
                     );
311 311
                 }
312 312
                 $html .= '</td></tr>';
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
         $order = 0;
335 335
         if (Database::num_rows($res_max)) {
336 336
             $row_max = Database::fetch_array($res_max);
337
-            $order = intval($row_max[0])+1;
337
+            $order = intval($row_max[0]) + 1;
338 338
         }
339 339
 
340 340
         return $order;
@@ -754,8 +754,8 @@  discard block
 block discarded – undo
754 754
             $result = array();
755 755
             if ($num_rows > 0) {
756 756
                 while ($myrow = Database::fetch_array($rs)) {
757
-                    $content.= '<strong>' . $myrow['title'] . '</strong><br /><br />';
758
-                    $content.= $myrow['content'];
757
+                    $content .= '<strong>'.$myrow['title'].'</strong><br /><br />';
758
+                    $content .= $myrow['content'];
759 759
                     $i++;
760 760
                 }
761 761
                 $result['content'] = $content;
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
         echo "<table id=\"recipient_list\" >";
787 787
         echo '<tr>';
788 788
         echo '<td>';
789
-        echo '<label><input type="checkbox" id="send_to_all_users">'.get_lang('SendToAllUsers') . "</label>";
789
+        echo '<label><input type="checkbox" id="send_to_all_users">'.get_lang('SendToAllUsers')."</label>";
790 790
         echo "</td>";
791 791
         echo '</tr>';
792 792
         echo '<tr>';
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
 
795 795
         // the form containing all the groups and all the users of the course
796 796
         echo '<td>';
797
-        echo "<strong>" . get_lang('Users') . "</strong><br />";
797
+        echo "<strong>".get_lang('Users')."</strong><br />";
798 798
 
799 799
         self::construct_not_selected_select_form($groupList, $userList, $to_already_selected);
800 800
         echo "</td>";
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
         echo "<td>";
810 810
 
811 811
         // the form containing the selected groups and users
812
-        echo "<strong>" . get_lang('DestinationUsers') . "</strong><br />";
812
+        echo "<strong>".get_lang('DestinationUsers')."</strong><br />";
813 813
         self::construct_selected_select_form($groupList, $userList, $to_already_selected);
814 814
         echo "</td>";
815 815
         echo "</tr>";
@@ -827,8 +827,8 @@  discard block
 block discarded – undo
827 827
         echo "<select id=\"not_selected_form\" name=\"not_selected_form[]\" size=5 style=\"width:200px\" multiple>";
828 828
         $group_users = GroupManager::getStudentsAndTutors($group_id);
829 829
         foreach ($group_users as $user) {
830
-            echo '<option value="' . $user['user_id'] . '" title="' . sprintf(get_lang('LoginX'), $user['username']) . '" >' .
831
-                api_get_person_name($user['firstname'], $user['lastname']) .
830
+            echo '<option value="'.$user['user_id'].'" title="'.sprintf(get_lang('LoginX'), $user['username']).'" >'.
831
+                api_get_person_name($user['firstname'], $user['lastname']).
832 832
                 '</option>';
833 833
         }
834 834
         echo '</select>';
@@ -866,12 +866,12 @@  discard block
 block discarded – undo
866 866
         if (!empty($groupList)) {
867 867
             foreach ($groupList as $this_group) {
868 868
                 if (is_array($to_already_selected)) {
869
-                    if (!in_array("GROUP:" . $this_group['id'], $to_already_selected)) {
869
+                    if (!in_array("GROUP:".$this_group['id'], $to_already_selected)) {
870 870
                         // $to_already_selected is the array containing the groups (and users) that are already selected
871
-                        $user_label = ($this_group['userNb'] > 0) ? get_lang('Users') : get_lang('LowerCaseUser') ;
872
-                        $user_disabled = ($this_group['userNb'] > 0) ? "" : "disabled=disabled" ;
873
-                        echo "<option $user_disabled value=\"GROUP:" . $this_group['id'] . "\">",
874
-                        "G: ", $this_group['name'], " - " . $this_group['userNb'] . " " . $user_label .
871
+                        $user_label = ($this_group['userNb'] > 0) ? get_lang('Users') : get_lang('LowerCaseUser');
872
+                        $user_disabled = ($this_group['userNb'] > 0) ? "" : "disabled=disabled";
873
+                        echo "<option $user_disabled value=\"GROUP:".$this_group['id']."\">",
874
+                        "G: ", $this_group['name'], " - ".$this_group['userNb']." ".$user_label.
875 875
                             "</option>";
876 876
                     }
877 877
                 }
@@ -885,15 +885,15 @@  discard block
 block discarded – undo
885 885
         if (!empty($userList)) {
886 886
             foreach ($userList as $user) {
887 887
                 if (is_array($to_already_selected)) {
888
-                    if (!in_array("USER:" . $user['user_id'], $to_already_selected)) {
888
+                    if (!in_array("USER:".$user['user_id'], $to_already_selected)) {
889 889
                         // $to_already_selected is the array containing the users (and groups) that are already selected
890
-                        echo "<option value=\"USER:" . $user['user_id'] . "\" title='" . sprintf(get_lang('LoginX'), $user['username']) . "'>",
890
+                        echo "<option value=\"USER:".$user['user_id']."\" title='".sprintf(get_lang('LoginX'), $user['username'])."'>",
891 891
                         "", api_get_person_name($user['firstname'], $user['lastname']),
892 892
                         "</option>";
893 893
 
894 894
                         if (isset($user['drh_list']) && !empty($user['drh_list'])) {
895 895
                             foreach ($user['drh_list'] as $drh) {
896
-                                echo "<option value=\"USER:" . $drh['user_id'] . "\" title='" . sprintf(get_lang('LoginX'), $drh['username']) . "'>&nbsp;&nbsp;&nbsp;&nbsp;",
896
+                                echo "<option value=\"USER:".$drh['user_id']."\" title='".sprintf(get_lang('LoginX'), $drh['username'])."'>&nbsp;&nbsp;&nbsp;&nbsp;",
897 897
                                 "", api_get_person_name($drh['firstname'], $drh['lastname']),
898 898
                                 "</option>";
899 899
                             }
@@ -925,16 +925,16 @@  discard block
 block discarded – undo
925 925
             foreach ($to_already_selected as $groupuser) {
926 926
                 list($type, $id) = explode(":", $groupuser);
927 927
                 if ($type == "GROUP") {
928
-                    echo "<option value=\"" . $groupuser . "\">G: " . $ref_array_groups[$id]['name'] . "</option>";
928
+                    echo "<option value=\"".$groupuser."\">G: ".$ref_array_groups[$id]['name']."</option>";
929 929
                 } else {
930 930
                     foreach ($ref_array_users as $key => $value) {
931 931
                         if ($value['user_id'] == $id) {
932
-                            echo "<option value=\"" . $groupuser . "\" title='" . sprintf(get_lang('LoginX'), $value['username']) . "'>" .
933
-                                api_get_person_name($value['firstname'], $value['lastname']) . "</option>";
932
+                            echo "<option value=\"".$groupuser."\" title='".sprintf(get_lang('LoginX'), $value['username'])."'>".
933
+                                api_get_person_name($value['firstname'], $value['lastname'])."</option>";
934 934
 
935 935
                             if (isset($value['drh_list']) && !empty($value['drh_list'])) {
936 936
                                 foreach ($value['drh_list'] as $drh) {
937
-                                    echo "<option value=\"USER:" . $drh['user_id'] . "\" title='" . sprintf(get_lang('LoginX'), $drh['username']) . "'>&nbsp;&nbsp;&nbsp;&nbsp;",
937
+                                    echo "<option value=\"USER:".$drh['user_id']."\" title='".sprintf(get_lang('LoginX'), $drh['username'])."'>&nbsp;&nbsp;&nbsp;&nbsp;",
938 938
                                     "", api_get_person_name($drh['firstname'], $drh['lastname']),
939 939
                                     "</option>";
940 940
                                 }
@@ -950,17 +950,17 @@  discard block
 block discarded – undo
950 950
                 if (is_array($ref_array_groups)) {
951 951
                     foreach ($ref_array_groups as $this_group) {
952 952
                         //api_display_normal_message("group " . $thisGroup[id] . $thisGroup[name]);
953
-                        if (!is_array($to_already_selected) || !in_array("GROUP:" . $this_group['id'], $to_already_selected)) { // $to_already_selected is the array containing the groups (and users) that are already selected
954
-                            echo "<option value=\"GROUP:" . $this_group['id'] . "\">",
955
-                            "G: ", $this_group['name'], " &ndash; " . $this_group['userNb'] . " " . get_lang('Users') .
953
+                        if (!is_array($to_already_selected) || !in_array("GROUP:".$this_group['id'], $to_already_selected)) { // $to_already_selected is the array containing the groups (and users) that are already selected
954
+                            echo "<option value=\"GROUP:".$this_group['id']."\">",
955
+                            "G: ", $this_group['name'], " &ndash; ".$this_group['userNb']." ".get_lang('Users').
956 956
                                 "</option>";
957 957
                         }
958 958
                     }
959 959
                 }
960 960
                 // adding the individual users to the select form
961 961
                 foreach ($ref_array_users as $this_user) {
962
-                    if (!is_array($to_already_selected) || !in_array("USER:" . $this_user['user_id'], $to_already_selected)) { // $to_already_selected is the array containing the users (and groups) that are already selected
963
-                        echo "<option value=\"USER:", $this_user['user_id'], "\"  title='" . sprintf(get_lang('LoginX'), $this_user['username']) . "'>",
962
+                    if (!is_array($to_already_selected) || !in_array("USER:".$this_user['user_id'], $to_already_selected)) { // $to_already_selected is the array containing the users (and groups) that are already selected
963
+                        echo "<option value=\"USER:", $this_user['user_id'], "\"  title='".sprintf(get_lang('LoginX'), $this_user['username'])."'>",
964 964
                         "", api_get_person_name($this_user['firstname'], $this_user['lastname']),
965 965
                         "</option>";
966 966
                     }
@@ -1073,14 +1073,14 @@  discard block
 block discarded – undo
1073 1073
             switch ($to_group) {
1074 1074
                 // it was send to one specific user
1075 1075
                 case null:
1076
-                    $to[] = "USER:" . $row['to_user_id'];
1076
+                    $to[] = "USER:".$row['to_user_id'];
1077 1077
                     break;
1078 1078
                 // it was sent to everyone
1079 1079
                 case 0:
1080 1080
                     return "everyone";
1081 1081
                     break;
1082 1082
                 default:
1083
-                    $to[] = "GROUP:" . $row['to_group_id'];
1083
+                    $to[] = "GROUP:".$row['to_group_id'];
1084 1084
             }
1085 1085
         }
1086 1086
         return $to;
@@ -1161,10 +1161,10 @@  discard block
 block discarded – undo
1161 1161
                 $sent_to_array['groups'][0] !== 0
1162 1162
             ) {
1163 1163
                 $group_id = $sent_to_array['groups'][0];
1164
-                $output[] = "&nbsp;" . $group_names[$group_id]['name'];
1164
+                $output[] = "&nbsp;".$group_names[$group_id]['name'];
1165 1165
             }
1166 1166
             if (empty($sent_to_array['groups']) and empty($sent_to_array['users'])) {
1167
-                $output[] = "&nbsp;" . get_lang('Everybody');
1167
+                $output[] = "&nbsp;".get_lang('Everybody');
1168 1168
             }
1169 1169
         }
1170 1170
 
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
 
1200 1200
         $sql = "SELECT to_group_id, to_user_id
1201 1201
                 FROM $tbl_item_property
1202
-                WHERE c_id = $course_id AND tool = '$tool' AND ref=" . $id;
1202
+                WHERE c_id = $course_id AND tool = '$tool' AND ref=".$id;
1203 1203
         $result = Database::query($sql);
1204 1204
 
1205 1205
         while ($row = Database::fetch_array($result)) {
@@ -1238,8 +1238,8 @@  discard block
 block discarded – undo
1238 1238
         $announcement_id = intval($announcement_id);
1239 1239
         $course_id = api_get_course_int_id();
1240 1240
         $row = array();
1241
-        $sql = 'SELECT id, path, filename, comment FROM ' . $tbl_announcement_attachment . '
1242
-				WHERE c_id = ' . $course_id . ' AND announcement_id = ' . $announcement_id . '';
1241
+        $sql = 'SELECT id, path, filename, comment FROM '.$tbl_announcement_attachment.'
1242
+				WHERE c_id = ' . $course_id.' AND announcement_id = '.$announcement_id.'';
1243 1243
         $result = Database::query($sql);
1244 1244
         if (Database::num_rows($result) != 0) {
1245 1245
             $row = Database::fetch_array($result, 'ASSOC');
@@ -1264,9 +1264,9 @@  discard block
 block discarded – undo
1264 1264
 
1265 1265
         if (is_array($file) && $file['error'] == 0) {
1266 1266
             // TODO: This path is obsolete. The new document repository scheme should be kept in mind here.
1267
-            $courseDir = $_course['path'] . '/upload/announcements';
1267
+            $courseDir = $_course['path'].'/upload/announcements';
1268 1268
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
1269
-            $updir = $sys_course_path . $courseDir;
1269
+            $updir = $sys_course_path.$courseDir;
1270 1270
 
1271 1271
             // Try to add an extension to the file if it hasn't one
1272 1272
             $new_file_name = add_ext_on_mime(stripslashes($file['name']), $file['type']);
@@ -1278,7 +1278,7 @@  discard block
 block discarded – undo
1278 1278
                 Display :: display_error_message(get_lang('UplUnableToSaveFileFilteredExtension'));
1279 1279
             } else {
1280 1280
                 $new_file_name = uniqid('');
1281
-                $new_path = $updir . '/' . $new_file_name;
1281
+                $new_path = $updir.'/'.$new_file_name;
1282 1282
                 move_uploaded_file($file['tmp_name'], $new_path);
1283 1283
 
1284 1284
                 $params = [
@@ -1319,9 +1319,9 @@  discard block
 block discarded – undo
1319 1319
 
1320 1320
         if (is_array($file) && $file['error'] == 0) {
1321 1321
             // TODO: This path is obsolete. The new document repository scheme should be kept in mind here.
1322
-            $courseDir = $_course['path'] . '/upload/announcements';
1322
+            $courseDir = $_course['path'].'/upload/announcements';
1323 1323
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
1324
-            $updir = $sys_course_path . $courseDir;
1324
+            $updir = $sys_course_path.$courseDir;
1325 1325
 
1326 1326
             // Try to add an extension to the file if it hasn't one
1327 1327
             $new_file_name = add_ext_on_mime(stripslashes($file['name']), $file['type']);
@@ -1333,13 +1333,13 @@  discard block
 block discarded – undo
1333 1333
                 Display :: display_error_message(get_lang('UplUnableToSaveFileFilteredExtension'));
1334 1334
             } else {
1335 1335
                 $new_file_name = uniqid('');
1336
-                $new_path = $updir . '/' . $new_file_name;
1336
+                $new_path = $updir.'/'.$new_file_name;
1337 1337
                 @move_uploaded_file($file['tmp_name'], $new_path);
1338 1338
                 $safe_file_comment = Database::escape_string($file_comment);
1339 1339
                 $safe_file_name = Database::escape_string($file_name);
1340 1340
                 $safe_new_file_name = Database::escape_string($new_file_name);
1341 1341
                 $id_attach = intval($id_attach);
1342
-                $sql = "UPDATE $tbl_announcement_attachment SET filename = '$safe_file_name', comment = '$safe_file_comment', path = '$safe_new_file_name', size ='" . intval($file['size']) . "'
1342
+                $sql = "UPDATE $tbl_announcement_attachment SET filename = '$safe_file_name', comment = '$safe_file_comment', path = '$safe_new_file_name', size ='".intval($file['size'])."'
1343 1343
 					 	WHERE c_id = $course_id AND id = '$id_attach'";
1344 1344
                 $result = Database::query($sql);
1345 1345
                 if ($result === false) {
@@ -1418,7 +1418,7 @@  discard block
 block discarded – undo
1418 1418
 
1419 1419
             //if (!empty($user_id)) {
1420 1420
             if (0) {
1421
-                if (is_array($group_memberships) && count($group_memberships) > 0 ) {
1421
+                if (is_array($group_memberships) && count($group_memberships) > 0) {
1422 1422
                     $sql = "SELECT $select
1423 1423
                             FROM $tbl_announcement announcement, $tbl_item_property ip
1424 1424
                             WHERE
@@ -1497,7 +1497,7 @@  discard block
 block discarded – undo
1497 1497
             }
1498 1498
         } else {
1499 1499
             // STUDENT
1500
-            if (is_array($group_memberships) && count($group_memberships)>0) {
1500
+            if (is_array($group_memberships) && count($group_memberships) > 0) {
1501 1501
                 if ($allowUserEditSetting && !api_is_anonymous()) {
1502 1502
                     if (api_get_group_id() == 0) {
1503 1503
                         // No group
@@ -1622,7 +1622,7 @@  discard block
 block discarded – undo
1622 1622
 
1623 1623
                 // the styles
1624 1624
                 if ($myrow['visibility'] == '0') {
1625
-                    $style='invisible';
1625
+                    $style = 'invisible';
1626 1626
                 } else {
1627 1627
                     $style = '';
1628 1628
                 }
@@ -1631,8 +1631,8 @@  discard block
 block discarded – undo
1631 1631
                 $attachment_list = AnnouncementManager::get_attachment($myrow['id']);
1632 1632
 
1633 1633
                 $attachment_icon = '';
1634
-                if (count($attachment_list)>0) {
1635
-                    $attachment_icon = ' '.Display::return_icon('attachment.gif',get_lang('Attachment'));
1634
+                if (count($attachment_list) > 0) {
1635
+                    $attachment_icon = ' '.Display::return_icon('attachment.gif', get_lang('Attachment'));
1636 1636
                 }
1637 1637
 
1638 1638
                 /* TITLE */
@@ -1651,16 +1651,16 @@  discard block
 block discarded – undo
1651 1651
                     || (api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous())
1652 1652
                 ) {
1653 1653
                     $modify_icons = "<a href=\"".$actionUrl."&action=modify&id=".$myrow['id']."\">".
1654
-                        Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL)."</a>";
1655
-                    if ($myrow['visibility']==1) {
1656
-                        $image_visibility="visible";
1657
-                        $alt_visibility=get_lang('Hide');
1654
+                        Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>";
1655
+                    if ($myrow['visibility'] == 1) {
1656
+                        $image_visibility = "visible";
1657
+                        $alt_visibility = get_lang('Hide');
1658 1658
                     } else {
1659
-                        $image_visibility="invisible";
1660
-                        $alt_visibility=get_lang('Visible');
1659
+                        $image_visibility = "invisible";
1660
+                        $alt_visibility = get_lang('Visible');
1661 1661
                     }
1662
-                    $modify_icons .=  "<a href=\"".$actionUrl."&origin=".$origin."&action=showhide&id=".$myrow['id']."&sec_token=".$stok."\">".
1663
-                        Display::return_icon($image_visibility.'.png', $alt_visibility,'',ICON_SIZE_SMALL)."</a>";
1662
+                    $modify_icons .= "<a href=\"".$actionUrl."&origin=".$origin."&action=showhide&id=".$myrow['id']."&sec_token=".$stok."\">".
1663
+                        Display::return_icon($image_visibility.'.png', $alt_visibility, '', ICON_SIZE_SMALL)."</a>";
1664 1664
 
1665 1665
                     // DISPLAY MOVE UP COMMAND only if it is not the top announcement
1666 1666
                     if ($iterator != 1) {
@@ -1675,12 +1675,12 @@  discard block
 block discarded – undo
1675 1675
                     } else {
1676 1676
                         $modify_icons .= Display::return_icon('down_na.gif', get_lang('Down'));
1677 1677
                     }
1678
-                    if (api_is_allowed_to_edit(false,true)) {
1679
-                        $modify_icons .= "<a href=\"".$actionUrl."&action=delete&id=".$myrow['id']."&sec_token=".$stok."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,api_get_system_encoding()))."')) return false;\">".
1680
-                            Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).
1678
+                    if (api_is_allowed_to_edit(false, true)) {
1679
+                        $modify_icons .= "<a href=\"".$actionUrl."&action=delete&id=".$myrow['id']."&sec_token=".$stok."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, api_get_system_encoding()))."')) return false;\">".
1680
+                            Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).
1681 1681
                             "</a>";
1682 1682
                     }
1683
-                    $iterator ++;
1683
+                    $iterator++;
1684 1684
                 } else {
1685 1685
                     $modify_icons = Display::url(
1686 1686
                         Display::return_icon('default.png'),
@@ -1710,7 +1710,7 @@  discard block
 block discarded – undo
1710 1710
     public static function getNumberAnnouncements()
1711 1711
     {
1712 1712
         // Maximum title messages to display
1713
-        $maximum 	= '12';
1713
+        $maximum = '12';
1714 1714
         // Database Table Definitions
1715 1715
         $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT);
1716 1716
         $tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
@@ -1721,7 +1721,7 @@  discard block
 block discarded – undo
1721 1721
         $userId = api_get_user_id();
1722 1722
         $condition_session = api_get_session_condition($session_id, true, true, 'announcement.session_id');
1723 1723
 
1724
-        if (api_is_allowed_to_edit(false,true))  {
1724
+        if (api_is_allowed_to_edit(false, true)) {
1725 1725
             // check teacher status
1726 1726
             if (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath') {
1727 1727
 
@@ -1784,7 +1784,7 @@  discard block
 block discarded – undo
1784 1784
                 }
1785 1785
 
1786 1786
                 // the user is member of several groups => display personal announcements AND his group announcements AND the general announcements
1787
-                if (is_array($group_memberships) && count($group_memberships)>0) {
1787
+                if (is_array($group_memberships) && count($group_memberships) > 0) {
1788 1788
                     $sql = "SELECT announcement.*, ip.visibility, ip.to_group_id, ip.insert_user_id
1789 1789
                     FROM $tbl_announcement announcement, $tbl_item_property ip
1790 1790
                     WHERE
@@ -1834,7 +1834,7 @@  discard block
 block discarded – undo
1834 1834
                         }
1835 1835
 
1836 1836
                         // the user is not identiefied => show only the general announcements
1837
-                        $sql="SELECT announcement.*, ip.visibility, ip.to_group_id, ip.insert_user_id
1837
+                        $sql = "SELECT announcement.*, ip.visibility, ip.to_group_id, ip.insert_user_id
1838 1838
                                 FROM $tbl_announcement announcement, $tbl_item_property ip
1839 1839
                                 WHERE
1840 1840
                                     announcement.c_id = $course_id AND
Please login to merge, or discard this patch.
main/inc/ajax/model.ajax.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 $action = $_GET['a'];
12 12
 $page = intval($_REQUEST['page']); //page
13 13
 $limit = intval($_REQUEST['rows']); //quantity of rows
14
-$sidx = $_REQUEST['sidx'];         //index (field) to filter
15
-$sord = $_REQUEST['sord'];         //asc or desc
14
+$sidx = $_REQUEST['sidx']; //index (field) to filter
15
+$sord = $_REQUEST['sord']; //asc or desc
16 16
 
17 17
 if (strpos(strtolower($sidx), 'asc') !== false) {
18 18
     $sidx = str_replace(array('asc', ','), '', $sidx);
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     $sord = 'desc';
25 25
 }
26 26
 
27
-if (!in_array($sord, array('asc','desc'))) {
27
+if (!in_array($sord, array('asc', 'desc'))) {
28 28
     $sord = 'desc';
29 29
 }
30 30
 
@@ -64,19 +64,19 @@  discard block
 block discarded – undo
64 64
 function getWhereClause($col, $oper, $val)
65 65
 {
66 66
     $ops = array(
67
-        'eq' => '=',        //equal
68
-        'ne' => '<>',       //not equal
69
-        'lt' => '<',        //less than
70
-        'le' => '<=',       //less than or equal
71
-        'gt' => '>',        //greater than
72
-        'ge' => '>=',       //greater than or equal
73
-        'bw' => 'LIKE',     //begins with
67
+        'eq' => '=', //equal
68
+        'ne' => '<>', //not equal
69
+        'lt' => '<', //less than
70
+        'le' => '<=', //less than or equal
71
+        'gt' => '>', //greater than
72
+        'ge' => '>=', //greater than or equal
73
+        'bw' => 'LIKE', //begins with
74 74
         'bn' => 'NOT LIKE', //doesn't begin with
75
-        'in' => 'LIKE',     //is in
75
+        'in' => 'LIKE', //is in
76 76
         'ni' => 'NOT LIKE', //is not in
77
-        'ew' => 'LIKE',     //ends with
77
+        'ew' => 'LIKE', //ends with
78 78
         'en' => 'NOT LIKE', //doesn't end with
79
-        'cn' => 'LIKE',     //contains
79
+        'cn' => 'LIKE', //contains
80 80
         'nc' => 'NOT LIKE'  //doesn't contain
81 81
     );
82 82
 
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
 
101 101
 // If there is no search request sent by jqgrid, $where should be empty
102 102
 $whereCondition = null;
103
-$operation = isset($_REQUEST['oper'])  ? $_REQUEST['oper']  : false;
104
-$exportFormat = isset($_REQUEST['export_format'])  ? $_REQUEST['export_format']  : 'csv';
105
-$searchField = isset($_REQUEST['searchField'])  ? $_REQUEST['searchField']  : false;
106
-$searchOperator = isset($_REQUEST['searchOper'])   ? $_REQUEST['searchOper']   : false;
103
+$operation = isset($_REQUEST['oper']) ? $_REQUEST['oper'] : false;
104
+$exportFormat = isset($_REQUEST['export_format']) ? $_REQUEST['export_format'] : 'csv';
105
+$searchField = isset($_REQUEST['searchField']) ? $_REQUEST['searchField'] : false;
106
+$searchOperator = isset($_REQUEST['searchOper']) ? $_REQUEST['searchOper'] : false;
107 107
 $searchString = isset($_REQUEST['searchString']) ? $_REQUEST['searchString'] : false;
108 108
 $search = isset($_REQUEST['_search']) ? $_REQUEST['_search'] : false;
109 109
 $forceSearch = isset($_REQUEST['_force_search']) ? $_REQUEST['_force_search'] : false;
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             foreach ($filters->rules as $key => $rule) {
168 168
                 $whereCondition .= getWhereClause($rule->field, $rule->op, $rule->data);
169 169
 
170
-                if ($counter < count($filters->rules) -1) {
170
+                if ($counter < count($filters->rules) - 1) {
171 171
                     $whereCondition .= $filters->groupOp;
172 172
                 }
173 173
                 $counter++;
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
         $sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : 0;
203 203
         $courseCodeList = array();
204
-        $userIdList  = array();
204
+        $userIdList = array();
205 205
         $sessionIdList = [];
206 206
         $searchByGroups = false;
207 207
         if (api_is_drh()) {
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 $total_pages = 0;
555 555
 if ($count > 0) {
556 556
     if (!empty($limit)) {
557
-        $total_pages = ceil((float)$count/(float)$limit);
557
+        $total_pages = ceil((float) $count / (float) $limit);
558 558
     }
559 559
 }
560 560
 if ($page > $total_pages) {
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
         $result = getWorkListStudent($start, $limit, $sidx, $sord, $whereCondition);
794 794
         break;
795 795
     case 'get_work_user_list_all':
796
-        if (isset($_GET['type'])  && $_GET['type'] == 'simple') {
796
+        if (isset($_GET['type']) && $_GET['type'] == 'simple') {
797 797
             $columns = array(
798 798
                 //'type',
799 799
                 'firstname',
@@ -820,18 +820,18 @@  discard block
 block discarded – undo
820 820
         $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $whereCondition);
821 821
         break;
822 822
     case 'get_work_user_list_others':
823
-        if (isset($_GET['type'])  && $_GET['type'] == 'simple') {
823
+        if (isset($_GET['type']) && $_GET['type'] == 'simple') {
824 824
             $columns = array(
825
-                'type', 'firstname', 'lastname',  'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'
825
+                'type', 'firstname', 'lastname', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'
826 826
             );
827 827
         } else {
828
-            $columns = array('type', 'firstname', 'lastname',  'title', 'sent_date', 'actions');
828
+            $columns = array('type', 'firstname', 'lastname', 'title', 'sent_date', 'actions');
829 829
         }
830 830
         $whereCondition .= " AND u.user_id <> ".api_get_user_id();
831 831
         $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $whereCondition);
832 832
         break;
833 833
     case 'get_work_user_list':
834
-        if (isset($_GET['type'])  && $_GET['type'] == 'simple') {
834
+        if (isset($_GET['type']) && $_GET['type'] == 'simple') {
835 835
             $columns = array(
836 836
                 'type', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'
837 837
             );
@@ -859,10 +859,10 @@  discard block
 block discarded – undo
859 859
     case 'get_exercise_results':
860 860
         $course = api_get_course_info();
861 861
         // Used inside ExerciseLib::get_exam_results_data()
862
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
862
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
863 863
         if ($is_allowedToEdit || api_is_student_boss()) {
864 864
             $columns = array(
865
-                'firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score',  'user_ip', 'status', 'lp', 'actions'
865
+                'firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score', 'user_ip', 'status', 'lp', 'actions'
866 866
             );
867 867
             $officialCodeInList = api_get_setting('show_official_code_exercise_result_list');
868 868
             if ($officialCodeInList === 'true') {
@@ -873,11 +873,11 @@  discard block
 block discarded – undo
873 873
         break;
874 874
     case 'get_hotpotatoes_exercise_results':
875 875
         $course = api_get_course_info();
876
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
876
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
877 877
         if (api_is_allowed_to_edit()) {
878
-            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date',  'score', 'actions');
878
+            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions');
879 879
         } else {
880
-            $columns = array('exe_date',  'score', 'actions');
880
+            $columns = array('exe_date', 'score', 'actions');
881 881
         }
882 882
         $result = ExerciseLib::get_exam_results_hotpotatoes_data($start, $limit, $sidx, $sord, $hotpot_path, $whereCondition);
883 883
         break;
@@ -903,12 +903,12 @@  discard block
 block discarded – undo
903 903
         break;
904 904
     case 'get_hotpotatoes_exercise_results':
905 905
         $course = api_get_course_info();
906
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
906
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
907 907
 
908 908
         if (api_is_allowed_to_edit(null, true) || api_is_drh()) {
909
-            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date',  'score', 'actions');
909
+            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions');
910 910
         } else {
911
-            $columns = array('exe_date',  'score', 'actions');
911
+            $columns = array('exe_date', 'score', 'actions');
912 912
         }
913 913
         $result = ExerciseLib::get_exam_results_hotpotatoes_data($start, $limit, $sidx, $sord, $hotpot_path, $whereCondition);
914 914
         break;
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
             );
938 938
         }
939 939
 
940
-        $columns =  array(
940
+        $columns = array(
941 941
             'name',
942 942
             'date',
943 943
             'course_per_session',
@@ -1283,7 +1283,7 @@  discard block
 block discarded – undo
1283 1283
         $result = $new_result;
1284 1284
         break;
1285 1285
     case 'get_gradebooks':
1286
-        $columns = array('name', 'certificates','skills', 'actions', 'has_certificates');
1286
+        $columns = array('name', 'certificates', 'skills', 'actions', 'has_certificates');
1287 1287
         if (!in_array($sidx, $columns)) {
1288 1288
             $sidx = 'name';
1289 1289
         }
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
                     if (!empty($exercises[$cnt - 4]['title'])) {
1454 1454
                         $title = ucwords(strtolower(trim($exercises[$cnt - 4]['title'])));
1455 1455
                     }
1456
-                    $columns[] = 'exer' . $i;
1456
+                    $columns[] = 'exer'.$i;
1457 1457
                     $column_names[] = $title;
1458 1458
                     $i++;
1459 1459
                     break;
@@ -1486,7 +1486,7 @@  discard block
 block discarded – undo
1486 1486
             $sessionInfo = SessionManager::fetch($listUserSess[$user['user_id']]['id_session']);
1487 1487
             $result[$i]['session'] = $sessionInfo['name'];
1488 1488
             $result[$i]['username'] = $user['username'];
1489
-            $result[$i]['name'] = $user['lastname'] . " " . $user['firstname'];
1489
+            $result[$i]['name'] = $user['lastname']." ".$user['firstname'];
1490 1490
             $j = 1;
1491 1491
             $finalScore = 0;
1492 1492
             foreach ($quizIds as $quizID) {
@@ -1494,7 +1494,7 @@  discard block
 block discarded – undo
1494 1494
                 if (!empty($arrGrade [$user['user_id']][$quizID]) || $arrGrade [$user['user_id']][$quizID] == 0) {
1495 1495
                     $finalScore += $grade = $arrGrade [$user['user_id']][$quizID];
1496 1496
                 }
1497
-                $result[$i]['exer' . $j] = $grade;
1497
+                $result[$i]['exer'.$j] = $grade;
1498 1498
                 $j++;
1499 1499
             }
1500 1500
 
@@ -1666,9 +1666,9 @@  discard block
 block discarded – undo
1666 1666
         foreach ($result as $row) {
1667 1667
             // if results tab give not id, set id to $i otherwise id="null" for all <tr> of the jqgrid - ref #4235
1668 1668
             if (!isset($row['id']) || isset($row['id']) && $row['id'] == '') {
1669
-                $response->rows[$i]['id']= $i;
1669
+                $response->rows[$i]['id'] = $i;
1670 1670
             } else {
1671
-                $response->rows[$i]['id']= $row['id'];
1671
+                $response->rows[$i]['id'] = $row['id'];
1672 1672
             }
1673 1673
             $array = array();
1674 1674
             foreach ($columns as $col) {
@@ -1678,7 +1678,7 @@  discard block
 block discarded – undo
1678 1678
                     $array[] = isset($row[$col]) ? Security::remove_XSS($row[$col]) : '';
1679 1679
                 }
1680 1680
             }
1681
-            $response->rows[$i]['cell']=$array;
1681
+            $response->rows[$i]['cell'] = $array;
1682 1682
             $i++;
1683 1683
         }
1684 1684
     }
Please login to merge, or discard this patch.