Completed
Pull Request — 1.11.x (#1628)
by José
97:30 queued 69:06
created
main/admin/user_edit.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 if ($geolocalization) {
75 75
 	$gmapsApiKey = $gMapsPlugin->get('api_key');
76
-	$htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='. $gmapsApiKey . '" ></script>';
76
+	$htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='.$gmapsApiKey.'" ></script>';
77 77
 }
78 78
 
79 79
 $htmlHeadXtra[] = api_get_css_asset('cropper/dist/cropper.min.css');
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 }
154 154
 
155 155
 if (api_get_setting('login_is_email') == 'true') {
156
-    $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
156
+    $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
157 157
     $form->addRule('email', get_lang('UserTaken'), 'username_available', $user_data['username']);
158 158
 }
159 159
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 if (api_get_setting('login_is_email') != 'true') {
188 188
 	$form->addElement('text', 'username', get_lang('LoginName'), array('maxlength' => USERNAME_MAX_LENGTH));
189 189
     $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
190
-    $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
190
+    $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
191 191
     $form->addRule('username', get_lang('OnlyLettersAndNumbersAllowed'), 'username');
192 192
     $form->addRule('username', get_lang('UserTaken'), 'username_available', $user_data['username']);
193 193
 }
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 }
225 225
 $form->addElement('radio', 'reset_password', null, get_lang('AutoGeneratePassword'), 1);
226 226
 $group = array();
227
-$group[] =$form->createElement('radio', 'reset_password', null, get_lang('EnterPassword'), 2);
227
+$group[] = $form->createElement('radio', 'reset_password', null, get_lang('EnterPassword'), 2);
228 228
 $group[] = $form->createElement(
229 229
     'password',
230 230
     'password',
@@ -258,10 +258,10 @@  discard block
 block discarded – undo
258 258
 // Platform admin
259 259
 if (api_is_platform_admin()) {
260 260
 	$group = array();
261
-	$group[] =$form->createElement('radio', 'platform_admin', null, get_lang('Yes'), 1);
262
-	$group[] =$form->createElement('radio', 'platform_admin', null, get_lang('No'), 0);
261
+	$group[] = $form->createElement('radio', 'platform_admin', null, get_lang('Yes'), 1);
262
+	$group[] = $form->createElement('radio', 'platform_admin', null, get_lang('No'), 0);
263 263
 
264
-	$user_data['status'] == 1 ? $display = 'block':$display = 'none';
264
+	$user_data['status'] == 1 ? $display = 'block' : $display = 'none';
265 265
 
266 266
 	$form->addElement('html', '<div id="id_platform_admin" style="display:'.$display.'">');
267 267
 	$form->addGroup($group, 'admin', get_lang('PlatformAdmin'), null, false);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 if (!$user_data['platform_admin']) {
286 286
 	// Expiration Date
287 287
 	$form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
288
-	$group = array ();
288
+	$group = array();
289 289
 	$group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('Enabled'), 1);
290 290
 	$group[] = $form->createElement('DateTimePicker', 'expiration_date', null, array('onchange' => 'javascript: enable_expiration_date();'));
291 291
 	$form->addGroup($group, 'max_member_group', null, null, false);
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 if ($studentBoss) {
304 304
     foreach ($studentBoss as $bossId => $userData) {
305 305
         $bossInfo = api_get_user_info($userData['user_id']);
306
-        $studentBossToSelect[$bossInfo['user_id']] =  $bossInfo['complete_name_with_username'];
306
+        $studentBossToSelect[$bossInfo['user_id']] = $bossInfo['complete_name_with_username'];
307 307
     }
308 308
 }
309 309
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 $jquery_ready_content = $returnParams['jquery_ready_content'];
321 321
 
322 322
 // the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
323
-$htmlHeadXtra[] ='<script>
323
+$htmlHeadXtra[] = '<script>
324 324
 $(document).ready(function(){
325 325
 	'.$jquery_ready_content.'
326 326
 });
Please login to merge, or discard this patch.
main/auth/profile.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
 if ($geolocalization) {
35 35
     $gmapsApiKey = $gMapsPlugin->get('api_key');
36
-    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='. $gmapsApiKey . '" ></script>';
36
+    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='.$gmapsApiKey.'" ></script>';
37 37
 }
38 38
 
39 39
 $htmlHeadXtra[] = api_get_password_checker_js('#username', '#password1');
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
119 119
 if (api_is_western_name_order()) {
120 120
     //    FIRST NAME and LAST NAME
121 121
     $form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40));
122
-    $form->addElement('text', 'lastname',  get_lang('LastName'),  array('size' => 40));
122
+    $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40));
123 123
 } else {
124 124
     //    LAST NAME and FIRST NAME
125
-    $form->addElement('text', 'lastname',  get_lang('LastName'),  array('size' => 40));
125
+    $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40));
126 126
     $form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40));
127 127
 }
128 128
 if (api_get_setting('profile', 'name') !== 'true') {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 $form->applyFilter(array('lastname', 'firstname'), 'stripslashes');
132 132
 $form->applyFilter(array('lastname', 'firstname'), 'trim');
133 133
 $form->applyFilter(array('lastname', 'firstname'), 'html_filter');
134
-$form->addRule('lastname' , get_lang('ThisFieldIsRequired'), 'required');
134
+$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
135 135
 $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
136 136
 
137 137
 //    USERNAME
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     $form->freeze('email');
177 177
 }
178 178
 
179
-if (api_get_setting('registration', 'email') == 'true' &&  api_get_setting('profile', 'email') == 'true') {
179
+if (api_get_setting('registration', 'email') == 'true' && api_get_setting('profile', 'email') == 'true') {
180 180
     $form->applyFilter('email', 'stripslashes');
181 181
     $form->applyFilter('email', 'trim');
182 182
     $form->addRule('email', get_lang('ThisFieldIsRequired'), 'required');
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 
329 329
 // the $jquery_ready_content variable collects all functions that
330 330
 // will be load in the $(document).ready javascript function
331
-$htmlHeadXtra[] ='<script>
331
+$htmlHeadXtra[] = '<script>
332 332
 $(document).ready(function(){
333 333
     '.$jquery_ready_content.'
334 334
 });
Please login to merge, or discard this patch.
main/auth/inscription.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
 if ($geolocalization) {
37 37
     $gmapsApiKey = $gMapsPlugin->get('api_key');
38
-    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='. $gmapsApiKey . '" ></script>';
38
+    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=true&key='.$gmapsApiKey.'" ></script>';
39 39
 }
40 40
 
41 41
 $htmlHeadXtra[] = api_get_password_checker_js('#username', '#pass1');
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         if (api_get_setting('registration', 'email') != 'true') {
97 97
             $form->addRule('email', get_lang('ThisFieldIsRequired'), 'required');
98 98
         }
99
-        $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
99
+        $form->addRule('email', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
100 100
         $form->addRule('email', get_lang('UserTaken'), 'username_available');
101 101
     }
102 102
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         );
138 138
         $form->applyFilter('username', 'trim');
139 139
         $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required');
140
-        $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
140
+        $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH);
141 141
         $form->addRule('username', get_lang('UsernameWrong'), 'username');
142 142
         $form->addRule('username', get_lang('UserTaken'), 'username_available');
143 143
     }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     if (CHECK_PASS_EASY_TO_FIND) {
169 169
         $form->addRule(
170 170
             'pass1',
171
-            get_lang('PassTooEasy') . ': ' . api_generate_password(),
171
+            get_lang('PassTooEasy').': '.api_generate_password(),
172 172
             'callback',
173 173
             'api_check_password'
174 174
         );
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             )
241 241
         );
242 242
 
243
-        $captcha_question =  $form->addElement('CAPTCHA_Image', 'captcha_question', '', $options);
243
+        $captcha_question = $form->addElement('CAPTCHA_Image', 'captcha_question', '', $options);
244 244
         $form->addElement('static', null, null, get_lang('ClickOnTheImageForANewOne'));
245 245
 
246 246
         $form->addElement('text', 'captcha', get_lang('EnterTheLettersYouSee'), array('size' => 40));
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
         }
384 384
     }
385 385
 
386
-    $tool_name = get_lang('Registration', null, (!empty($_POST['language'])?$_POST['language']: $_user['language']));
386
+    $tool_name = get_lang('Registration', null, (!empty($_POST['language']) ? $_POST['language'] : $_user['language']));
387 387
 
388 388
     if (api_get_setting('allow_terms_conditions') === 'true' && $user_already_registered_show_terms) {
389 389
         $tool_name = get_lang('TermsAndConditions');
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
     }
405 405
 
406 406
     if (file_exists($home.'register_top_'.$user_selected_language.'.html')) {
407
-        $home_top_temp = @(string)file_get_contents($home.'register_top_'.$user_selected_language.'.html');
407
+        $home_top_temp = @(string) file_get_contents($home.'register_top_'.$user_selected_language.'.html');
408 408
         $open = str_replace('{rel_path}', api_get_path(REL_PATH), $home_top_temp);
409 409
         $open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
410 410
         if (!empty($open)) {
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
         if (api_get_setting('show_terms_if_profile_completed') === 'true') {
435 435
             $userInfo = api_get_user_info();
436 436
             if ($userInfo && $userInfo['status'] != ANONYMOUS) {
437
-                if ((int)$userInfo['profile_completed'] !== 1) {
437
+                if ((int) $userInfo['profile_completed'] !== 1) {
438 438
                     api_not_allowed(true);
439 439
                 }
440 440
             }
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
                 Database::query($sql);
648 648
 
649 649
                 // 2. Send mail to all platform admin
650
-                $emailsubject  = get_lang('ApprovalForNewAccount', null, $values['language']).': '.$values['username'];
650
+                $emailsubject = get_lang('ApprovalForNewAccount', null, $values['language']).': '.$values['username'];
651 651
                 $emailbody = get_lang('ApprovalForNewAccount', null, $values['language'])."\n";
652 652
                 $emailbody .= get_lang('UserName', null, $values['language']).': '.$values['username']."\n";
653 653
 
@@ -787,14 +787,14 @@  discard block
 block discarded – undo
787 787
         }
788 788
     } else {
789 789
         if (!empty($values['email'])) {
790
-            $text_after_registration.= '<p>'.get_lang('MailHasBeenSent', null, $_user['language']).'.</p>';
790
+            $text_after_registration .= '<p>'.get_lang('MailHasBeenSent', null, $_user['language']).'.</p>';
791 791
         }
792 792
 
793 793
         if ($is_allowedCreateCourse) {
794 794
             if ($usersCanCreateCourse) {
795
-                $form_data['message'] = '<p>'. get_lang('NowGoCreateYourCourse', null, $_user['language']). "</p>";
795
+                $form_data['message'] = '<p>'.get_lang('NowGoCreateYourCourse', null, $_user['language'])."</p>";
796 796
             }
797
-            $form_data['action']  = api_get_path(WEB_CODE_PATH).'create_course/add_course.php';
797
+            $form_data['action'] = api_get_path(WEB_CODE_PATH).'create_course/add_course.php';
798 798
 
799 799
             if (api_get_setting('course_validation') === 'true') {
800 800
                 $form_data['button'] = Display::button(
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
         } else {
818 818
             if (api_get_setting('allow_students_to_browse_courses') == 'true') {
819 819
                 $form_data['action'] = 'courses.php?action=subscribe';
820
-                $form_data['message'] = '<p>'. get_lang('NowGoChooseYourCourses', null, $_user['language']). ".</p>";
820
+                $form_data['message'] = '<p>'.get_lang('NowGoChooseYourCourses', null, $_user['language']).".</p>";
821 821
             } else {
822 822
                 $form_data['action'] = api_get_path(WEB_PATH).'user_portal.php';
823 823
             }
Please login to merge, or discard this patch.
plugin/google_maps/src/map_coordinates.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 
22 22
 if ($apiIsEnable) {
23 23
     $gmapsApiKey = $plugin->get('api_key');
24
-    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key='. $gmapsApiKey . '" ></script>';
24
+    $htmlHeadXtra[] = '<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key='.$gmapsApiKey.'" ></script>';
25 25
 }
26 26
 
27 27
 $em = Database::getManager();
Please login to merge, or discard this patch.
main/inc/lib/message.lib.php 1 patch
Spacing   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         $sql = "SELECT COUNT(id) as count 
57 57
                         FROM $table
58 58
                         WHERE
59
-                            user_receiver_id=" . api_get_user_id() . " AND
59
+                            user_receiver_id=".api_get_user_id()." AND
60 60
                             msg_status = " . MESSAGE_STATUS_UNREAD;
61 61
         $result = Database::query($sql);
62 62
         $row = Database::fetch_assoc($result);
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
     {
86 86
         $table_message = Database::get_main_table(TABLE_MESSAGE);
87 87
         if ($unread) {
88
-            $condition_msg_status = ' msg_status = ' . MESSAGE_STATUS_UNREAD . ' ';
88
+            $condition_msg_status = ' msg_status = '.MESSAGE_STATUS_UNREAD.' ';
89 89
         } else {
90
-            $condition_msg_status = ' msg_status IN(' . MESSAGE_STATUS_NEW . ',' . MESSAGE_STATUS_UNREAD . ') ';
90
+            $condition_msg_status = ' msg_status IN('.MESSAGE_STATUS_NEW.','.MESSAGE_STATUS_UNREAD.') ';
91 91
         }
92 92
 
93 93
         $keyword = Session::read('message_search_keyword');
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $sql = "SELECT COUNT(id) as number_messages
101 101
                 FROM $table_message
102 102
                 WHERE $condition_msg_status AND
103
-                    user_receiver_id=" . api_get_user_id() . "
103
+                    user_receiver_id=".api_get_user_id()."
104 104
                     $keywordCondition
105 105
                 ";
106 106
         $result = Database::query($sql);
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
                     msg_status as col4
149 149
                 FROM $table_message
150 150
                 WHERE
151
-                  user_receiver_id=" . api_get_user_id() . " AND
151
+                  user_receiver_id=".api_get_user_id()." AND
152 152
                   msg_status IN (0,1)
153 153
                   $keywordCondition
154 154
                 ORDER BY col$column $direction
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
                 $link = '&f=social';
174 174
             }
175 175
             $userInfo = api_get_user_info($result[1]);
176
-            $message[1] = '<a ' . $class . ' href="view_message.php?id=' . $result[0] . $link . '">' . $result[2] . '</a><br />' . $userInfo['complete_name'];
177
-            $message[3] = '<a href="new_message.php?re_id=' . $result[0] . $link . '">' .
178
-                Display::return_icon('message_reply.png', get_lang('ReplyToMessage')) . '</a>' .
179
-                '&nbsp;&nbsp;<a onclick="javascript:if(!confirm(' . "'" . addslashes(api_htmlentities(get_lang('ConfirmDeleteMessage'))) . "'" . ')) return false;" href="inbox.php?action=deleteone&id=' . $result[0] . $link . '">' . Display::return_icon('delete.png', get_lang('DeleteMessage')) . '</a>';
176
+            $message[1] = '<a '.$class.' href="view_message.php?id='.$result[0].$link.'">'.$result[2].'</a><br />'.$userInfo['complete_name'];
177
+            $message[3] = '<a href="new_message.php?re_id='.$result[0].$link.'">'.
178
+                Display::return_icon('message_reply.png', get_lang('ReplyToMessage')).'</a>'.
179
+                '&nbsp;&nbsp;<a onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmDeleteMessage')))."'".')) return false;" href="inbox.php?action=deleteone&id='.$result[0].$link.'">'.Display::return_icon('delete.png', get_lang('DeleteMessage')).'</a>';
180 180
 
181 181
             $message[2] = api_convert_and_format_date($result[3], DATE_TIME_FORMAT_LONG); //date stays the same
182 182
             foreach ($message as $key => $value) {
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
             //@todo it's possible to edit a message? yes, only for groups
282 282
             if ($edit_message_id) {
283 283
                 $query = " UPDATE $table_message SET
284
-                                update_date = '" . $now . "',
284
+                                update_date = '".$now."',
285 285
                                 content = '".Database::escape_string($content)."'
286 286
                            WHERE id = '$edit_message_id' ";
287 287
                 Database::query($query);
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
                     $message = sprintf(
451 451
                             get_lang('CopyOfMessageSentToXUser'),
452 452
                             $userInfo['complete_name']
453
-                        ) . ' <br />' . $message;
453
+                        ).' <br />'.$message;
454 454
 
455 455
                     MessageManager::send_message_simple(
456 456
                         $drhInfo['user_id'],
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
         $row = Database::fetch_array($rs_msg_id);
499 499
 
500 500
         // update parent_id for other user receiver
501
-        $sql = "UPDATE $table_message SET parent_id = " . $row['id'] . "
501
+        $sql = "UPDATE $table_message SET parent_id = ".$row['id']."
502 502
                 WHERE id = $message_id";
503 503
         Database::query($sql);
504 504
     }
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
         $user_receiver_id = intval($user_receiver_id);
518 518
         $id = intval($id);
519 519
         $sql = "SELECT * FROM $table_message
520
-                WHERE id=" . $id . " AND msg_status<>4";
520
+                WHERE id=".$id." AND msg_status<>4";
521 521
         $rs = Database::query($sql);
522 522
 
523 523
         if (Database::num_rows($rs) > 0) {
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
             self::delete_message_attachment_file($id, $user_receiver_id);
526 526
             // delete message
527 527
             $query = "UPDATE $table_message SET msg_status=3
528
-                      WHERE user_receiver_id=" . $user_receiver_id . " AND id=" . $id;
528
+                      WHERE user_receiver_id=".$user_receiver_id." AND id=".$id;
529 529
             Database::query($query);
530 530
 
531 531
             return true;
@@ -614,13 +614,13 @@  discard block
 block discarded – undo
614 614
                 $path_user_info['dir'] = UserManager::getUserPathById($message_user_id, 'system');
615 615
             }
616 616
 
617
-            $path_message_attach = $path_user_info['dir'] . 'message_attachments/';
617
+            $path_message_attach = $path_user_info['dir'].'message_attachments/';
618 618
 
619 619
             // If this directory does not exist - we create it.
620 620
             if (!file_exists($path_message_attach)) {
621 621
                 @mkdir($path_message_attach, api_get_permissions_for_new_directories(), true);
622 622
             }
623
-            $new_path = $path_message_attach . $new_file_name;
623
+            $new_path = $path_message_attach.$new_file_name;
624 624
             if (is_uploaded_file($file_attach['tmp_name'])) {
625 625
                 @copy($file_attach['tmp_name'], $new_path);
626 626
             }
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
         while ($row = Database::fetch_array($rs)) {
656 656
             $path = $row['path'];
657 657
             $attach_id = $row['id'];
658
-            $new_path = $path . '_DELETED_' . $attach_id;
658
+            $new_path = $path.'_DELETED_'.$attach_id;
659 659
 
660 660
             if (!empty($group_id)) {
661 661
                 $userGroup = new UserGroup();
@@ -671,9 +671,9 @@  discard block
 block discarded – undo
671 671
                 );
672 672
             }
673 673
 
674
-            $path_message_attach = $path_user_info['dir'] . 'message_attachments/';
675
-            if (is_file($path_message_attach . $path)) {
676
-                if (rename($path_message_attach . $path, $path_message_attach . $new_path)) {
674
+            $path_message_attach = $path_user_info['dir'].'message_attachments/';
675
+            if (is_file($path_message_attach.$path)) {
676
+                if (rename($path_message_attach.$path, $path_message_attach.$new_path)) {
677 677
                     $sql = "UPDATE $table_message_attach set path='$new_path'
678 678
                             WHERE id ='$attach_id'";
679 679
                     Database::query($sql);
@@ -697,8 +697,8 @@  discard block
 block discarded – undo
697 697
         $sql = "UPDATE $table_message SET msg_status = '0'
698 698
                 WHERE
699 699
                     msg_status<>4 AND
700
-                    user_receiver_id=" . intval($user_id) . " AND
701
-                    id='" . intval($message_id) . "'";
700
+                    user_receiver_id=".intval($user_id)." AND
701
+                    id='" . intval($message_id)."'";
702 702
         Database::query($sql);
703 703
     }
704 704
 
@@ -718,8 +718,8 @@  discard block
 block discarded – undo
718 718
         $sql = "UPDATE $table_message SET
719 719
                     msg_status = '$type'
720 720
                 WHERE
721
-                    user_receiver_id=" . intval($user_id) . " AND
722
-                    id='" . intval($message_id) . "'";
721
+                    user_receiver_id=".intval($user_id)." AND
722
+                    id='" . intval($message_id)."'";
723 723
         Database::query($sql);
724 724
     }
725 725
 
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
             return false;
736 736
         $table_message = Database::get_main_table(TABLE_MESSAGE);
737 737
         $query = "SELECT * FROM $table_message
738
-                  WHERE user_receiver_id=" . intval($user_id) . " AND id='" . intval($message_id) . "'";
738
+                  WHERE user_receiver_id=".intval($user_id)." AND id='".intval($message_id)."'";
739 739
         $result = Database::query($query);
740 740
 
741 741
         return $row = Database::fetch_array($result);
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
         $sql = "SELECT * FROM $table_message
758 758
                 WHERE
759 759
                     group_id= $group_id AND
760
-                    msg_status NOT IN ('" . MESSAGE_STATUS_OUTBOX . "', '" . MESSAGE_STATUS_DELETED . "')
760
+                    msg_status NOT IN ('".MESSAGE_STATUS_OUTBOX."', '".MESSAGE_STATUS_DELETED."')
761 761
                 ORDER BY id";
762 762
         $rs = Database::query($sql);
763 763
         $data = array();
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
         $sql = "SELECT * FROM $table_message
786 786
                 WHERE
787 787
                     group_id = $group_id AND
788
-                    msg_status NOT IN ('" . MESSAGE_STATUS_OUTBOX . "', '" . MESSAGE_STATUS_DELETED . "')
788
+                    msg_status NOT IN ('".MESSAGE_STATUS_OUTBOX."', '".MESSAGE_STATUS_DELETED."')
789 789
                 ORDER BY id ";
790 790
 
791 791
         $rs = Database::query($sql);
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
         $sql = "SELECT * FROM $table_message
835 835
                 WHERE
836 836
                     parent_id='$parent_id' AND
837
-                    msg_status <> " . MESSAGE_STATUS_OUTBOX . "
837
+                    msg_status <> ".MESSAGE_STATUS_OUTBOX."
838 838
                     $condition_group_id
839 839
                 ORDER BY send_date DESC $condition_limit ";
840 840
         $rs = Database::query($sql);
@@ -862,8 +862,8 @@  discard block
 block discarded – undo
862 862
         $table_message = Database::get_main_table(TABLE_MESSAGE);
863 863
         $query = "SELECT id FROM $table_message
864 864
                   WHERE
865
-                    user_receiver_id = " . intval($user_id) . " AND
866
-                    id = '" . intval($id) . "'";
865
+                    user_receiver_id = ".intval($user_id)." AND
866
+                    id = '" . intval($id)."'";
867 867
         $result = Database::query($query);
868 868
         $num = Database::num_rows($result);
869 869
         if ($num > 0) {
@@ -911,8 +911,8 @@  discard block
 block discarded – undo
911 911
                     msg_status as col5
912 912
                 FROM $table_message
913 913
                 WHERE
914
-                    user_sender_id=" . api_get_user_id() . " AND
915
-                    msg_status=" . MESSAGE_STATUS_OUTBOX . "
914
+                    user_sender_id=".api_get_user_id()." AND
915
+                    msg_status=" . MESSAGE_STATUS_OUTBOX."
916 916
                     $keywordCondition
917 917
                 ORDER BY col$column $direction
918 918
                 LIMIT $from, $number_of_items";
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
         $message_list = array();
922 922
         while ($result = Database::fetch_row($sql_result)) {
923 923
             if ($request === true) {
924
-                $message[0] = '<input type="checkbox" value=' . $result[0] . ' name="out[]">';
924
+                $message[0] = '<input type="checkbox" value='.$result[0].' name="out[]">';
925 925
             } else {
926 926
                 $message[0] = ($result[0]);
927 927
             }
@@ -929,20 +929,20 @@  discard block
 block discarded – undo
929 929
             $result[2] = Security::remove_XSS($result[2]);
930 930
             $userInfo = api_get_user_info($result[4]);
931 931
             if ($request === true) {
932
-                $message[1] = '<a onclick="show_sent_message(' . $result[0] . ')" href="javascript:void(0)">' . $userInfo['complete_name'] . '</a>';
933
-                $message[2] = '<a onclick="show_sent_message(' . $result[0] . ')" href="javascript:void(0)">' . str_replace("\\", "", $result[2]) . '</a>';
932
+                $message[1] = '<a onclick="show_sent_message('.$result[0].')" href="javascript:void(0)">'.$userInfo['complete_name'].'</a>';
933
+                $message[2] = '<a onclick="show_sent_message('.$result[0].')" href="javascript:void(0)">'.str_replace("\\", "", $result[2]).'</a>';
934 934
                 $message[3] = api_convert_and_format_date($result[3], DATE_TIME_FORMAT_LONG); //date stays the same
935
-                $message[4] = '&nbsp;&nbsp;<a onclick="delete_one_message_outbox(' . $result[0] . ')" href="javascript:void(0)"  >' .
936
-                    Display::return_icon('delete.png', get_lang('DeleteMessage')) . '</a>';
935
+                $message[4] = '&nbsp;&nbsp;<a onclick="delete_one_message_outbox('.$result[0].')" href="javascript:void(0)"  >'.
936
+                    Display::return_icon('delete.png', get_lang('DeleteMessage')).'</a>';
937 937
             } else {
938 938
                 $link = '';
939 939
                 if (isset($_GET['f']) && $_GET['f'] == 'social') {
940 940
                     $link = '&f=social';
941 941
                 }
942
-                $message[1] = '<a ' . $class . ' onclick="show_sent_message (' . $result[0] . ')" href="../messages/view_message.php?id_send=' . $result[0] . $link . '">' . $result[2] . '</a><br />' . $userInfo['complete_name'];
942
+                $message[1] = '<a '.$class.' onclick="show_sent_message ('.$result[0].')" href="../messages/view_message.php?id_send='.$result[0].$link.'">'.$result[2].'</a><br />'.$userInfo['complete_name'];
943 943
                 $message[2] = api_convert_and_format_date($result[3], DATE_TIME_FORMAT_LONG); //date stays the same
944
-                $message[3] = '<a href="outbox.php?action=deleteone&id=' . $result[0] . '&' . $link . '"  onclick="javascript:if(!confirm(' . "'" . addslashes(api_htmlentities(get_lang('ConfirmDeleteMessage'))) . "'" . ')) return false;" >' .
945
-                    Display::return_icon('delete.png', get_lang('DeleteMessage')) . '</a>';
944
+                $message[3] = '<a href="outbox.php?action=deleteone&id='.$result[0].'&'.$link.'"  onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmDeleteMessage')))."'".')) return false;" >'.
945
+                    Display::return_icon('delete.png', get_lang('DeleteMessage')).'</a>';
946 946
             }
947 947
 
948 948
             foreach ($message as $key => $value) {
@@ -975,8 +975,8 @@  discard block
 block discarded – undo
975 975
         $sql = "SELECT COUNT(id) as number_messages 
976 976
                 FROM $table_message
977 977
                 WHERE
978
-                  msg_status=" . MESSAGE_STATUS_OUTBOX . " AND
979
-                  user_sender_id=" . api_get_user_id() . "
978
+                  msg_status=".MESSAGE_STATUS_OUTBOX." AND
979
+                  user_sender_id=" . api_get_user_id()."
980 980
                   $keywordCondition
981 981
                 ";
982 982
         $result = Database::query($sql);
@@ -1001,25 +1001,25 @@  discard block
 block discarded – undo
1001 1001
             if (isset($message_id) && is_numeric($message_id)) {
1002 1002
                 $query = "SELECT * FROM $table_message
1003 1003
                           WHERE
1004
-                            user_sender_id = " . api_get_user_id() . " AND
1005
-                            id = " . $message_id . " AND
1004
+                            user_sender_id = ".api_get_user_id()." AND
1005
+                            id = " . $message_id." AND
1006 1006
                             msg_status = 4;";
1007 1007
                 $result = Database::query($query);
1008 1008
             }
1009 1009
         } else {
1010 1010
             if (is_numeric($message_id) && !empty($message_id)) {
1011 1011
                 $query = "UPDATE $table_message SET
1012
-                          msg_status = '" . MESSAGE_STATUS_NEW . "'
1012
+                          msg_status = '".MESSAGE_STATUS_NEW."'
1013 1013
                           WHERE
1014
-                            user_receiver_id=" . api_get_user_id() . " AND
1015
-                            id='" . $message_id . "'";
1014
+                            user_receiver_id=" . api_get_user_id()." AND
1015
+                            id='" . $message_id."'";
1016 1016
                 Database::query($query);
1017 1017
 
1018 1018
                 $query = "SELECT * FROM $table_message
1019 1019
                           WHERE
1020 1020
                             msg_status<>4 AND
1021
-                            user_receiver_id=" . api_get_user_id() . " AND
1022
-                            id='" . $message_id . "'";
1021
+                            user_receiver_id=".api_get_user_id()." AND
1022
+                            id='" . $message_id."'";
1023 1023
                 $result = Database::query($query);
1024 1024
             }
1025 1025
         }
@@ -1056,8 +1056,8 @@  discard block
 block discarded – undo
1056 1056
                 $message_content .= '</div>';
1057 1057
 
1058 1058
                 $message_content .= '<div class="col-md-4">';
1059
-                $message_content .= '<a href="' . api_get_path(WEB_PATH) . 'main/social/profile.php?u=' . $user_sender_id . '">' . $name . '</a> ';
1060
-                $message_content .= api_strtolower(get_lang('To')) . '&nbsp;<b>' . $receiverUserInfo['complete_name'];
1059
+                $message_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$user_sender_id.'">'.$name.'</a> ';
1060
+                $message_content .= api_strtolower(get_lang('To')).'&nbsp;<b>'.$receiverUserInfo['complete_name'];
1061 1061
                 $message_content .= '</div>';
1062 1062
 
1063 1063
                 $message_content .= '<div class="col-md-2 col-md-offset-5">';
@@ -1070,7 +1070,7 @@  discard block
 block discarded – undo
1070 1070
                 $message_content .= '</div>';
1071 1071
 
1072 1072
                 $message_content .= '<div class="col-md-4">';
1073
-                $message_content .= '<a href="' . api_get_path(WEB_PATH) . 'main/social/profile.php?u=' . $user_sender_id . '">' . $name . '</a> ';
1073
+                $message_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$user_sender_id.'">'.$name.'</a> ';
1074 1074
                 $message_content .= '</div>';
1075 1075
 
1076 1076
                 $message_content .= '<div class="col-md-2 col-md-offset-5">';
@@ -1080,9 +1080,9 @@  discard block
 block discarded – undo
1080 1080
             $message_content .= '</div>';
1081 1081
         } else {
1082 1082
             if ($source == 'outbox') {
1083
-                $message_content .= get_lang('From') . ':&nbsp;' . $name . '</b> ' . api_strtolower(get_lang('To')) . ' <b>' . $receiverUserInfo['complete_name'] . '</b>';
1083
+                $message_content .= get_lang('From').':&nbsp;'.$name.'</b> '.api_strtolower(get_lang('To')).' <b>'.$receiverUserInfo['complete_name'].'</b>';
1084 1084
             } else {
1085
-                $message_content .= get_lang('From') . ':&nbsp;' . $name . '</b> ' . api_strtolower(get_lang('To')) . ' <b>' . get_lang('Me') . '</b>';
1085
+                $message_content .= get_lang('From').':&nbsp;'.$name.'</b> '.api_strtolower(get_lang('To')).' <b>'.get_lang('Me').'</b>';
1086 1086
             }
1087 1087
         }
1088 1088
         $message_content .= '
@@ -1090,26 +1090,26 @@  discard block
 block discarded – undo
1090 1090
 		        <hr style="color:#ddd" />
1091 1091
 		        <table width="100%">
1092 1092
 		            <tr>
1093
-		              <td valign=top class="view-message-content">' . str_replace("\\", "", $content) . '</td>
1093
+		              <td valign=top class="view-message-content">' . str_replace("\\", "", $content).'</td>
1094 1094
 		            </tr>
1095 1095
 		        </table>
1096
-		        <div id="message-attach">' . (!empty($files_attachments) ? implode('<br />', $files_attachments) : '') . '</div>
1096
+		        <div id="message-attach">' . (!empty($files_attachments) ? implode('<br />', $files_attachments) : '').'</div>
1097 1097
 		        <div style="padding: 15px 0px 5px 0px">';
1098 1098
         $social_link = '';
1099 1099
         if (isset($_GET['f']) && $_GET['f'] == 'social') {
1100 1100
             $social_link = 'f=social';
1101 1101
         }
1102 1102
         if ($source == 'outbox') {
1103
-            $message_content .= '<a href="outbox.php?' . $social_link . '">' .
1104
-                Display::return_icon('back.png', get_lang('ReturnToOutbox')) . '</a> &nbsp';
1103
+            $message_content .= '<a href="outbox.php?'.$social_link.'">'.
1104
+                Display::return_icon('back.png', get_lang('ReturnToOutbox')).'</a> &nbsp';
1105 1105
         } else {
1106
-            $message_content .= '<a href="inbox.php?' . $social_link . '">' .
1107
-                Display::return_icon('back.png', get_lang('ReturnToInbox')) . '</a> &nbsp';
1108
-            $message_content .= '<a href="new_message.php?re_id=' . $message_id . '&' . $social_link . '">' .
1109
-                Display::return_icon('message_reply.png', get_lang('ReplyToMessage')) . '</a> &nbsp';
1106
+            $message_content .= '<a href="inbox.php?'.$social_link.'">'.
1107
+                Display::return_icon('back.png', get_lang('ReturnToInbox')).'</a> &nbsp';
1108
+            $message_content .= '<a href="new_message.php?re_id='.$message_id.'&'.$social_link.'">'.
1109
+                Display::return_icon('message_reply.png', get_lang('ReplyToMessage')).'</a> &nbsp';
1110 1110
         }
1111
-        $message_content .= '<a href="inbox.php?action=deleteone&id=' . $message_id . '&' . $social_link . '" >' .
1112
-            Display::return_icon('delete.png', get_lang('DeleteMessage')) . '</a>&nbsp';
1111
+        $message_content .= '<a href="inbox.php?action=deleteone&id='.$message_id.'&'.$social_link.'" >'.
1112
+            Display::return_icon('delete.png', get_lang('DeleteMessage')).'</a>&nbsp';
1113 1113
 
1114 1114
         $message_content .= '</div></td>
1115 1115
 		      <td width=10></td>
@@ -1127,8 +1127,8 @@  discard block
 block discarded – undo
1127 1127
     public static function get_user_id_by_email($user_email)
1128 1128
     {
1129 1129
         $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
1130
-        $sql = 'SELECT user_id FROM ' . $tbl_user . '
1131
-                WHERE email="' . Database::escape_string($user_email) . '";';
1130
+        $sql = 'SELECT user_id FROM '.$tbl_user.'
1131
+                WHERE email="' . Database::escape_string($user_email).'";';
1132 1132
         $rs = Database::query($sql);
1133 1133
         $row = Database::fetch_array($rs, 'ASSOC');
1134 1134
         if (isset($row['user_id'])) {
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
 
1189 1189
                 $items = $topic['count'];
1190 1190
                 $reply_label = ($items == 1) ? get_lang('GroupReply') : get_lang('GroupReplies');
1191
-                $label = '<i class="fa fa-envelope"></i> ' . $items . ' ' . $reply_label;
1191
+                $label = '<i class="fa fa-envelope"></i> '.$items.' '.$reply_label;
1192 1192
                 $topic['title'] = trim($topic['title']);
1193 1193
 
1194 1194
                 if (empty($topic['title'])) {
@@ -1200,31 +1200,31 @@  discard block
 block discarded – undo
1200 1200
                     'h4',
1201 1201
                     Display::url(
1202 1202
                         Security::remove_XSS($topic['title'], STUDENT, true),
1203
-                        api_get_path(WEB_CODE_PATH) . 'social/group_topics.php?id=' . $group_id . '&topic_id=' . $topic['id']
1203
+                        api_get_path(WEB_CODE_PATH).'social/group_topics.php?id='.$group_id.'&topic_id='.$topic['id']
1204 1204
                     ), array('class' => 'title')
1205 1205
                 );
1206 1206
                 $actions = '';
1207 1207
                 if ($my_group_role == GROUP_USER_PERMISSION_ADMIN ||
1208 1208
                     $my_group_role == GROUP_USER_PERMISSION_MODERATOR
1209 1209
                 ) {
1210
-                    $actions = '<br />' . Display::url(get_lang('Delete'), api_get_path(WEB_CODE_PATH) . 'social/group_topics.php?action=delete&id=' . $group_id . '&topic_id=' . $topic['id'], array('class' => 'btn btn-default'));
1210
+                    $actions = '<br />'.Display::url(get_lang('Delete'), api_get_path(WEB_CODE_PATH).'social/group_topics.php?action=delete&id='.$group_id.'&topic_id='.$topic['id'], array('class' => 'btn btn-default'));
1211 1211
                 }
1212 1212
 
1213 1213
                 $date = '';
1214 1214
                 if ($topic['send_date'] != $topic['update_date']) {
1215 1215
                     if (!empty($topic['update_date'])) {
1216
-                        $date .= '<i class="fa fa-calendar"></i> ' . get_lang('LastUpdate') . ' ' . date_to_str_ago($topic['update_date']);
1216
+                        $date .= '<i class="fa fa-calendar"></i> '.get_lang('LastUpdate').' '.date_to_str_ago($topic['update_date']);
1217 1217
                     }
1218 1218
                 } else {
1219
-                    $date .= '<i class="fa fa-calendar"></i> ' . get_lang('Created') . ' ' . date_to_str_ago($topic['send_date']);
1219
+                    $date .= '<i class="fa fa-calendar"></i> '.get_lang('Created').' '.date_to_str_ago($topic['send_date']);
1220 1220
                 }
1221
-                $html .= '<div class="date">' . $label . ' - ' . $date . $actions . '</div>';
1221
+                $html .= '<div class="date">'.$label.' - '.$date.$actions.'</div>';
1222 1222
                 $html .= '</div>';
1223 1223
 
1224 1224
                 $image = $user_sender_info['avatar'];
1225 1225
 
1226
-                $user_info = '<div class="author"><img class="img-responsive img-circle" src="' . $image . '" alt="' . $name . '"  width="64" height="64" title="' . $name . '" /></div>';
1227
-                $user_info .= '<div class="name"><a href="' . api_get_path(WEB_PATH) . 'main/social/profile.php?u=' . $topic['user_sender_id'] . '">' . $name . '&nbsp;</a></div>';
1226
+                $user_info = '<div class="author"><img class="img-responsive img-circle" src="'.$image.'" alt="'.$name.'"  width="64" height="64" title="'.$name.'" /></div>';
1227
+                $user_info .= '<div class="name"><a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$topic['user_sender_id'].'">'.$name.'&nbsp;</a></div>';
1228 1228
 
1229 1229
                 $html .= '<div class="col-xs-4 col-md-2">';
1230 1230
                 $html .= $user_info;
@@ -1302,7 +1302,7 @@  discard block
 block discarded – undo
1302 1302
                 'group_id' => $group_id,
1303 1303
                 'message_id' => $main_message['id'],
1304 1304
                 'action' => 'edit_message_group',
1305
-                'anchor_topic' => 'topic_' . $main_message['id'],
1305
+                'anchor_topic' => 'topic_'.$main_message['id'],
1306 1306
                 'topics_page_nr' => $topic_page_nr,
1307 1307
                 'items_page_nr' => $items_page_nr,
1308 1308
                 'topic_id' => $main_message['id']
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
             if (api_is_platform_admin()) {
1311 1311
                 $links .= Display::url(
1312 1312
                     Display::returnFontAwesomeIcon('trash'),
1313
-                    'group_topics.php?action=delete&id=' . $group_id . '&topic_id=' . $topic_id,
1313
+                    'group_topics.php?action=delete&id='.$group_id.'&topic_id='.$topic_id,
1314 1314
                     [
1315 1315
                         'class' => 'btn btn-default'
1316 1316
                     ]
@@ -1335,7 +1335,7 @@  discard block
 block discarded – undo
1335 1335
             'group_id' => $group_id,
1336 1336
             'message_id' => $main_message['id'],
1337 1337
             'action' => 'reply_message_group',
1338
-            'anchor_topic' => 'topic_' . $main_message['id'],
1338
+            'anchor_topic' => 'topic_'.$main_message['id'],
1339 1339
             'topics_page_nr' => $topic_page_nr,
1340 1340
             'topic_id' => $main_message['id']
1341 1341
         ]);
@@ -1353,31 +1353,31 @@  discard block
 block discarded – undo
1353 1353
         $links .= '</div>';
1354 1354
         $links .= '</div>';
1355 1355
 
1356
-        $title = '<h4>' . Security::remove_XSS($main_message['title'], STUDENT, true) . $links . '</h4>';
1356
+        $title = '<h4>'.Security::remove_XSS($main_message['title'], STUDENT, true).$links.'</h4>';
1357 1357
 
1358 1358
         $userPicture = $user_sender_info['avatar'];
1359 1359
         $main_content .= '<div class="row">';
1360 1360
         $main_content .= '<div class="col-md-2">';
1361 1361
         $main_content .= '<div class="avatar-author">';
1362
-        $main_content .= '<img width="60px" src="' . $userPicture . '" alt="' . $name . '" class="img-responsive img-circle" title="' . $name . '" />';
1362
+        $main_content .= '<img width="60px" src="'.$userPicture.'" alt="'.$name.'" class="img-responsive img-circle" title="'.$name.'" />';
1363 1363
         $main_content .= '</div>';
1364 1364
         $main_content .= '</div>';
1365 1365
 
1366 1366
         $date = '';
1367 1367
         if ($main_message['send_date'] != $main_message['update_date']) {
1368 1368
             if (!empty($main_message['update_date'])) {
1369
-                $date = '<div class="date"> '. Display::returnFontAwesomeIcon('calendar') .' ' . get_lang('LastUpdate') . ' ' . date_to_str_ago($main_message['update_date']) . '</div>';
1369
+                $date = '<div class="date"> '.Display::returnFontAwesomeIcon('calendar').' '.get_lang('LastUpdate').' '.date_to_str_ago($main_message['update_date']).'</div>';
1370 1370
             }
1371 1371
         } else {
1372
-            $date = '<div class="date"> ' . Display::returnFontAwesomeIcon('calendar') .' ' . get_lang('Created') . ' ' . date_to_str_ago($main_message['send_date']) . '</div>';
1372
+            $date = '<div class="date"> '.Display::returnFontAwesomeIcon('calendar').' '.get_lang('Created').' '.date_to_str_ago($main_message['send_date']).'</div>';
1373 1373
         }
1374
-        $attachment = '<div class="message-attach">' . (!empty($files_attachments) ? implode('<br />', $files_attachments) : '') . '</div>';
1374
+        $attachment = '<div class="message-attach">'.(!empty($files_attachments) ? implode('<br />', $files_attachments) : '').'</div>';
1375 1375
         $main_content .= '<div class="col-md-10">';
1376
-        $user_link = '<a href="' . api_get_path(WEB_PATH) . 'main/social/profile.php?u=' . $main_message['user_sender_id'] . '">' . $name . '</a>';
1376
+        $user_link = '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$main_message['user_sender_id'].'">'.$name.'</a>';
1377 1377
         $main_content .= '<div class="message-content"> ';
1378
-        $main_content .= '<div class="username">' . $user_link . '</div>';
1379
-        $main_content .= $date ;
1380
-        $main_content .= '<div class="message">'. $main_message['content'] . $attachment . '</div></div>';
1378
+        $main_content .= '<div class="username">'.$user_link.'</div>';
1379
+        $main_content .= $date;
1380
+        $main_content .= '<div class="message">'.$main_message['content'].$attachment.'</div></div>';
1381 1381
         $main_content .= '</div>';
1382 1382
         $main_content .= '</div>';
1383 1383
 
@@ -1398,7 +1398,7 @@  discard block
 block discarded – undo
1398 1398
                 if (empty($topic['id'])) {
1399 1399
                     continue;
1400 1400
                 }
1401
-                $items_page_nr = isset($_GET['items_' . $topic['id'] . '_page_nr']) ? intval($_GET['items_' . $topic['id'] . '_page_nr']) : null;
1401
+                $items_page_nr = isset($_GET['items_'.$topic['id'].'_page_nr']) ? intval($_GET['items_'.$topic['id'].'_page_nr']) : null;
1402 1402
                 $links = '';
1403 1403
                 $links .= '<div class="pull-right">';
1404 1404
                 $html_items = '';
@@ -1408,36 +1408,36 @@  discard block
 block discarded – undo
1408 1408
 
1409 1409
                 $links .= '<div class="btn-group btn-group-sm">';
1410 1410
                 if (($my_group_role == GROUP_USER_PERMISSION_ADMIN || $my_group_role == GROUP_USER_PERMISSION_MODERATOR) || $topic['user_sender_id'] == $current_user_id) {
1411
-                    $links .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'social/message_for_group_form.inc.php?height=400&width=800&&user_friend=' . $current_user_id . '&group_id=' . $group_id . '&message_id=' . $topic['id'] . '&action=edit_message_group&anchor_topic=topic_' . $topic_id . '&topics_page_nr=' . $topic_page_nr . '&items_page_nr=' . $items_page_nr . '&topic_id=' . $topic_id . '" class="ajax btn btn-default" data-size="lg" data-title="' . get_lang('Edit') . '" title="' . get_lang('Edit') . '">' .
1412
-                        Display::returnFontAwesomeIcon('pencil') . '</a>';
1411
+                    $links .= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?height=400&width=800&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=edit_message_group&anchor_topic=topic_'.$topic_id.'&topics_page_nr='.$topic_page_nr.'&items_page_nr='.$items_page_nr.'&topic_id='.$topic_id.'" class="ajax btn btn-default" data-size="lg" data-title="'.get_lang('Edit').'" title="'.get_lang('Edit').'">'.
1412
+                        Display::returnFontAwesomeIcon('pencil').'</a>';
1413 1413
                 }
1414
-                $links .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'social/message_for_group_form.inc.php?height=400&width=800&&user_friend=' . api_get_user_id() . '&group_id=' . $group_id . '&message_id=' . $topic['id'] . '&action=reply_message_group&anchor_topic=topic_' . $topic_id . '&topics_page_nr=' . $topic_page_nr . '&items_page_nr=' . $items_page_nr . '&topic_id=' . $topic_id . '" class="ajax btn btn-default" data-size="lg" data-title="' . get_lang('Reply') . '" title="' . get_lang('Reply') . '">';
1415
-                $links .= Display::returnFontAwesomeIcon('commenting') . '</a>';
1414
+                $links .= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?height=400&width=800&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=reply_message_group&anchor_topic=topic_'.$topic_id.'&topics_page_nr='.$topic_page_nr.'&items_page_nr='.$items_page_nr.'&topic_id='.$topic_id.'" class="ajax btn btn-default" data-size="lg" data-title="'.get_lang('Reply').'" title="'.get_lang('Reply').'">';
1415
+                $links .= Display::returnFontAwesomeIcon('commenting').'</a>';
1416 1416
                 $links .= '</div>';
1417 1417
                 $links .= '</div>';
1418 1418
 
1419 1419
                 $userPicture = $user_sender_info['avatar'];
1420
-                $user_link = '<a href="' . api_get_path(WEB_PATH) . 'main/social/profile.php?u=' . $topic['user_sender_id'] . '">' . $name . '&nbsp</a>';
1420
+                $user_link = '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$topic['user_sender_id'].'">'.$name.'&nbsp</a>';
1421 1421
                 $html_items .= '<div class="row">';
1422 1422
                 $html_items .= '<div class="col-md-2">';
1423
-                $html_items .= '<div class="avatar-author"><img width="60px" src="' . $userPicture . '" alt="' . $name . '" class="img-responsive img-circle" title="' . $name . '" /></div>';
1423
+                $html_items .= '<div class="avatar-author"><img width="60px" src="'.$userPicture.'" alt="'.$name.'" class="img-responsive img-circle" title="'.$name.'" /></div>';
1424 1424
                 $html_items .= '</div>';
1425 1425
 
1426 1426
                 $date = '';
1427 1427
                 if ($topic['send_date'] != $topic['update_date']) {
1428 1428
                     if (!empty($topic['update_date'])) {
1429
-                        $date = '<div class="date"> ' . Display::returnFontAwesomeIcon('calendar') .' '. get_lang('LastUpdate') . ' ' . date_to_str_ago($topic['update_date']) . '</div>';
1429
+                        $date = '<div class="date"> '.Display::returnFontAwesomeIcon('calendar').' '.get_lang('LastUpdate').' '.date_to_str_ago($topic['update_date']).'</div>';
1430 1430
                     }
1431 1431
                 } else {
1432
-                    $date = '<div class="date"> ' . Display::returnFontAwesomeIcon('calendar') . get_lang('Created') . ' ' . date_to_str_ago($topic['send_date']) . '</div>';
1432
+                    $date = '<div class="date"> '.Display::returnFontAwesomeIcon('calendar').get_lang('Created').' '.date_to_str_ago($topic['send_date']).'</div>';
1433 1433
                 }
1434
-                $attachment = '<div class="message-attach">' . (!empty($files_attachments) ? implode('<br />', $files_attachments) : '') . '</div>';
1434
+                $attachment = '<div class="message-attach">'.(!empty($files_attachments) ? implode('<br />', $files_attachments) : '').'</div>';
1435 1435
                 $html_items .= '<div class="col-md-10">';
1436 1436
                 $html_items .= '<div class="message-content">';
1437 1437
                 $html_items .= $links;
1438
-                $html_items .= '<div class="username">' . $user_link . '</div>';
1438
+                $html_items .= '<div class="username">'.$user_link.'</div>';
1439 1439
                 $html_items .= $date;
1440
-                $html_items .=  '<div class="message">' . Security::remove_XSS($topic['content'], STUDENT, true) . '</div>' . $attachment . '</div>';
1440
+                $html_items .= '<div class="message">'.Security::remove_XSS($topic['content'], STUDENT, true).'</div>'.$attachment.'</div>';
1441 1441
                 $html_items .= '</div>';
1442 1442
                 $html_items .= '</div>';
1443 1443
 
@@ -1449,8 +1449,8 @@  discard block
 block discarded – undo
1449 1449
                     $indent = intval($topic['indent_cnt']) * $base_padding + $base_padding;
1450 1450
                 }
1451 1451
 
1452
-                $html_items = Display::div($html_items, array('class' => 'message-post', 'id' => 'msg_' . $topic['id']));
1453
-                $html_items = Display::div($html_items, array('class' => '', 'style' => 'margin-left:' . $indent . 'px'));
1452
+                $html_items = Display::div($html_items, array('class' => 'message-post', 'id' => 'msg_'.$topic['id']));
1453
+                $html_items = Display::div($html_items, array('class' => '', 'style' => 'margin-left:'.$indent.'px'));
1454 1454
                 $array_html_items[] = array($html_items);
1455 1455
             }
1456 1456
             // grids for items with paginations
@@ -1463,7 +1463,7 @@  discard block
 block discarded – undo
1463 1463
             );
1464 1464
             if (!empty($array_html_items)) {
1465 1465
                 $html .= Display::return_sortable_grid(
1466
-                    'items_' . $topic['id'],
1466
+                    'items_'.$topic['id'],
1467 1467
                     array(),
1468 1468
                     $array_html_items,
1469 1469
                     $options,
@@ -1554,14 +1554,14 @@  discard block
 block discarded – undo
1554 1554
             $rs_file = Database::query($sql);
1555 1555
             if (Database::num_rows($rs_file) > 0) {
1556 1556
                 $attach_icon = Display::return_icon('attachment.gif', '');
1557
-                $archiveURL = api_get_path(WEB_CODE_PATH) . 'messages/download.php?type=' . $type . '&file=';
1557
+                $archiveURL = api_get_path(WEB_CODE_PATH).'messages/download.php?type='.$type.'&file=';
1558 1558
                 while ($row_file = Database::fetch_array($rs_file)) {
1559 1559
                     $archiveFile = $row_file['path'];
1560 1560
                     $filename = $row_file['filename'];
1561 1561
                     $filesize = format_file_size($row_file['size']);
1562 1562
                     $filecomment = Security::remove_XSS($row_file['comment']);
1563 1563
                     $filename = Security::remove_XSS($filename);
1564
-                    $links_attach_file[] = $attach_icon . '&nbsp;<a href="' . $archiveURL . $archiveFile . '">' . $filename . '</a>&nbsp;(' . $filesize . ')' . (!empty($filecomment) ? '&nbsp;-&nbsp;<i>' . $filecomment . '</i>' : '');
1564
+                    $links_attach_file[] = $attach_icon.'&nbsp;<a href="'.$archiveURL.$archiveFile.'">'.$filename.'</a>&nbsp;('.$filesize.')'.(!empty($filecomment) ? '&nbsp;-&nbsp;<i>'.$filecomment.'</i>' : '');
1565 1565
                 }
1566 1566
             }
1567 1567
         }
@@ -1580,7 +1580,7 @@  discard block
 block discarded – undo
1580 1580
         $sql = "SELECT * FROM $tbl_message
1581 1581
                 WHERE 
1582 1582
                     id = '$message_id' AND 
1583
-                    msg_status <> '" . MESSAGE_STATUS_DELETED . "' ";
1583
+                    msg_status <> '".MESSAGE_STATUS_DELETED."' ";
1584 1584
         $res = Database::query($sql);
1585 1585
         $item = array();
1586 1586
         if (Database::num_rows($res) > 0) {
@@ -1708,7 +1708,7 @@  discard block
 block discarded – undo
1708 1708
 
1709 1709
         Session::write('message_sent_search_keyword', $keyword);
1710 1710
 
1711
-        $success = get_lang('SelectedMessagesDeleted') . '&nbsp</b><br /><a href="outbox.php?' . $social_link . '">' . get_lang('BackToOutbox') . '</a>';
1711
+        $success = get_lang('SelectedMessagesDeleted').'&nbsp</b><br /><a href="outbox.php?'.$social_link.'">'.get_lang('BackToOutbox').'</a>';
1712 1712
 
1713 1713
         $html = null;
1714 1714
         if (isset($_REQUEST['action'])) {
@@ -1816,7 +1816,7 @@  discard block
 block discarded – undo
1816 1816
                 ON m.user_sender_id = u.user_id
1817 1817
                 WHERE
1818 1818
                     m.user_receiver_id = $userId AND
1819
-                    m.msg_status = " . MESSAGE_STATUS_UNREAD . "
1819
+                    m.msg_status = ".MESSAGE_STATUS_UNREAD."
1820 1820
                     AND m.id > $lastId
1821 1821
                 ORDER BY m.send_date DESC";
1822 1822
 
@@ -1888,11 +1888,11 @@  discard block
 block discarded – undo
1888 1888
         $tplMailBody = new Template(null, false, false, false, false, false, false);
1889 1889
         $tplMailBody->assign('user', $user);
1890 1890
         $tplMailBody->assign('is_western_name_order', api_is_western_name_order());
1891
-        $tplMailBody->assign('manageUrl', api_get_path(WEB_CODE_PATH) . 'admin/user_edit.php?user_id=' . $user->getId());
1891
+        $tplMailBody->assign('manageUrl', api_get_path(WEB_CODE_PATH).'admin/user_edit.php?user_id='.$user->getId());
1892 1892
 
1893 1893
         $layoutContent = $tplMailBody->get_template('mail/new_user_mail_to_admin.tpl');
1894 1894
 
1895
-        $emailsubject = '[' . get_lang('UserRegistered') . '] ' . $user->getUsername();
1895
+        $emailsubject = '['.get_lang('UserRegistered').'] '.$user->getUsername();
1896 1896
         $emailbody = $tplMailBody->fetch($layoutContent);
1897 1897
 
1898 1898
         $admins = UserManager::get_all_administrators();
@@ -1923,8 +1923,8 @@  discard block
 block discarded – undo
1923 1923
      */
1924 1924
     public static function failedSentMailErrors()
1925 1925
     {
1926
-        $base = api_get_path(SYS_ARCHIVE_PATH) . 'mail/';
1927
-        $mailq = $base . 'mailq';
1926
+        $base = api_get_path(SYS_ARCHIVE_PATH).'mail/';
1927
+        $mailq = $base.'mailq';
1928 1928
 
1929 1929
         if (!file_exists($mailq) || !is_readable($mailq)) {
1930 1930
             return false;
@@ -1945,7 +1945,7 @@  discard block
 block discarded – undo
1945 1945
                 $mail_queue[$i]['code'] = $codeMatches[2];
1946 1946
             }
1947 1947
 
1948
-            $fullMail = $base . $mail_queue[$i]['code'];
1948
+            $fullMail = $base.$mail_queue[$i]['code'];
1949 1949
             $mailFile = fopen($fullMail, 'r');
1950 1950
 
1951 1951
             //Get the reason of mail fail
@@ -1968,7 +1968,7 @@  discard block
 block discarded – undo
1968 1968
 
1969 1969
             //Get the time of mail fail
1970 1970
             if (preg_match('/^\s?(\d+)(\D+)\s+(.*)$/', $line, $timeMatches)) {
1971
-                $mail_queue[$i]['time'] = $timeMatches[1] . $timeMatches[2];
1971
+                $mail_queue[$i]['time'] = $timeMatches[1].$timeMatches[2];
1972 1972
             } elseif (preg_match('/^(\s+)((.*)@(.*))\s+(.*)$/', $line, $emailMatches)) {
1973 1973
                 $mail_queue[$i]['mail'] = $emailMatches[2];
1974 1974
                 $i++;
Please login to merge, or discard this patch.
main/install/update-files-1.9.0-1.10.0.inc.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * current configuration file.
15 15
  * @package chamilo.install
16 16
  */
17
-error_log("Starting " . basename(__FILE__));
17
+error_log("Starting ".basename(__FILE__));
18 18
 
19 19
 global $debug;
20 20
 
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
 
144 144
     $list = scandir($langPath);
145 145
     foreach ($list as $entry) {
146
-        if (is_dir($langPath . $entry) &&
146
+        if (is_dir($langPath.$entry) &&
147 147
             in_array($entry, $officialLanguages)
148 148
         ) {
149 149
             foreach ($filesToDelete as $file) {
150
-                if (is_file($langPath . $entry . '/' . $file . '.inc.php')) {
151
-                    unlink($langPath . $entry . '/' . $file . '.inc.php');
150
+                if (is_file($langPath.$entry.'/'.$file.'.inc.php')) {
151
+                    unlink($langPath.$entry.'/'.$file.'.inc.php');
152 152
                 }
153 153
             }
154 154
         }
@@ -173,12 +173,12 @@  discard block
 block discarded – undo
173 173
 
174 174
     // Move dirs into new structures.
175 175
     $movePathList = [
176
-        api_get_path(SYS_CODE_PATH).'upload/users/groups' => api_get_path(SYS_UPLOAD_PATH) . 'groups',
177
-        api_get_path(SYS_CODE_PATH).'upload/users' => api_get_path(SYS_UPLOAD_PATH) . 'users',
178
-        api_get_path(SYS_CODE_PATH).'upload/badges' => api_get_path(SYS_UPLOAD_PATH) . 'badges',
179
-        api_get_path(SYS_PATH).'courses' => api_get_path(SYS_APP_PATH) . 'courses',
176
+        api_get_path(SYS_CODE_PATH).'upload/users/groups' => api_get_path(SYS_UPLOAD_PATH).'groups',
177
+        api_get_path(SYS_CODE_PATH).'upload/users' => api_get_path(SYS_UPLOAD_PATH).'users',
178
+        api_get_path(SYS_CODE_PATH).'upload/badges' => api_get_path(SYS_UPLOAD_PATH).'badges',
179
+        api_get_path(SYS_PATH).'courses' => api_get_path(SYS_APP_PATH).'courses',
180 180
         api_get_path(SYS_PATH).'searchdb' => api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/',
181
-        api_get_path(SYS_PATH).'home' => api_get_path(SYS_APP_PATH) . 'home'
181
+        api_get_path(SYS_PATH).'home' => api_get_path(SYS_APP_PATH).'home'
182 182
     ];
183 183
 
184 184
     if ($debug) {
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                 $fs->remove($origin);
200 200
             } catch (IOException $e) {
201 201
                 // If removing the directory doesn't work, just log an error and continue
202
-                error_log('Could not move ' . $origin . ' to ' . $destination . '(' . $e->getMessage() . '). Please move it manually.');
202
+                error_log('Could not move '.$origin.' to '.$destination.'('.$e->getMessage().'). Please move it manually.');
203 203
             }
204 204
         }
205 205
     }
@@ -246,5 +246,5 @@  discard block
 block discarded – undo
246 246
     @rrmdir(api_get_path(SYS_PATH).'archive');
247 247
 
248 248
 } else {
249
-    echo 'You are not allowed here !'. __FILE__;
249
+    echo 'You are not allowed here !'.__FILE__;
250 250
 }
Please login to merge, or discard this patch.
main/inc/lib/fileUpload.lib.php 1 patch
Spacing   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                 if ($show_output) {
95 95
                     Display::addFlash(
96 96
                         Display::return_message(
97
-                            get_lang('UplExceedMaxPostSize'). format_file_size($max_file_size),
97
+                            get_lang('UplExceedMaxPostSize').format_file_size($max_file_size),
98 98
                             'error'
99 99
                         )
100 100
                     );
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                 if ($show_output) {
119 119
                     Display::addFlash(
120 120
                         Display::return_message(
121
-                            get_lang('UplNoFileUploaded').' '. get_lang('UplSelectFileFirst'),
121
+                            get_lang('UplNoFileUploaded').' '.get_lang('UplSelectFileFirst'),
122 122
                             'error'
123 123
                         )
124 124
                     );
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
                             if ($output) {
473 473
                                 Display::addFlash(
474 474
                                     Display::return_message(
475
-                                        get_lang('UplUploadSucceeded') . '<br /> ' . $documentTitle . ' ' . get_lang('UplFileOverwritten'),
475
+                                        get_lang('UplUploadSucceeded').'<br /> '.$documentTitle.' '.get_lang('UplFileOverwritten'),
476 476
                                         'confirmation',
477 477
                                         false
478 478
                                     )
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
                         if ($output) {
610 610
                             Display::addFlash(
611 611
                                 Display::return_message(
612
-                                    get_lang('UplUploadSucceeded') . '<br />' . get_lang('UplFileSavedAs') . ' ' . $documentTitle,
612
+                                    get_lang('UplUploadSucceeded').'<br />'.get_lang('UplFileSavedAs').' '.$documentTitle,
613 613
                                     'success',
614 614
                                     false
615 615
                                 )
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
                             if ($output) {
687 687
                                 Display::addFlash(
688 688
                                     Display::display_confirmation_message(
689
-                                        get_lang('UplUploadSucceeded') . '<br /> ' . $documentTitle,
689
+                                        get_lang('UplUploadSucceeded').'<br /> '.$documentTitle,
690 690
                                         false,
691 691
                                         true
692 692
                                     )
@@ -772,12 +772,12 @@  discard block
 block discarded – undo
772 772
 function dir_total_space($dir_path)
773 773
 {
774 774
     $save_dir = getcwd();
775
-    chdir($dir_path) ;
775
+    chdir($dir_path);
776 776
     $handle = opendir($dir_path);
777 777
     $sumSize = 0;
778 778
     $dirList = array();
779 779
     while ($element = readdir($handle)) {
780
-        if ( $element == '.' || $element == '..') {
780
+        if ($element == '.' || $element == '..') {
781 781
             continue; // Skip the current and parent directories
782 782
         }
783 783
         if (is_file($element)) {
@@ -788,11 +788,11 @@  discard block
 block discarded – undo
788 788
         }
789 789
     }
790 790
 
791
-    closedir($handle) ;
791
+    closedir($handle);
792 792
 
793 793
     if (sizeof($dirList) > 0) {
794 794
         foreach ($dirList as $j) {
795
-            $sizeDir = dir_total_space($j);	// Recursivity
795
+            $sizeDir = dir_total_space($j); // Recursivity
796 796
             $sumSize += $sizeDir;
797 797
         }
798 798
     }
@@ -826,63 +826,63 @@  discard block
 block discarded – undo
826 826
 
827 827
         static $mime_type = array();
828 828
 
829
-        $mime_type[] = 'application/msword';             $extension[] = '.doc';
830
-        $mime_type[] = 'application/rtf';                $extension[] = '.rtf';
831
-        $mime_type[] = 'application/vnd.ms-powerpoint';  $extension[] = '.ppt';
832
-        $mime_type[] = 'application/vnd.ms-excel';       $extension[] = '.xls';
833
-        $mime_type[] = 'application/pdf';                $extension[] = '.pdf';
834
-        $mime_type[] = 'application/postscript';         $extension[] = '.ps';
835
-        $mime_type[] = 'application/mac-binhex40';       $extension[] = '.hqx';
836
-        $mime_type[] = 'application/x-gzip';             $extension[] = 'tar.gz';
837
-        $mime_type[] = 'application/x-shockwave-flash';  $extension[] = '.swf';
838
-        $mime_type[] = 'application/x-stuffit';          $extension[] = '.sit';
839
-        $mime_type[] = 'application/x-tar';              $extension[] = '.tar';
840
-        $mime_type[] = 'application/zip';                $extension[] = '.zip';
841
-        $mime_type[] = 'application/x-tar';              $extension[] = '.tar';
842
-        $mime_type[] = 'text/html';                      $extension[] = '.html';
843
-        $mime_type[] = 'text/plain';                     $extension[] = '.txt';
844
-        $mime_type[] = 'text/rtf';                       $extension[] = '.rtf';
845
-        $mime_type[] = 'img/gif';                        $extension[] = '.gif';
846
-        $mime_type[] = 'img/jpeg';                       $extension[] = '.jpg';
847
-        $mime_type[] = 'img/png';                        $extension[] = '.png';
848
-        $mime_type[] = 'audio/midi';                     $extension[] = '.mid';
849
-        $mime_type[] = 'audio/mpeg';                     $extension[] = '.mp3';
850
-        $mime_type[] = 'audio/x-aiff';                   $extension[] = '.aif';
851
-        $mime_type[] = 'audio/x-pn-realaudio';           $extension[] = '.rm';
852
-        $mime_type[] = 'audio/x-pn-realaudio-plugin';    $extension[] = '.rpm';
853
-        $mime_type[] = 'audio/x-wav';                    $extension[] = '.wav';
854
-        $mime_type[] = 'video/mpeg';                     $extension[] = '.mpg';
855
-        $mime_type[] = 'video/mpeg4-generic';            $extension[] = '.mp4';
856
-        $mime_type[] = 'video/quicktime';                $extension[] = '.mov';
857
-        $mime_type[] = 'video/x-msvideo';                $extension[] = '.avi';
858
-
859
-        $mime_type[] = 'video/x-ms-wmv';                 $extension[] = '.wmv';
860
-        $mime_type[] = 'video/x-flv';                    $extension[] = '.flv';
861
-        $mime_type[] = 'image/svg+xml';                  $extension[] = '.svg';
862
-        $mime_type[] = 'image/svg+xml';                  $extension[] = '.svgz';
863
-        $mime_type[] = 'video/ogg';                  	 $extension[] = '.ogv';
864
-        $mime_type[] = 'audio/ogg';                  	 $extension[] = '.oga';
865
-        $mime_type[] = 'application/ogg';                $extension[] = '.ogg';
866
-        $mime_type[] = 'application/ogg';                $extension[] = '.ogx';
867
-        $mime_type[] = 'application/x-freemind';         $extension[] = '.mm';
868
-
869
-        $mime_type[] = 'application/vnd.ms-word.document.macroEnabled.12';							$extension[] = '.docm';
870
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';	$extension[] = '.docx';
871
-        $mime_type[] = 'application/vnd.ms-word.template.macroEnabled.12';							$extension[] = '.dotm';
872
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template';	$extension[] = '.dotx';
873
-        $mime_type[] = 'application/vnd.ms-powerpoint.template.macroEnabled.12';					$extension[] = '.potm';
874
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.template';		$extension[] = '.potx';
875
-        $mime_type[] = 'application/vnd.ms-powerpoint.addin.macroEnabled.12';						$extension[] = '.ppam';
876
-        $mime_type[] = 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12';					$extension[] = '.ppsm';
877
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow';	$extension[] = '.ppsx';
878
-        $mime_type[] = 'application/vnd.ms-powerpoint.presentation.macroEnabled.12';				$extension[] = '.pptm';
879
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';	$extension[] = '.pptx';
880
-        $mime_type[] = 'application/vnd.ms-excel.addin.macroEnabled.12';							$extension[] = '.xlam';
881
-        $mime_type[] = 'application/vnd.ms-excel.sheet.binary.macroEnabled.12';						$extension[] = '.xlsb';
882
-        $mime_type[] = 'application/vnd.ms-excel.sheet.macroEnabled.12';							$extension[] = '.xlsm';
883
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';			$extension[] = '.xlsx';
884
-        $mime_type[] = 'application/vnd.ms-excel.template.macroEnabled.12';							$extension[] = '.xltm';
885
-        $mime_type[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template';		$extension[] = '.xltx';
829
+        $mime_type[] = 'application/msword'; $extension[] = '.doc';
830
+        $mime_type[] = 'application/rtf'; $extension[] = '.rtf';
831
+        $mime_type[] = 'application/vnd.ms-powerpoint'; $extension[] = '.ppt';
832
+        $mime_type[] = 'application/vnd.ms-excel'; $extension[] = '.xls';
833
+        $mime_type[] = 'application/pdf'; $extension[] = '.pdf';
834
+        $mime_type[] = 'application/postscript'; $extension[] = '.ps';
835
+        $mime_type[] = 'application/mac-binhex40'; $extension[] = '.hqx';
836
+        $mime_type[] = 'application/x-gzip'; $extension[] = 'tar.gz';
837
+        $mime_type[] = 'application/x-shockwave-flash'; $extension[] = '.swf';
838
+        $mime_type[] = 'application/x-stuffit'; $extension[] = '.sit';
839
+        $mime_type[] = 'application/x-tar'; $extension[] = '.tar';
840
+        $mime_type[] = 'application/zip'; $extension[] = '.zip';
841
+        $mime_type[] = 'application/x-tar'; $extension[] = '.tar';
842
+        $mime_type[] = 'text/html'; $extension[] = '.html';
843
+        $mime_type[] = 'text/plain'; $extension[] = '.txt';
844
+        $mime_type[] = 'text/rtf'; $extension[] = '.rtf';
845
+        $mime_type[] = 'img/gif'; $extension[] = '.gif';
846
+        $mime_type[] = 'img/jpeg'; $extension[] = '.jpg';
847
+        $mime_type[] = 'img/png'; $extension[] = '.png';
848
+        $mime_type[] = 'audio/midi'; $extension[] = '.mid';
849
+        $mime_type[] = 'audio/mpeg'; $extension[] = '.mp3';
850
+        $mime_type[] = 'audio/x-aiff'; $extension[] = '.aif';
851
+        $mime_type[] = 'audio/x-pn-realaudio'; $extension[] = '.rm';
852
+        $mime_type[] = 'audio/x-pn-realaudio-plugin'; $extension[] = '.rpm';
853
+        $mime_type[] = 'audio/x-wav'; $extension[] = '.wav';
854
+        $mime_type[] = 'video/mpeg'; $extension[] = '.mpg';
855
+        $mime_type[] = 'video/mpeg4-generic'; $extension[] = '.mp4';
856
+        $mime_type[] = 'video/quicktime'; $extension[] = '.mov';
857
+        $mime_type[] = 'video/x-msvideo'; $extension[] = '.avi';
858
+
859
+        $mime_type[] = 'video/x-ms-wmv'; $extension[] = '.wmv';
860
+        $mime_type[] = 'video/x-flv'; $extension[] = '.flv';
861
+        $mime_type[] = 'image/svg+xml'; $extension[] = '.svg';
862
+        $mime_type[] = 'image/svg+xml'; $extension[] = '.svgz';
863
+        $mime_type[] = 'video/ogg'; $extension[] = '.ogv';
864
+        $mime_type[] = 'audio/ogg'; $extension[] = '.oga';
865
+        $mime_type[] = 'application/ogg'; $extension[] = '.ogg';
866
+        $mime_type[] = 'application/ogg'; $extension[] = '.ogx';
867
+        $mime_type[] = 'application/x-freemind'; $extension[] = '.mm';
868
+
869
+        $mime_type[] = 'application/vnd.ms-word.document.macroEnabled.12'; $extension[] = '.docm';
870
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; $extension[] = '.docx';
871
+        $mime_type[] = 'application/vnd.ms-word.template.macroEnabled.12'; $extension[] = '.dotm';
872
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'; $extension[] = '.dotx';
873
+        $mime_type[] = 'application/vnd.ms-powerpoint.template.macroEnabled.12'; $extension[] = '.potm';
874
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.template'; $extension[] = '.potx';
875
+        $mime_type[] = 'application/vnd.ms-powerpoint.addin.macroEnabled.12'; $extension[] = '.ppam';
876
+        $mime_type[] = 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12'; $extension[] = '.ppsm';
877
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow'; $extension[] = '.ppsx';
878
+        $mime_type[] = 'application/vnd.ms-powerpoint.presentation.macroEnabled.12'; $extension[] = '.pptm';
879
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; $extension[] = '.pptx';
880
+        $mime_type[] = 'application/vnd.ms-excel.addin.macroEnabled.12'; $extension[] = '.xlam';
881
+        $mime_type[] = 'application/vnd.ms-excel.sheet.binary.macroEnabled.12'; $extension[] = '.xlsb';
882
+        $mime_type[] = 'application/vnd.ms-excel.sheet.macroEnabled.12'; $extension[] = '.xlsm';
883
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; $extension[] = '.xlsx';
884
+        $mime_type[] = 'application/vnd.ms-excel.template.macroEnabled.12'; $extension[] = '.xltm';
885
+        $mime_type[] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'; $extension[] = '.xltx';
886 886
 
887 887
         // Test on PC (files with no extension get application/octet-stream)
888 888
         //$mime_type[] = 'application/octet-stream';      $extension[] = '.ext';
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
 
892 892
         foreach ($mime_type as $key => & $type) {
893 893
             if ($type == $file_type) {
894
-                $file_name .=  $extension[$key];
894
+                $file_name .= $extension[$key];
895 895
                 break;
896 896
             }
897 897
         }
@@ -967,12 +967,12 @@  discard block
 block discarded – undo
967 967
         }
968 968
 
969 969
         // It happens on Linux that $upload_path sometimes doesn't start with '/'
970
-        if ($upload_path[0] != '/' && substr($base_work_dir,-1,1) != '/') {
970
+        if ($upload_path[0] != '/' && substr($base_work_dir, -1, 1) != '/') {
971 971
             $upload_path = '/'.$upload_path;
972 972
         }
973 973
 
974 974
         if ($upload_path[strlen($upload_path) - 1] == '/') {
975
-            $upload_path=substr($upload_path, 0, -1);
975
+            $upload_path = substr($upload_path, 0, -1);
976 976
         }
977 977
 
978 978
         /*	Uncompressing phase */
@@ -984,15 +984,15 @@  discard block
 block discarded – undo
984 984
             - add it to the database
985 985
             - parse & change relative html links
986 986
         */
987
-        if (PHP_OS == 'Linux' && ! get_cfg_var('safe_mode') && false) { // *** UGent, changed by OC ***
987
+        if (PHP_OS == 'Linux' && !get_cfg_var('safe_mode') && false) { // *** UGent, changed by OC ***
988 988
             // Shell Method - if this is possible, it gains some speed
989
-            exec("unzip -d \"".$base_work_dir.$upload_path."/\"".$uploaded_file['name']." " .$uploaded_file['tmp_name']);
989
+            exec("unzip -d \"".$base_work_dir.$upload_path."/\"".$uploaded_file['name']." ".$uploaded_file['tmp_name']);
990 990
         } else {
991 991
             // PHP method - slower...
992 992
             $save_dir = getcwd();
993 993
             chdir($base_work_dir.$upload_path);
994 994
             $unzippingState = $zip_file->extract();
995
-            for ($j=0; $j < count($unzippingState); $j++) {
995
+            for ($j = 0; $j < count($unzippingState); $j++) {
996 996
                 $state = $unzippingState[$j];
997 997
 
998 998
                 // Fix relative links in html files
@@ -1006,8 +1006,8 @@  discard block
 block discarded – undo
1006 1006
                         if (is_dir($base_work_dir.$upload_path.'/'.$file)) $filetype = 'folder';
1007 1007
 
1008 1008
                         $safe_file = api_replace_dangerous_char($file);
1009
-                        @rename($base_work_dir.$upload_path.'/'.$file,$base_work_dir.$upload_path.'/'.$safe_file);
1010
-                        set_default_settings($upload_path, $safe_file,$filetype);
1009
+                        @rename($base_work_dir.$upload_path.'/'.$file, $base_work_dir.$upload_path.'/'.$safe_file);
1010
+                        set_default_settings($upload_path, $safe_file, $filetype);
1011 1011
                     }
1012 1012
                 }
1013 1013
 
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
     $zip = new PclZip($uploaded_file['tmp_name']);
1058 1058
 
1059 1059
     // Check the zip content (real size and file extension)
1060
-    $zip_content_array = (array)$zip->listContent();
1060
+    $zip_content_array = (array) $zip->listContent();
1061 1061
 
1062 1062
     $realSize = 0;
1063 1063
     foreach ($zip_content_array as & $this_content) {
@@ -1159,7 +1159,7 @@  discard block
 block discarded – undo
1159 1159
 function filter_extension(&$filename)
1160 1160
 {
1161 1161
     if (substr($filename, -1) == '/') {
1162
-        return 1;  // Authorize directories
1162
+        return 1; // Authorize directories
1163 1163
     }
1164 1164
     $blacklist = api_get_setting('upload_extensions_list_type');
1165 1165
     if ($blacklist != 'whitelist') { // if = blacklist
@@ -1392,9 +1392,9 @@  discard block
 block discarded – undo
1392 1392
     $upload_path = str_replace('//', '/', $upload_path);
1393 1393
 
1394 1394
     if ($upload_path == '/') {
1395
-        $upload_path='';
1395
+        $upload_path = '';
1396 1396
     } elseif (!empty($upload_path) && $upload_path[0] != '/') {
1397
-        $upload_path="/$upload_path";
1397
+        $upload_path = "/$upload_path";
1398 1398
     }
1399 1399
 
1400 1400
     $endchar = substr($filename, strlen($filename) - 1, 1);
@@ -1432,7 +1432,7 @@  discard block
 block discarded – undo
1432 1432
     $img_path_list = array();
1433 1433
 
1434 1434
     if (!$fp = fopen($html_file, 'r')) {
1435
-        return ;
1435
+        return;
1436 1436
     }
1437 1437
 
1438 1438
     // Aearch and store occurences of the <img> tag in an array
@@ -1452,7 +1452,7 @@  discard block
 block discarded – undo
1452 1452
         $img_tag_list = $matches[0];
1453 1453
     }
1454 1454
 
1455
-    fclose ($fp);
1455
+    fclose($fp);
1456 1456
     unset($buffer);
1457 1457
 
1458 1458
     // Search the image file path from all the <IMG> tag detected
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
 
1552 1552
     if (!is_dir($base_work_dir.$systemFolderName)) {
1553 1553
         $result = mkdir(
1554
-            $base_work_dir . $systemFolderName,
1554
+            $base_work_dir.$systemFolderName,
1555 1555
             api_get_permissions_for_new_directories(),
1556 1556
             true
1557 1557
         );
@@ -1564,7 +1564,7 @@  discard block
 block discarded – undo
1564 1564
                     WHERE
1565 1565
                         c_id = $course_id AND
1566 1566
                         (
1567
-                            path = '" . Database::escape_string($systemFolderName). "'
1567
+                            path = '".Database::escape_string($systemFolderName)."'
1568 1568
                         )
1569 1569
             ";
1570 1570
 
@@ -1721,7 +1721,7 @@  discard block
 block discarded – undo
1721 1721
 
1722 1722
     // Fix the image tags
1723 1723
 
1724
-    for ($i = 0, $fileNb = count($original_img_path); $i < $fileNb ; $i++) {
1724
+    for ($i = 0, $fileNb = count($original_img_path); $i < $fileNb; $i++) {
1725 1725
         $replace_what = $original_img_path[$i];
1726 1726
         // We only need the directory and the filename /path/to/file_html_files/missing_file.gif -> file_html_files/missing_file.gif
1727 1727
         $exploded_file_path = explode('/', $new_img_path[$i]);
@@ -1762,7 +1762,7 @@  discard block
 block discarded – undo
1762 1762
         .'</body>'
1763 1763
         .'</html>';
1764 1764
     if (file_exists($file_path)) {
1765
-        if (!($fp = fopen ($file_path, 'w'))) {
1765
+        if (!($fp = fopen($file_path, 'w'))) {
1766 1766
             return false;
1767 1767
         }
1768 1768
         return fwrite($fp, $file_content);
@@ -1799,7 +1799,7 @@  discard block
 block discarded – undo
1799 1799
 {
1800 1800
     // Do we need a / or not?
1801 1801
     $added_slash = ($upload_path == '/') ? '' : '/';
1802
-    $folder_id      = DocumentManager::get_document_id(api_get_course_info(), $upload_path);
1802
+    $folder_id = DocumentManager::get_document_id(api_get_course_info(), $upload_path);
1803 1803
     // Build the form
1804 1804
     $form = "<p><strong>".get_lang('MissingImagesDetected')."</strong></p>"
1805 1805
         ."<form method=\"post\" action=\"".api_get_self()."\" enctype=\"multipart/form-data\">"
Please login to merge, or discard this patch.
main/inc/local.inc.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
             // is necessary verify check
218 218
             if ($legal_type == 1) {
219
-                if ((isset($_POST['legal_accept']) && $_POST['legal_accept']=='1')) {
219
+                if ((isset($_POST['legal_accept']) && $_POST['legal_accept'] == '1')) {
220 220
                     $legal_option = true;
221 221
                 } else {
222 222
                     $legal_option = false;
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
                  * Process external authentication
505 505
                  * on the basis of the given login name
506 506
                  */
507
-                $loginFailed = true;  // Default initialisation. It could
507
+                $loginFailed = true; // Default initialisation. It could
508 508
                 // change after the external authentication
509 509
                 $key = $uData['auth_source']; //'ldap','shibboleth'...
510 510
 
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
                      * Process external authentication
550 550
                      * on the basis of the given login name
551 551
                      */
552
-                    $loginFailed = true;  // Default initialisation. It could
552
+                    $loginFailed = true; // Default initialisation. It could
553 553
                     // change after the external authentication
554 554
                     $key = $uData['auth_source']; //'ldap','shibboleth'...
555 555
 
@@ -560,11 +560,11 @@  discard block
 block discarded – undo
560 560
             } else {
561 561
                 // change after the external authentication
562 562
                 // login failed, Database::num_rows($result) <= 0
563
-                $loginFailed = true;  // Default initialisation. It could
563
+                $loginFailed = true; // Default initialisation. It could
564 564
             }
565 565
 
566 566
             // login failed, Database::num_rows($result) <= 0
567
-            $loginFailed = true;  // Default initialisation. It could
567
+            $loginFailed = true; // Default initialisation. It could
568 568
             // change after the external authentication
569 569
 
570 570
             /*
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
                         include_once($thisAuthSource['newUser']);
594 594
                     } else {
595 595
                         error_log(
596
-                            'Chamilo Authentication external file' .
596
+                            'Chamilo Authentication external file'.
597 597
                             ' could not be found - this might prevent your system from using'.
598 598
                             ' the authentication process in the user creation process',
599 599
                             0
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
             online_logout(null, false);
706 706
             $osso->logout(); //redirects and exits
707 707
         }
708
-    } elseif (api_get_setting('openid_authentication')=='true') {
708
+    } elseif (api_get_setting('openid_authentication') == 'true') {
709 709
         if (!empty($_POST['openid_url'])) {
710 710
             include api_get_path(SYS_CODE_PATH).'auth/openid/login.php';
711 711
             openid_begin(trim($_POST['openid_url']), api_get_path(WEB_PATH).'index.php');
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
             if ($res['status'] == 'success') {
719 719
                 $id1 = Database::escape_string($res['openid.identity']);
720 720
                 //have another id with or without the final '/'
721
-                $id2 = (substr($id1, -1, 1)=='/'?substr($id1, 0, -1):$id1.'/');
721
+                $id2 = (substr($id1, -1, 1) == '/' ? substr($id1, 0, -1) : $id1.'/');
722 722
                 //lookup the user in the main database
723 723
                 $user_table = Database::get_main_table(TABLE_MAIN_USER);
724 724
                 $sql = "SELECT user_id, username, password, auth_source, active, expiration_date
@@ -727,14 +727,14 @@  discard block
 block discarded – undo
727 727
                         OR openid = '$id2' ";
728 728
                 $result = Database::query($sql);
729 729
                 if ($result !== false) {
730
-                    if (Database::num_rows($result)>0) {
730
+                    if (Database::num_rows($result) > 0) {
731 731
                         $uData = Database::fetch_array($result);
732 732
 
733 733
                         if ($uData['auth_source'] == PLATFORM_AUTH_SOURCE) {
734 734
                             //the authentification of this user is managed by Chamilo itself
735 735
 
736 736
                             // check if the account is active (not locked)
737
-                            if ($uData['active']=='1') {
737
+                            if ($uData['active'] == '1') {
738 738
                                 // check if the expiration date has not been reached
739 739
                                 if ($uData['expiration_date'] > date('Y-m-d H:i:s')
740 740
                                     || empty($uData['expiration_date'])
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
     (isset($_SESSION['_cid']) && $cidReq != $_SESSION['_cid']))
814 814
 ) {
815 815
     $cidReset = true;
816
-    $gidReset = true;    // As groups depend from courses, group id is reset
816
+    $gidReset = true; // As groups depend from courses, group id is reset
817 817
 }
818 818
 
819 819
 /* USER INIT */
@@ -957,8 +957,8 @@  discard block
 block discarded – undo
957 957
             $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
958 958
 
959 959
             if (!empty($_GET['id_session'])) {
960
-                $sql = 'SELECT name FROM '.$tbl_session . '
961
-                        WHERE id="'.intval($_GET['id_session']) . '"';
960
+                $sql = 'SELECT name FROM '.$tbl_session.'
961
+                        WHERE id="'.intval($_GET['id_session']).'"';
962 962
                 $rs = Database::query($sql);
963 963
                 if (Database::num_rows($rs)) {
964 964
                     list($_SESSION['session_name']) = Database::fetch_array($rs);
@@ -1045,7 +1045,7 @@  discard block
 block discarded – undo
1045 1045
         // Moreover, if we want to track a course with another session it can be usefull
1046 1046
         if (!empty($_GET['id_session']) && is_numeric($_GET['id_session'])) {
1047 1047
             $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
1048
-            $sql = 'SELECT name FROM '.$tbl_session . ' WHERE id="'.intval($_GET['id_session']). '"';
1048
+            $sql = 'SELECT name FROM '.$tbl_session.' WHERE id="'.intval($_GET['id_session']).'"';
1049 1049
             $rs = Database::query($sql);
1050 1050
             if (Database::num_rows($rs)) {
1051 1051
                 list($_SESSION['session_name']) = Database::fetch_array($rs);
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
                     }
1170 1170
                 }
1171 1171
                 $url = api_get_path(WEB_CODE_PATH).'auth/inscription.php';
1172
-                header("Location:". $url);
1172
+                header("Location:".$url);
1173 1173
                 exit;
1174 1174
             }
1175 1175
         }
@@ -1189,8 +1189,8 @@  discard block
 block discarded – undo
1189 1189
         if (Database::num_rows($result) > 0) { // this  user have a recorded state for this course
1190 1190
             $cuData = Database::fetch_array($result, 'ASSOC');
1191 1191
 
1192
-            $is_courseAdmin = (bool)($cuData['status'] == 1);
1193
-            $is_courseTutor = (bool)($cuData['is_tutor'] == 1);
1192
+            $is_courseAdmin = (bool) ($cuData['status'] == 1);
1193
+            $is_courseTutor = (bool) ($cuData['is_tutor'] == 1);
1194 1194
             $is_courseMember = true;
1195 1195
         }
1196 1196
 
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
                 // This user has no status related to this course
1202 1202
                 // The user is subscribed in a session? The user is a Session coach a Session admin ?
1203 1203
 
1204
-                $tbl_session  = Database :: get_main_table(TABLE_MAIN_SESSION);
1204
+                $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
1205 1205
                 $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
1206 1206
                 $tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
1207 1207
 
@@ -1506,12 +1506,12 @@  discard block
 block discarded – undo
1506 1506
     ($logging_in && exist_firstpage_parameter())
1507 1507
 ) {
1508 1508
     $redirectCourseDir = api_get_firstpage_parameter();
1509
-    api_delete_firstpage_parameter();    // delete the cookie
1509
+    api_delete_firstpage_parameter(); // delete the cookie
1510 1510
 
1511 1511
     if (!isset($_SESSION['request_uri'])) {
1512 1512
         if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
1513 1513
             $_SESSION['noredirection'] = false;
1514
-            $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/';
1514
+            $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/';
1515 1515
         }
1516 1516
     }
1517 1517
 } elseif (api_user_is_login() && exist_firstpage_parameter()) {
@@ -1519,7 +1519,7 @@  discard block
 block discarded – undo
1519 1519
     api_delete_firstpage_parameter(); // delete the cookie
1520 1520
     if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
1521 1521
         $_SESSION['noredirection'] = false;
1522
-        $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/';
1522
+        $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/';
1523 1523
     }
1524 1524
 }
1525 1525
 
Please login to merge, or discard this patch.
main/attendance/attendance_controller.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -550,17 +550,17 @@  discard block
 block discarded – undo
550 550
             }
551 551
         }
552 552
         $max_cols_per_page = 12; //10 dates + 2 name and number
553
-        $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2;//10
553
+        $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2; //10
554 554
         $rows = count($data_table);
555 555
 
556 556
         if ($cols > $max_cols_per_page) {
557
-            $number_tables = round(($cols-2)/$max_dates_per_page);
557
+            $number_tables = round(($cols - 2) / $max_dates_per_page);
558 558
             $headers = $data_table[0];
559 559
             $all = array();
560 560
             $tables = array();
561 561
             $changed = 1;
562 562
 
563
-            for ($i= 0; $i <= $rows; $i++) {
563
+            for ($i = 0; $i <= $rows; $i++) {
564 564
                 $row = isset($data_table[$i]) ? $data_table[$i] : null;
565 565
                 $key = 1;
566 566
                 $max_dates_per_page = 10;
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
                     foreach ($item as $value) {
572 572
                         if ($count_j >= $max_dates_per_page) {
573 573
                             $key++;
574
-                            $max_dates_per_page = $max_dates_per_page_original*$key;
574
+                            $max_dates_per_page = $max_dates_per_page_original * $key;
575 575
                             //magic hack
576 576
                             $tables[$key][$i][] = $tables[1][$i][0];
577 577
                             $tables[$key][$i][] = $tables[1][$i][1];
@@ -628,8 +628,8 @@  discard block
 block discarded – undo
628 628
             $form = new FormValidator(
629 629
                 'search',
630 630
                 'post',
631
-                api_get_self() . '?' . api_get_cidreq(
632
-                ) . '&action=calendar_logins'
631
+                api_get_self().'?'.api_get_cidreq(
632
+                ).'&action=calendar_logins'
633 633
             );
634 634
             $form->addDateRangePicker('range', get_lang('DateRange'));
635 635
             $form->addButton('submit', get_lang('Submit'));
Please login to merge, or discard this patch.