Completed
Push — 1.11.x ( 6904fa...6a92e6 )
by José
525:44 queued 484:20
created
main/dropbox/dropbox_functions.inc.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
     // STEP 2: at least one file has to be selected. If not we return an error message
43 43
     $ids = isset($_GET['id']) ? $_GET['id'] : array();
44
-    if (count($ids)>0) {
44
+    if (count($ids) > 0) {
45 45
         $checked_file_ids = $_POST['id'];
46 46
     } else {
47 47
         foreach ($_POST as $key => $value) {
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     }
134 134
 
135 135
     $cat = get_dropbox_category($id);
136
-    if (count($cat)==0) {
136
+    if (count($cat) == 0) {
137 137
         return false;
138 138
     }
139 139
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
             WHERE c_id = $course_id AND cat_id='".intval($id)."'";
167 167
     $result = Database::query($sql);
168 168
 
169
-    while($row = Database::fetch_array($result)) {
169
+    while ($row = Database::fetch_array($result)) {
170 170
         $dropboxfile = new Dropbox_Person($user_id, $is_courseAdmin, $is_courseTutor);
171 171
         if ($action == 'deletereceivedcategory') {
172 172
             $dropboxfile->deleteReceivedWork($row[$id_field]);
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
 
658 658
                 $full_name = $userInfo['complete_name'].$groupNameListToString;
659 659
                 $current_user_id = $current_user['user_id'];
660
-                $options['user_' . $current_user_id] = $full_name;
660
+                $options['user_'.$current_user_id] = $full_name;
661 661
             }
662 662
         }
663 663
     }
@@ -706,11 +706,11 @@  discard block
 block discarded – undo
706 706
 
707 707
     $mailingId = $id - dropbox_cnf('mailingIdBase');
708 708
     if ($mailingId > 0) {
709
-        return get_lang('MailingAsUsername', '') . $mailingId;
709
+        return get_lang('MailingAsUsername', '').$mailingId;
710 710
     }
711 711
     $id = intval($id);
712 712
     $sql = "SELECT ".(api_is_western_name_order() ? "CONCAT(firstname,' ', lastname)" : "CONCAT(lastname,' ', firstname)")." AS name
713
-            FROM " . $dropbox_cnf['tbl_user'] . "
713
+            FROM " . $dropbox_cnf['tbl_user']."
714 714
             WHERE user_id='$id'";
715 715
     $result = Database::query($sql);
716 716
     $res = Database::fetch_array($result);
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
 {
731 731
     $id = intval($id);
732 732
     $sql = "SELECT username
733
-            FROM " . dropbox_cnf('tbl_user') . "
733
+            FROM " . dropbox_cnf('tbl_user')."
734 734
             WHERE user_id='$id'";
735 735
     $result = Database::query($sql);
736 736
     $res = Database::fetch_array($result);
@@ -762,8 +762,8 @@  discard block
 block discarded – undo
762 762
 
763 763
     // select all files that aren't referenced anymore
764 764
     $sql = "SELECT DISTINCT f.id, f.filename
765
-            FROM " . dropbox_cnf('tbl_file') . " f
766
-            LEFT JOIN " . dropbox_cnf('tbl_person') . " p
765
+            FROM " . dropbox_cnf('tbl_file')." f
766
+            LEFT JOIN " . dropbox_cnf('tbl_person')." p
767 767
             ON (f.id = p.file_id)
768 768
             WHERE p.user_id IS NULL AND
769 769
                   f.c_id = $course_id
@@ -771,14 +771,14 @@  discard block
 block discarded – undo
771 771
     $result = Database::query($sql);
772 772
     while ($res = Database::fetch_array($result)) {
773 773
         //delete the selected files from the post and file tables
774
-        $sql = "DELETE FROM " . dropbox_cnf('tbl_post') . "
775
-                WHERE c_id = $course_id AND file_id = '" . $res['id'] . "'";
774
+        $sql = "DELETE FROM ".dropbox_cnf('tbl_post')."
775
+                WHERE c_id = $course_id AND file_id = '".$res['id']."'";
776 776
         Database::query($sql);
777
-        $sql = "DELETE FROM " . dropbox_cnf('tbl_file') . "
778
-                WHERE c_id = $course_id AND id ='" . $res['id'] . "'";
777
+        $sql = "DELETE FROM ".dropbox_cnf('tbl_file')."
778
+                WHERE c_id = $course_id AND id ='".$res['id']."'";
779 779
         Database::query($sql);
780 780
         //delete file from server
781
-        @unlink( dropbox_cnf('sysPath') . '/' . $res['filename']);
781
+        @unlink(dropbox_cnf('sysPath').'/'.$res['filename']);
782 782
     }
783 783
 }
784 784
 
@@ -801,11 +801,11 @@  discard block
 block discarded – undo
801 801
 
802 802
     $mailingPseudoId = intval($mailingPseudoId);
803 803
     $sql = "SELECT f.uploader_id
804
-            FROM " . $dropbox_cnf['tbl_file'] . " f
805
-            LEFT JOIN " . $dropbox_cnf['tbl_post'] . " p
804
+            FROM " . $dropbox_cnf['tbl_file']." f
805
+            LEFT JOIN " . $dropbox_cnf['tbl_post']." p
806 806
             ON (f.id = p.file_id AND f.c_id = $course_id AND p.c_id = $course_id)
807 807
             WHERE
808
-                p.dest_user_id = '" . $mailingPseudoId . "' AND
808
+                p.dest_user_id = '".$mailingPseudoId."' AND
809 809
                 p.c_id = $course_id
810 810
             ";
811 811
     $result = Database::query($sql);
@@ -832,20 +832,20 @@  discard block
 block discarded – undo
832 832
     //    for all content files, replace mailingPseudoId by owner as uploader
833 833
     $file_id = intval($file_id);
834 834
     $sql = "SELECT p.dest_user_id
835
-            FROM " . $dropbox_cnf['tbl_post'] . " p
836
-            WHERE c_id = $course_id AND p.file_id = '" . $file_id . "'";
835
+            FROM " . $dropbox_cnf['tbl_post']." p
836
+            WHERE c_id = $course_id AND p.file_id = '".$file_id."'";
837 837
     $result = Database::query($sql);
838 838
 
839 839
     if ($res = Database::fetch_array($result)) {
840 840
         $mailingPseudoId = $res['dest_user_id'];
841 841
         if ($mailingPseudoId > dropbox_cnf('mailingIdBase')) {
842
-            $sql = "DELETE FROM " . dropbox_cnf('tbl_person') . "
843
-                    WHERE c_id = $course_id AND user_id='" . $mailingPseudoId . "'";
842
+            $sql = "DELETE FROM ".dropbox_cnf('tbl_person')."
843
+                    WHERE c_id = $course_id AND user_id='".$mailingPseudoId."'";
844 844
             Database::query($sql);
845 845
 
846
-            $sql = "UPDATE " . dropbox_cnf('tbl_file') ."
847
-                    SET uploader_id='" . api_get_user_id() . "'
848
-                    WHERE c_id = $course_id AND uploader_id='" . $mailingPseudoId . "'";
846
+            $sql = "UPDATE ".dropbox_cnf('tbl_file')."
847
+                    SET uploader_id='" . api_get_user_id()."'
848
+                    WHERE c_id = $course_id AND uploader_id='".$mailingPseudoId."'";
849 849
             Database::query($sql);
850 850
         }
851 851
     }
@@ -984,7 +984,7 @@  discard block
 block discarded – undo
984 984
             }
985 985
         }
986 986
     } else {  // rename file to login_filename_uniqueId format
987
-        $dropbox_filename = getLoginFromId($_user['user_id']) . "_" . $dropbox_filename . "_".uniqid('');
987
+        $dropbox_filename = getLoginFromId($_user['user_id'])."_".$dropbox_filename."_".uniqid('');
988 988
     }
989 989
 
990 990
     // creating the array that contains all the users who will receive the file
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
         }
1003 1003
     }
1004 1004
 
1005
-    @move_uploaded_file($dropbox_filetmpname, dropbox_cnf('sysPath') . '/' . $dropbox_filename);
1005
+    @move_uploaded_file($dropbox_filetmpname, dropbox_cnf('sysPath').'/'.$dropbox_filename);
1006 1006
 
1007 1007
     $b_send_mail = api_get_course_setting('email_alert_on_new_doc_dropbox');
1008 1008
 
@@ -1023,14 +1023,14 @@  discard block
 block discarded – undo
1023 1023
                 ),
1024 1024
                 $recipent_temp['email'],
1025 1025
                 get_lang('NewDropboxFileUploaded'),
1026
-                get_lang('NewDropboxFileUploadedContent').' <a href="'.api_get_path(WEB_CODE_PATH).'dropbox/index.php?' . api_get_cidreq() . '">'.get_lang('SeeFile').'</a>'.
1026
+                get_lang('NewDropboxFileUploadedContent').' <a href="'.api_get_path(WEB_CODE_PATH).'dropbox/index.php?'.api_get_cidreq().'">'.get_lang('SeeFile').'</a>'.
1027 1027
                 "\n\n".
1028 1028
                 api_get_person_name(
1029 1029
                     $_user['firstName'],
1030 1030
                     $_user['lastName'],
1031 1031
                     null,
1032 1032
                     PERSON_NAME_EMAIL_ADDRESS
1033
-                )."\n".  get_lang('Email') ." : ".$_user['mail'],
1033
+                )."\n".get_lang('Email')." : ".$_user['mail'],
1034 1034
                 api_get_person_name(
1035 1035
                     $_user['firstName'],
1036 1036
                     $_user['lastName'],
@@ -1308,7 +1308,7 @@  discard block
 block discarded – undo
1308 1308
         // Adding the content.
1309 1309
         $return .= "\n<tr>";
1310 1310
         foreach ($column as $column_key => $column_value) {
1311
-            if (!in_array($column_value,$dont_show_columns)) {
1311
+            if (!in_array($column_value, $dont_show_columns)) {
1312 1312
                 $return .= "\n\t<td>";
1313 1313
                 if (in_array($column_value, $make_link)) {
1314 1314
                     $return .= '<a href="'.$value[$column_value].'">'.$value[$column_value].'</a>';
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
             WHERE c_id = $course_id GROUP BY file_id";
1342 1342
     $result = Database::query($sql);
1343 1343
     $return = array();
1344
-    while ($row=Database::fetch_array($result)) {
1344
+    while ($row = Database::fetch_array($result)) {
1345 1345
         $return[$row['file_id']] = $row['total'];
1346 1346
     }
1347 1347
     return $return;
Please login to merge, or discard this patch.
main/dropbox/recover_dropbox_files.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 $result = Database::query($sql);
34 34
 
35 35
 if (Database::num_rows($result)) {
36
-    $files  = Database::store_result($result);
36
+    $files = Database::store_result($result);
37 37
     $rows = array();
38 38
     foreach ($files as $file) {
39 39
         //Check if I have this file:
Please login to merge, or discard this patch.
main/dropbox/dropbox_init.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 $is_courseTutor = api_is_course_tutor();
127 127
 $is_courseAdmin = api_is_course_admin();
128 128
 
129
-$current_course_tool  = TOOL_DROPBOX;
129
+$current_course_tool = TOOL_DROPBOX;
130 130
 
131 131
 // the dropbox configuration parameters
132 132
 $dropbox_cnf = require_once 'dropbox_config.inc.php';
@@ -278,10 +278,10 @@  discard block
 block discarded – undo
278 278
 $javascript .= "
279 279
 	</script>";
280 280
 $htmlHeadXtra[] = $javascript;
281
-$htmlHeadXtra[] ="<script>
281
+$htmlHeadXtra[] = "<script>
282 282
 function confirmation (name)
283 283
 {
284
-	if (confirm(\" ". get_lang("AreYouSureToDeleteJS") ." \"+ name + \" ?\"))
284
+	if (confirm(\" ". get_lang("AreYouSureToDeleteJS")." \"+ name + \" ?\"))
285 285
 		{return true;}
286 286
 	else
287 287
 		{return false;}
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
 if ((!$is_allowed_in_course || !$is_course_member) && !api_is_allowed_to_edit(null, true)) {
323 323
     if ($origin != 'learnpath') {
324
-        api_not_allowed(true);//print headers/footers
324
+        api_not_allowed(true); //print headers/footers
325 325
     } else {
326 326
         api_not_allowed();
327 327
     }
Please login to merge, or discard this patch.
main/dropbox/index.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -220,23 +220,23 @@  discard block
 block discarded – undo
220 220
 
221 221
 		if (api_get_session_id() == 0) {
222 222
 			echo '<div class="actions">';
223
-			if ($view_dropbox_category_received != 0  && api_is_allowed_to_session_edit(false, true)) {
224
-				echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
223
+			if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) {
224
+				echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'), '', ICON_SIZE_MEDIUM)."</a>";
225 225
 				echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> ';
226 226
 				$movelist[0] = 'Root'; // move_received selectbox content
227 227
 			} else {
228
-				echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM).'</a>';
228
+				echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'), '', ICON_SIZE_MEDIUM).'</a>';
229 229
 			}
230 230
 			echo '</div>';
231 231
 		} else {
232 232
 			if (api_is_allowed_to_session_edit(false, true)) {
233 233
 				echo '<div class="actions">';
234 234
 				if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) {
235
-					echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
235
+					echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'), '', ICON_SIZE_MEDIUM)."</a>";
236 236
 					echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> ';
237 237
 					$movelist[0] = 'Root'; // move_received selectbox content
238 238
 				} else {
239
-					echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM).'</a>';
239
+					echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'), '', ICON_SIZE_MEDIUM).'</a>';
240 240
 				}
241 241
 				echo '</div>';
242 242
 			}
@@ -256,13 +256,13 @@  discard block
 block discarded – undo
256 256
 		if (api_get_session_id() == 0) {
257 257
 			echo '<div class="actions">';
258 258
 			if ($view_dropbox_category_sent != 0) {
259
-				echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
259
+				echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'), '', ICON_SIZE_MEDIUM)."</a>";
260 260
 				echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> ';
261 261
 			} else {
262
-				echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM)."</a>\n";
262
+				echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'), '', ICON_SIZE_MEDIUM)."</a>\n";
263 263
 			}
264 264
 			if (empty($viewSentCategory)) {
265
-				echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'),'',ICON_SIZE_MEDIUM)."</a>";
265
+				echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'), '', ICON_SIZE_MEDIUM)."</a>";
266 266
 			}
267 267
 			echo '</div>';
268 268
 		} else {
@@ -270,12 +270,12 @@  discard block
 block discarded – undo
270 270
 				echo '<div class="actions">';
271 271
 				if ($view_dropbox_category_sent != 0) {
272 272
 					echo get_lang('CurrentlySeeing').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> ';
273
-					echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
273
+					echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'), '', ICON_SIZE_MEDIUM)."</a>";
274 274
 				} else {
275
-					echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM)."</a>\n";
275
+					echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'), '', ICON_SIZE_MEDIUM)."</a>\n";
276 276
 				}
277 277
 				if (empty($viewSentCategory)) {
278
-					echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'),'',ICON_SIZE_MEDIUM)."</a>";
278
+					echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'), '', ICON_SIZE_MEDIUM)."</a>";
279 279
 				}
280 280
 				echo '</div>';
281 281
 			}
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 
329 329
 		if (api_get_session_id() == 0) {
330 330
 			$column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"');
331
-		} elseif (api_is_allowed_to_session_edit(false,true)) {
331
+		} elseif (api_is_allowed_to_session_edit(false, true)) {
332 332
 			$column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"');
333 333
 		}
334 334
 
@@ -373,13 +373,13 @@  discard block
 block discarded – undo
373 373
 				if ($dropbox_file->last_upload_date > $last_access &&
374 374
                     !in_array($dropbox_file->id, $_SESSION['_seen'][$_course['id']][TOOL_DROPBOX])
375 375
                 ) {
376
-					$new_icon = '&nbsp;'.Display::return_icon('new_dropbox_message.png', get_lang('New'),'',ICON_SIZE_SMALL);
376
+					$new_icon = '&nbsp;'.Display::return_icon('new_dropbox_message.png', get_lang('New'), '', ICON_SIZE_SMALL);
377 377
 				}
378 378
 
379 379
 				$link_open = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'">';
380 380
 				$dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).'</a>';
381 381
 				$dropbox_file_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'&action=download">'.
382
-                    Display::return_icon('save.png', get_lang('Download'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a>'.$new_icon.'<br />'.$dropbox_file->description;
382
+                    Display::return_icon('save.png', get_lang('Download'), array('style' => 'float:right;'), ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a>'.$new_icon.'<br />'.$dropbox_file->description;
383 383
 				$file_size = $dropbox_file->filesize;
384 384
 				$dropbox_file_data[] = format_file_size($file_size);
385 385
 				$dropbox_file_data[] = $dropbox_file->author;
@@ -389,10 +389,10 @@  discard block
 block discarded – undo
389 389
                     api_format_date($last_upload_date).'</span>';
390 390
 
391 391
 				$action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').'
392
-                <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('discuss.png', get_lang('Comment'),'',ICON_SIZE_SMALL).'</a>
393
-                <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movereceived&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('move.png', get_lang('Move'),'',ICON_SIZE_SMALL).'</a>
392
+                <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('discuss.png', get_lang('Comment'), '', ICON_SIZE_SMALL).'</a>
393
+                <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movereceived&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('move.png', get_lang('Move'), '', ICON_SIZE_SMALL).'</a>
394 394
                 <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletereceivedfile&id='.$dropbox_file->id.'&'.$sort_params.'" onclick="javascript: return confirmation(\''.$dropbox_file->title.'\');">'.
395
-                Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
395
+                Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
396 396
 
397 397
 				// This is a hack to have an additional row in a sortable table
398 398
 
@@ -426,12 +426,12 @@  discard block
 block discarded – undo
426 426
 					// The icon of the category
427 427
 					$link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$category['cat_id'].'&view_sent_category='.$viewSentCategory.'&view='.$view.'">';
428 428
 					$dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', $category['cat_name']).'</a>';
429
-					$dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=received">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$category['cat_name'].'</a>';
429
+					$dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=received">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL).'</a>'.$link_open.$category['cat_name'].'</a>';
430 430
 					$dropbox_category_data[] = '';
431 431
 					$dropbox_category_data[] = '';
432 432
 					$dropbox_category_data[] = '';
433
-					$dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=editcategory&id='.$category['cat_id'].'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>
434
-										  <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletereceivedcategory&id='.$category['cat_id'].'" onclick="javascript: return confirmation(\''.Security::remove_XSS($category['cat_name']).'\');">'.Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
433
+					$dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=editcategory&id='.$category['cat_id'].'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>
434
+										  <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletereceivedcategory&id='.$category['cat_id'].'" onclick="javascript: return confirmation(\''.Security::remove_XSS($category['cat_name']).'\');">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
435 435
 				}
436 436
 				if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) {
437 437
 					$dropbox_data_recieved[] = $dropbox_category_data;
@@ -451,8 +451,8 @@  discard block
 block discarded – undo
451 451
         );
452 452
 
453 453
 		if (is_array($movelist)) {
454
-			foreach ($movelist as $catid => $catname){
455
-				$selectlist['move_received_'.$catid] = get_lang('Move') . '->'. Security::remove_XSS($catname);
454
+			foreach ($movelist as $catid => $catname) {
455
+				$selectlist['move_received_'.$catid] = get_lang('Move').'->'.Security::remove_XSS($catname);
456 456
 			}
457 457
 		}
458 458
 
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 				$link_open = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'">';
547 547
 				$dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).'</a>';
548 548
 				$dropbox_file_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'&action=download">'.
549
-                    Display::return_icon('save.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a><br />'.$dropbox_file->description;
549
+                    Display::return_icon('save.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a><br />'.$dropbox_file->description;
550 550
 				$file_size = $dropbox_file->filesize;
551 551
 				$dropbox_file_data[] = format_file_size($file_size);
552 552
                 $receivers_celldata = null;
@@ -563,9 +563,9 @@  discard block
 block discarded – undo
563 563
 				$receivers_celldata = '';
564 564
 
565 565
 				$action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').'
566
-                    <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('discuss.png', get_lang('Comment'),'',ICON_SIZE_SMALL).'</a>
567
-                    <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movesent&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('move.png', get_lang('Move'),'',ICON_SIZE_SMALL).'</a>
568
-                    <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletesentfile&id='.$dropbox_file->id.'&'.$sort_params.'" onclick="javascript: return confirmation(\''.$dropbox_file->title.'\');">'.Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
566
+                    <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('discuss.png', get_lang('Comment'), '', ICON_SIZE_SMALL).'</a>
567
+                    <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movesent&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('move.png', get_lang('Move'), '', ICON_SIZE_SMALL).'</a>
568
+                    <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletesentfile&id='.$dropbox_file->id.'&'.$sort_params.'" onclick="javascript: return confirmation(\''.$dropbox_file->title.'\');">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
569 569
 				// This is a hack to have an additional row in a sortable table
570 570
 				if ($action == 'viewfeedback' && isset($_GET['id']) && is_numeric($_GET['id']) && $dropbox_file->id == $_GET['id']) {
571 571
 					$action_icons .= "</td></tr>\n"; // ending the normal row of the sortable table
@@ -594,16 +594,16 @@  discard block
 block discarded – undo
594 594
 					// This is where the checkbox icon for the files appear.
595 595
 					$link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$category['cat_id'].'&view='.$view.'">';
596 596
 					$dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', Security::remove_XSS($category['cat_name'])).'</a>';
597
-					$dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=sent">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.Security::remove_XSS($category['cat_name']).'</a>';
597
+					$dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=sent">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL).'</a>'.$link_open.Security::remove_XSS($category['cat_name']).'</a>';
598 598
 					//$dropbox_category_data[] = '';
599 599
 					$dropbox_category_data[] = '';
600 600
 					//$dropbox_category_data[] = '';
601 601
 					$dropbox_category_data[] = '';
602 602
 					$dropbox_category_data[] = '';
603 603
 					$dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=editcategory&id='.$category['cat_id'].'">'.
604
-                                    Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>
604
+                                    Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>
605 605
 									<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletesentcategory&id='.$category['cat_id'].'" onclick="javascript: return confirmation(\''.Security::remove_XSS($category['cat_name']).'\');">'.
606
-                                    Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
606
+                                    Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
607 607
 				}
608 608
 				if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) {
609 609
 					$dropbox_data_sent[] = $dropbox_category_data;
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
 
626 626
         if (!empty($moveList)) {
627 627
             foreach ($moveList as $catid => $catname) {
628
-                $selectlist['move_sent_'.$catid] = get_lang('Move') . '->'. Security::remove_XSS($catname);
628
+                $selectlist['move_sent_'.$catid] = get_lang('Move').'->'.Security::remove_XSS($catname);
629 629
             }
630 630
         }
631 631
 
Please login to merge, or discard this patch.
main/dropbox/dropbox_submit.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
      */
24 24
 
25 25
     // the author or description field is empty
26
-    if (!isset($_POST['authors']) || !isset( $_POST['description'])) {
26
+    if (!isset($_POST['authors']) || !isset($_POST['description'])) {
27 27
         $error = true;
28 28
         $errormsg = get_lang('BadFormData');
29
-    } elseif (!isset( $_POST['recipients']) || count( $_POST['recipients']) <= 0) {
29
+    } elseif (!isset($_POST['recipients']) || count($_POST['recipients']) <= 0) {
30 30
         $error = true;
31 31
         $errormsg = get_lang('NoUserSelected');
32 32
     } else {
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
         }
49 49
 
50 50
 		// we are doing a mailing but an additional recipient is selected
51
-        if ($thisIsAMailing && ( count($_POST['recipients']) != 1)) {
51
+        if ($thisIsAMailing && (count($_POST['recipients']) != 1)) {
52 52
             $error = true;
53 53
             $errormsg = get_lang('MailingSelectNoOther');
54 54
         }
55 55
         // we are doing a just upload but an additional recipient is selected.
56
-        elseif ( $thisIsJustUpload && ( count($_POST['recipients']) != 1)) {
56
+        elseif ($thisIsJustUpload && (count($_POST['recipients']) != 1)) {
57 57
             $error = true;
58 58
             $errormsg = get_lang('MailingJustUploadSelectNoOther');
59 59
         } elseif (empty($_FILES['file']['name'])) {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                     }
126 126
                 } else {
127 127
                     // rename file to login_filename_uniqueId format
128
-                    $dropbox_filename = getLoginFromId( $_user['user_id']) . '_' . $dropbox_filename . '_'.uniqid('');
128
+                    $dropbox_filename = getLoginFromId($_user['user_id']).'_'.$dropbox_filename.'_'.uniqid('');
129 129
                 }
130 130
 
131 131
                 if (!is_dir(dropbox_cnf('sysPath'))) {
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                         $newWorkRecipients = dropbox_cnf('mailingIdBase');
148 148
                     } else {
149 149
                         $error = true;
150
-                        $errormsg = $dropbox_title . ': ' . get_lang('MailingWrongZipfile');
150
+                        $errormsg = $dropbox_title.': '.get_lang('MailingWrongZipfile');
151 151
                     }
152 152
                 } elseif ($thisIsJustUpload) {
153 153
                     $newWorkRecipients = array();
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 				// After uploading the file, create the db entries
172 172
 
173 173
 	        	if (!$error) {
174
-		            @move_uploaded_file($dropbox_filetmpname, dropbox_cnf('sysPath') . '/' . $dropbox_filename)
174
+		            @move_uploaded_file($dropbox_filetmpname, dropbox_cnf('sysPath').'/'.$dropbox_filename)
175 175
 		            	or die(get_lang('UploadError').' (code 407)');
176 176
 		            new Dropbox_SentWork($_user['user_id'], $dropbox_title, $_POST['description'], strip_tags($_POST['authors']), $dropbox_filename, $dropbox_filesize, $newWorkRecipients);
177 177
 	        	}
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
  * - EDIT FEEDBACK
199 199
  */
200 200
 if (isset($_GET['deleteReceived']) || isset($_GET['deleteSent'])
201
-         || isset( $_GET['showFeedback']) || isset( $_GET['editFeedback'])) {
201
+         || isset($_GET['showFeedback']) || isset($_GET['editFeedback'])) {
202 202
 	if ($_GET['mailing']) {
203 203
 		getUserOwningThisMailing($_GET['mailing'], $_user['user_id'], '408');
204 204
 		$dropbox_person = new Dropbox_Person($_GET['mailing'], $is_courseAdmin, $is_courseTutor);
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
         if ($_GET['deleteReceived'] == 'all') {
224 224
             $dropbox_person->deleteAllReceivedWork();
225 225
         } elseif (is_numeric($_GET['deleteReceived'])) {
226
-            $dropbox_person->deleteReceivedWork( $_GET['deleteReceived']);
226
+            $dropbox_person->deleteReceivedWork($_GET['deleteReceived']);
227 227
         } else {
228 228
             die(get_lang('GeneralError').' (code 409)');
229 229
         }
Please login to merge, or discard this patch.
main/inc/lib/webservices/MessagesWebService.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                 'hasAttachments' => $hasAttachments,
119 119
                 'platform' => array(
120 120
                     'website' => api_get_path(WEB_PATH),
121
-                    'messagingTool' => api_get_path(WEB_PATH) . 'main/messages/inbox.php'
121
+                    'messagingTool' => api_get_path(WEB_PATH).'main/messages/inbox.php'
122 122
                 )
123 123
             );
124 124
         }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         }
202 202
 
203 203
         $headers = [
204
-            'Authorization: key=' . $gdcApiKey,
204
+            'Authorization: key='.$gdcApiKey,
205 205
             'Content-Type: application/json'
206 206
         ];
207 207
 
Please login to merge, or discard this patch.
main/forum/forumqualify.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
 /*
60 60
     Header and Breadcrumbs
61 61
 */
62
-if (isset($_SESSION['gradebook'])){
63
-    $gradebook=	$_SESSION['gradebook'];
62
+if (isset($_SESSION['gradebook'])) {
63
+    $gradebook = $_SESSION['gradebook'];
64 64
 }
65 65
 
66
-if (!empty($gradebook) && $gradebook=='view') {
67
-    $interbreadcrumb[]= array (
66
+if (!empty($gradebook) && $gradebook == 'view') {
67
+    $interbreadcrumb[] = array(
68 68
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
69 69
         'name' => get_lang('ToolGradebook')
70 70
     );
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             "name" => prepare4display($currentForum['forum_title'])
89 89
         );
90 90
         if ($message <> 'PostDeletedSpecial') {
91
-            $interbreadcrumb[]= array(
91
+            $interbreadcrumb[] = array(
92 92
                 "url" => "viewthread.php?forum=".intval($_GET['forum'])."&gradebook=".$gradebook."&thread=".intval($_GET['thread']),
93 93
                 "name" => prepare4display($currentThread['thread_title'])
94 94
             );
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
         );
120 120
 
121 121
         if ($message <> 'PostDeletedSpecial') {
122
-            if (isset($_GET['gradebook']) and $_GET['gradebook']=='view') {
123
-                $info_thread=get_thread_information($_GET['thread']);
122
+            if (isset($_GET['gradebook']) and $_GET['gradebook'] == 'view') {
123
+                $info_thread = get_thread_information($_GET['thread']);
124 124
                 $interbreadcrumb[] = array(
125 125
                     "url" => "viewthread.php?".api_get_cidreq()."&forum=".$info_thread['forum_id']."&thread=".intval($_GET['thread']),
126 126
                     "name" => prepare4display($currentThread['thread_title'])
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             }
134 134
         }
135 135
         // the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string
136
-        $interbreadcrumb[]=array("url" => "#","name" => get_lang('QualifyThread'));
136
+        $interbreadcrumb[] = array("url" => "#", "name" => get_lang('QualifyThread'));
137 137
         Display :: display_header('');
138 138
     }
139 139
 }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 */
144 144
 $action = isset($_GET['action']) ? $_GET['action'] : '';
145 145
 
146
-if ($action =='delete' &&
146
+if ($action == 'delete' &&
147 147
     isset($_GET['content']) &&
148 148
     isset($_GET['id']) && api_is_allowed_to_edit(false, true)
149 149
 ) {
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
     if (isset($rows)) {
241 241
         $counter = 1;
242 242
         foreach ($rows as $row) {
243
-            if ($row['status']=='0') {
244
-                $style =" id = 'post".$post_en."' class=\"hide-me\" style=\"border:1px solid red; display:none; background-color:#F7F7F7; width:95%; margin: 0px 0px 4px 40px; \" ";
243
+            if ($row['status'] == '0') {
244
+                $style = " id = 'post".$post_en."' class=\"hide-me\" style=\"border:1px solid red; display:none; background-color:#F7F7F7; width:95%; margin: 0px 0px 4px 40px; \" ";
245 245
             } else {
246 246
                 $style = "";
247 247
                 $post_en = $row['post_parent_id'];
@@ -258,20 +258,20 @@  discard block
 block discarded – undo
258 258
 
259 259
             echo "<div ".$style."><table class=\"data_table\">";
260 260
 
261
-            if ($row['visible']=='0') {
262
-                $titleclass='forum_message_post_title_2_be_approved';
263
-                $messageclass='forum_message_post_text_2_be_approved';
264
-                $leftclass='forum_message_left_2_be_approved';
261
+            if ($row['visible'] == '0') {
262
+                $titleclass = 'forum_message_post_title_2_be_approved';
263
+                $messageclass = 'forum_message_post_text_2_be_approved';
264
+                $leftclass = 'forum_message_left_2_be_approved';
265 265
             } else {
266
-                $titleclass='forum_message_post_title';
267
-                $messageclass='forum_message_post_text';
268
-                $leftclass='forum_message_left';
266
+                $titleclass = 'forum_message_post_title';
267
+                $messageclass = 'forum_message_post_text';
268
+                $leftclass = 'forum_message_left';
269 269
             }
270 270
 
271 271
             echo "<tr>";
272 272
             echo "<td rowspan=\"3\" class=\"$leftclass\">";
273 273
 
274
-            echo '<br /><b>'.  api_convert_and_format_date($row['post_date'], DATE_TIME_FORMAT_LONG).'</b><br />';
274
+            echo '<br /><b>'.api_convert_and_format_date($row['post_date'], DATE_TIME_FORMAT_LONG).'</b><br />';
275 275
 
276 276
             echo "</td>";
277 277
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
                 $realname = $attachment_list['path'];
293 293
                 $user_filename = $attachment_list['filename'];
294 294
 
295
-                echo Display::return_icon('attachment.gif',get_lang('Attachment'));
295
+                echo Display::return_icon('attachment.gif', get_lang('Attachment'));
296 296
                 echo '<a href="download.php?file=';
297 297
                 echo $realname;
298 298
                 echo ' "> '.$user_filename.' </a>';
@@ -311,8 +311,8 @@  discard block
 block discarded – undo
311 311
 
312 312
     // Show past data
313 313
     if (api_is_allowed_to_edit() && $counter > 0) {
314
-        if (isset($_GET['gradebook'])){
315
-            $view_gradebook='&gradebook=view';
314
+        if (isset($_GET['gradebook'])) {
315
+            $view_gradebook = '&gradebook=view';
316 316
         }
317 317
         echo '<h4>'.get_lang('QualificationChangesHistory').'</h4>';
318 318
         if (isset($_GET['type']) && $_GET['type'] == 'false') {
@@ -342,12 +342,12 @@  discard block
 block discarded – undo
342 342
             );
343 343
             $table_list .= '</td></tr>';
344 344
         }
345
-        $table_list.= '</table>';
345
+        $table_list .= '</table>';
346 346
 
347 347
         echo $table_list;
348 348
     }
349 349
 }
350 350
 
351
-if ($origin!='learnpath') {
351
+if ($origin != 'learnpath') {
352 352
     Display :: display_footer();
353 353
 }
Please login to merge, or discard this patch.
main/inc/lib/geometry.lib.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
  * @returns an array such as: for all i in [0..max[x][ : for all j in [0..max[y][ : array[i][j] = FALSE
14 14
  */
15 15
 function poly_init($max) {
16
-    return array_fill(0, $max["x"]-1,
17
-            array_fill(0, $max["y"]-1, FALSE));
16
+    return array_fill(0, $max["x"] - 1,
17
+            array_fill(0, $max["y"] - 1, FALSE));
18 18
 }
19 19
 
20 20
 
@@ -69,18 +69,18 @@  discard block
 block discarded – undo
69 69
     	array_push($bords[$poly[0]['y']], $poly[0]['x']);
70 70
 
71 71
     $i = 1; // we re-use $i and $old_pente bellow the loop
72
-    $old_pente=0;
73
-    for (    ;    // for each points of the polygon but the first
74
-        $i<sizeof($poly) && (!empty($poly[$i]['x']) && !empty($poly[$i]['y'])); $i++) {
72
+    $old_pente = 0;
73
+    for (;    // for each points of the polygon but the first
74
+        $i < sizeof($poly) && (!empty($poly[$i]['x']) && !empty($poly[$i]['y'])); $i++) {
75 75
 
76 76
         /* special cases */
77
-        if ($poly[$i-1]['y'] == $poly[$i]['y']) {
78
-            if ($poly[$i-1]['x'] == $poly[$i]['x'])
77
+        if ($poly[$i - 1]['y'] == $poly[$i]['y']) {
78
+            if ($poly[$i - 1]['x'] == $poly[$i]['x'])
79 79
                 continue; // twice the same point
80 80
             else {    //  infinite elevation of the edge
81 81
             	if (is_array($bords[$poly[$i]['y']]))
82
-                	array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
83
-                $old_pente=0;
82
+                	array_push($bords[$poly[$i]['y']], $poly[$i]['x']);
83
+                $old_pente = 0;
84 84
                 continue;
85 85
             }
86 86
         }
@@ -93,17 +93,17 @@  discard block
 block discarded – undo
93 93
 
94 94
         /* computing the elevation of the edge going */
95 95
         //        from $poly[$i-1] to $poly[$i]
96
-        $pente = ($poly[$i-1]['x']-$poly[$i]['x'])/
97
-                 ($poly[$i-1]['y']-$poly[$i]['y']);
96
+        $pente = ($poly[$i - 1]['x'] - $poly[$i]['x']) /
97
+                 ($poly[$i - 1]['y'] - $poly[$i]['y']);
98 98
 
99 99
         // if the sign of the elevation change from the one of the
100 100
         // previous edge, the point must be added a second time inside
101 101
         // $bords
102
-        if ($i>1)
103
-            if (($old_pente<0 && $pente>0)
104
-                    || ($old_pente>0 && $pente<0)) {
102
+        if ($i > 1)
103
+            if (($old_pente < 0 && $pente > 0)
104
+                    || ($old_pente > 0 && $pente < 0)) {
105 105
 				if (is_array($bords[$poly[$i]['y']])) //avoid warning
106
-                	array_push($bords[$poly[$i]['y']],$poly[$i]['x']);
106
+                	array_push($bords[$poly[$i]['y']], $poly[$i]['x']);
107 107
 
108 108
                 if (DEBUG)
109 109
                     echo '*('.$poly[$i]['x'].
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
         	}
112 112
 
113 113
         /* detect the direction of the elevation in Y */
114
-        $dy_inc = ($poly[$i]['y']-$poly[$i-1]['y']) > 0 ? 1 : -1;
115
-        $x = $poly[$i-1]['x'];
114
+        $dy_inc = ($poly[$i]['y'] - $poly[$i - 1]['y']) > 0 ? 1 : -1;
115
+        $x = $poly[$i - 1]['x'];
116 116
 //        if (DEBUG) echo "init: ".$poly[$i-1]['y']."  dy_inc: ".$dy_inc.
117 117
 //            "   end: ".$poly[$i]['y']."   pente:".$pente;
118 118
 
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
 
122 122
         // we iterate w/ $dy in ]$poly[$i-1]['y'],$poly[$i-1]['y'][
123 123
         //    w/ $dy_inc as increment
124
-        for ($dy = $poly[$i-1]['y']+$dy_inc;
124
+        for ($dy = $poly[$i - 1]['y'] + $dy_inc;
125 125
             $dy != $poly[$i]['y'];
126 126
             $dy += $dy_inc) {
127
-            $x += $pente*$dy_inc;
127
+            $x += $pente * $dy_inc;
128 128
             array_push($bords[$dy], $x);
129 129
 //            if (DEBUG) echo '/('.$x.';'.$dy.')   ';
130 130
         }
@@ -132,47 +132,47 @@  discard block
 block discarded – undo
132 132
     }
133 133
 
134 134
     // closing the polygone (the edge between $poly[$i-1] and $poly[0])
135
-    if ($poly[$i-1]['y']!=$poly[0]['y']) {// droite--> rien à faire
135
+    if ($poly[$i - 1]['y'] != $poly[0]['y']) {// droite--> rien à faire
136 136
 
137 137
         // elevation between $poly[0]['x'] and $poly[1]['x'])
138
-        $rest = $poly[0]['y']-$poly[1]['y'];
139
-        if ($rest!=0)
140
-        	$pente1 = ($poly[0]['x']-$poly[1]['x'])/($rest);
138
+        $rest = $poly[0]['y'] - $poly[1]['y'];
139
+        if ($rest != 0)
140
+        	$pente1 = ($poly[0]['x'] - $poly[1]['x']) / ($rest);
141 141
         else
142 142
 			$pente1 = 0;
143 143
 
144 144
         // elevation between $poly[$i-1]['x'] and $poly[0]['x'])
145
-        $pente = ($poly[$i-1]['x']-$poly[0]['x'])/
146
-            ($poly[$i-1]['y']-$poly[0]['y']);
145
+        $pente = ($poly[$i - 1]['x'] - $poly[0]['x']) /
146
+            ($poly[$i - 1]['y'] - $poly[0]['y']);
147 147
 
148 148
 //        if (DEBUG) echo 'start('.$poly[$i-1]['x'].','.$poly[$i-1]['y'].
149 149
 //                ')-end('.$poly[0]['x'].','.$poly[0]['y'].
150 150
 //                ')-pente'.$pente;
151 151
 
152 152
         // doubling the first point if needed (see above)
153
-        if (($pente1<0 && $pente>0) || ($pente1>0 && $pente<0)) {
153
+        if (($pente1 < 0 && $pente > 0) || ($pente1 > 0 && $pente < 0)) {
154 154
         	if (is_array($bords[$poly[$i - 1]['y']]))
155
-            	array_push($bords[$poly[$i - 1]['y']],  round($poly[$i - 1]['x']));
155
+            	array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x']));
156 156
             //if (DEBUG) echo '('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].')   ';
157 157
         }
158 158
         //  doubling the last point if neededd
159
-        if (($old_pente<0 && $pente>0) || ($old_pente>0 && $pente<0)) {
160
-        	if (is_array($bords[$poly[$i-1]['y']])) //avoid warning
161
-            	array_push($bords[$poly[$i-1]['y']], round($poly[$i-1]['x']));
159
+        if (($old_pente < 0 && $pente > 0) || ($old_pente > 0 && $pente < 0)) {
160
+        	if (is_array($bords[$poly[$i - 1]['y']])) //avoid warning
161
+            	array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x']));
162 162
             //if (DEBUG) echo '*('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].')   ';
163 163
         }
164 164
 
165 165
 
166
-        $dy_inc = ($poly[0]['y']-$poly[$i-1]['y']) > 0 ? 1 : -1;
167
-        $x = $poly[$i-1]['x'];
166
+        $dy_inc = ($poly[0]['y'] - $poly[$i - 1]['y']) > 0 ? 1 : -1;
167
+        $x = $poly[$i - 1]['x'];
168 168
 //        if (DEBUG) echo "init: ".$poly[$i-1]['y']."  dy_inc: ".$dy_inc.
169 169
 //            "   end: ".$poly[0]['y'];
170 170
 
171
-        for ($dy = $poly[$i-1]['y']+$dy_inc;
171
+        for ($dy = $poly[$i - 1]['y'] + $dy_inc;
172 172
             $dy != $poly[0]['y'];
173 173
             $dy += $dy_inc)
174 174
         {
175
-            $x += $pente*$dy_inc;
175
+            $x += $pente * $dy_inc;
176 176
             array_push($bords[$dy], round($x));
177 177
 //            if (DEBUG) echo '/('.$x.';'.$dy.')   ';
178 178
         }
@@ -182,20 +182,20 @@  discard block
 block discarded – undo
182 182
     /* basic idea: we sort a column of edges.
183 183
         For each pair of point, we color the points in between */
184 184
     $n = count($bords);
185
-    for ($i = 0; $i<$n; $i++) {  // Y
185
+    for ($i = 0; $i < $n; $i++) {  // Y
186 186
         //error_log(__FILE__.' - Border Num '.$i,0);
187 187
         if (is_array($bords[$i])) {
188 188
        		sort($bords[$i]);
189 189
         }
190 190
 
191
-        for ($j = 0; $j<sizeof($bords[$i]);$j+=2) { // bords
191
+        for ($j = 0; $j < sizeof($bords[$i]); $j += 2) { // bords
192 192
             if (!isset($bords[$i][$j + 1])) {
193 193
                 break;
194 194
             }
195 195
 
196
-            for ($k = round($bords[$i][$j]); $k<=$bords[$i][$j+1];$k++) {
196
+            for ($k = round($bords[$i][$j]); $k <= $bords[$i][$j + 1]; $k++) {
197 197
                 $res[$k][$i] = true; //filling the array with trues
198
-                if ($test == 1)  {
198
+                if ($test == 1) {
199 199
                 	/*how to draw the polygon in a human way:
200 200
                 	In ubuntu : sudo apt-get install gnuplot
201 201
                 	Create an empty file with all points with the result of this echos (No commas, no point, no headers)
@@ -222,19 +222,19 @@  discard block
 block discarded – undo
222 222
  *
223 223
  * @return string     html code of the representation of the polygone image
224 224
  */
225
-function poly_dump(&$poly, $max, $format='raw') {
225
+function poly_dump(&$poly, $max, $format = 'raw') {
226 226
     if ($format == 'html') {
227 227
         $s = "<div style='font-size: 8px; line-height:3px'><pre>\n";
228 228
     }
229
-    for ($i=0; $i<$max['y']; $i++) {
230
-        for($j=0; $j<$max['x']; $j++)
231
-            if($poly[$j][$i] == TRUE)
232
-                $s .= ($format=='html'?"<b>1</b>":'1');
229
+    for ($i = 0; $i < $max['y']; $i++) {
230
+        for ($j = 0; $j < $max['x']; $j++)
231
+            if ($poly[$j][$i] == TRUE)
232
+                $s .= ($format == 'html' ? "<b>1</b>" : '1');
233 233
             else
234 234
                 $s .= "0";
235
-        $s .= ($format=='html'?"<br />\n":"\n");
235
+        $s .= ($format == 'html' ? "<br />\n" : "\n");
236 236
     }
237
-    $s .= ($format=='html'?"</pre></div>\n":"\n");
237
+    $s .= ($format == 'html' ? "</pre></div>\n" : "\n");
238 238
     return $s;
239 239
 }
240 240
 
@@ -252,8 +252,8 @@  discard block
 block discarded – undo
252 252
     $surfaceOf1 = 0;
253 253
     $surfaceOf2 = 0;
254 254
 
255
-    for ($i=0; $i<$max['x']; $i++)
256
-        for($j=0; $j<$max['y']; $j++) {
255
+    for ($i = 0; $i < $max['x']; $i++)
256
+        for ($j = 0; $j < $max['y']; $j++) {
257 257
             if (isset($poly1[$i][$j]) && ($poly1[$i][$j] == TRUE)) {
258 258
                 $surfaceOf1++;
259 259
                 if (isset($poly2[$i][$j]) && ($poly2[$i][$j] == FALSE))
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
                 $surfaceOf2++;
264 264
         }
265 265
 
266
-    return array (
266
+    return array(
267 267
         "s1" => $surfaceOf1,
268 268
         "s2" => $surfaceOf2,
269 269
         "both" => $surfaceOf1 - $onlyIn1,
@@ -282,8 +282,8 @@  discard block
 block discarded – undo
282 282
  */
283 283
 function poly_touch(&$poly1, &$poly2, $max) {
284 284
 
285
-    for ($i=0; $i<$max['x']; $i++) {
286
-        for($j=0; $j<$max['y']; $j++) {
285
+    for ($i = 0; $i < $max['x']; $i++) {
286
+        for ($j = 0; $j < $max['y']; $j++) {
287 287
             if (isset($poly1[$i][$j]) && ($poly1[$i][$j] == true)
288 288
                 && isset($poly2[$i][$j]) && ($poly2[$i][$j] == true)) {
289 289
                     return true;
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
  * @return  array   An array of points in the right format to use with the
302 302
  *                  local functions
303 303
  */
304
-function convert_coordinates($coords,$sep='|') {
304
+function convert_coordinates($coords, $sep = '|') {
305 305
     $points = array();
306
-    $pairs = explode($sep,$coords);
306
+    $pairs = explode($sep, $coords);
307 307
     foreach ($pairs as $idx => $pcoord) {
308
-        list($x,$y) = explode(';',$pcoord);
309
-        $points[] = array('x'=>$x,'y'=>$y);
308
+        list($x, $y) = explode(';', $pcoord);
309
+        $points[] = array('x'=>$x, 'y'=>$y);
310 310
     }
311 311
 	return $points;
312 312
 }
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
             $my = $coord['y'];
337 337
         }
338 338
     }
339
-    return array('x'=>$mx,'y'=>$my);
339
+    return array('x'=>$mx, 'y'=>$my);
340 340
 }
341 341
 
342 342
 /**
Please login to merge, or discard this patch.
main/tracking/courseLog.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                             get_lang('HideColumn'),
113 113
                             array('align' => 'absmiddle', 'hspace' => '3px'),
114 114
                             ICON_SIZE_SMALL
115
-                         ) . "</div>'
115
+                         )."</div>'
116 116
                     );
117 117
                 }
118 118
             );
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 $TABLETRACK_LINKS       = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LINKS);
148 148
 $TABLETRACK_DOWNLOADS   = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS);
149 149
 $TABLETRACK_ACCESS_2    = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
150
-$TABLETRACK_EXERCISES 	= Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
150
+$TABLETRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
151 151
 $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
152 152
 $TABLECOURSE = Database::get_main_table(TABLE_MAIN_COURSE);
153 153
 $table_user = Database::get_main_table(TABLE_MAIN_USER);
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
 
158 158
 // Breadcrumbs.
159 159
 if (isset($_GET['origin']) && $_GET['origin'] == 'resume_session') {
160
-    $interbreadcrumb[] = array('url' => '../admin/index.php','name' => get_lang('PlatformAdmin'));
161
-    $interbreadcrumb[] = array('url' => '../session/session_list.php','name' => get_lang('SessionList'));
160
+    $interbreadcrumb[] = array('url' => '../admin/index.php', 'name' => get_lang('PlatformAdmin'));
161
+    $interbreadcrumb[] = array('url' => '../session/session_list.php', 'name' => get_lang('SessionList'));
162 162
     $interbreadcrumb[] = array('url' => '../session/resume_session.php?id_session='.$sessionId, 'name' => get_lang('SessionOverview'));
163 163
 }
164 164
 
@@ -229,21 +229,21 @@  discard block
 block discarded – undo
229 229
 if (!empty($sessionId)) {
230 230
     $actionsLeft .= Display::url(
231 231
         Display::return_icon('attendance_list.png', get_lang('Logins'), '', ICON_SIZE_MEDIUM),
232
-        api_get_path(WEB_CODE_PATH) . 'attendance/index.php?' . api_get_cidreq() . '&action=calendar_logins'
232
+        api_get_path(WEB_CODE_PATH).'attendance/index.php?'.api_get_cidreq().'&action=calendar_logins'
233 233
     );
234 234
 }
235 235
 
236 236
 $actionsRight = '<div class="pull-right">';
237 237
 $actionsRight .= '<a href="javascript: void(0);" onclick="javascript: window.print();">'.
238
-    Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>';
238
+    Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>';
239 239
 
240 240
 $addional_param = '';
241 241
 if (isset($_GET['additional_profile_field'])) {
242
-    $addional_param ='additional_profile_field='.intval($_GET['additional_profile_field']);
242
+    $addional_param = 'additional_profile_field='.intval($_GET['additional_profile_field']);
243 243
 }
244 244
 $users_tracking_per_page = '';
245 245
 if (isset($_GET['users_tracking_per_page'])) {
246
-    $users_tracking_per_page= '&users_tracking_per_page='.intval($_GET['users_tracking_per_page']);
246
+    $users_tracking_per_page = '&users_tracking_per_page='.intval($_GET['users_tracking_per_page']);
247 247
 }
248 248
 $actionsRight .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&'.$addional_param.$users_tracking_per_page.'">
249 249
      '.Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM).'</a>';
@@ -264,13 +264,13 @@  discard block
 block discarded – undo
264 264
 $form_search->addButtonSearch(get_lang('SearchUsers'));
265 265
 
266 266
 
267
-echo Display::toolbarAction('toolbar-courselog', array( 0 => $actionsLeft, 1 => $form_search->returnForm(), 2 => $actionsRight ), 3);
267
+echo Display::toolbarAction('toolbar-courselog', array(0 => $actionsLeft, 1 => $form_search->returnForm(), 2 => $actionsRight), 3);
268 268
 
269 269
 $course_name = get_lang('Course').' '.$courseInfo['name'];
270 270
 
271 271
 if ($session_id) {
272 272
     $titleSession = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.api_get_session_name($session_id);
273
-    $titleCourse =  Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name;
273
+    $titleCourse = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name;
274 274
 
275 275
 } else {
276 276
     $titleSession = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$courseInfo['name'];
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
     $html .= '<ul class="session-list">';
313 313
     foreach ($sessionList as $session) {
314 314
         $url = api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id'].'&cidReq='.$courseInfo['code'];
315
-        $html .= Display::tag('li', $iconCourse . ' ' . Display::url($session['name'], $url));
315
+        $html .= Display::tag('li', $iconCourse.' '.Display::url($session['name'], $url));
316 316
     }
317 317
     $html .= '</ul>';
318 318
 }
@@ -327,12 +327,12 @@  discard block
 block discarded – undo
327 327
     $form = new FormValidator(
328 328
         'reminder_form',
329 329
         'get',
330
-        api_get_path(WEB_CODE_PATH).'announcements/announcements.php?' . api_get_cidreq(),
330
+        api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq(),
331 331
         null,
332 332
         ['style' => 'margin-bottom: 10px'],
333 333
         FormValidator::LAYOUT_INLINE
334 334
     );
335
-    $options = array (
335
+    $options = array(
336 336
         2 => sprintf($getLangXDays, 2),
337 337
         3 => sprintf($getLangXDays, 3),
338 338
         4 => sprintf($getLangXDays, 4),
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
     );
346 346
     $el = $form->addSelect(
347 347
         'since',
348
-        Display::returnFontAwesomeIcon('warning') . get_lang('RemindInactivesLearnersSince'),
348
+        Display::returnFontAwesomeIcon('warning').get_lang('RemindInactivesLearnersSince'),
349 349
         $options,
350 350
         ['class' => 'col-sm-3']
351 351
     );
Please login to merge, or discard this patch.