Completed
Pull Request — 1.11.x (#1359)
by José
193:39 queued 155:02
created
main/document/slideshow.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 function resize_image($image, $target_width, $target_height, $slideshow = 0) {
37 37
 	// Modifications by Ivan Tcholakov, 04-MAY-2009.
38 38
 	$result = array();
39
-	if ( (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing']== 'resizing') or $slideshow == 1) {
39
+	if ((isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] == 'resizing') or $slideshow == 1) {
40 40
 		$new_sizes = api_resize_image($image, $target_width, $target_height);
41 41
 		$result[] = $new_sizes['height'];
42 42
 		$result[] = $new_sizes['width'];
Please login to merge, or discard this patch.
main/document/document_quota.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 $session = array();
33 33
 $user_name = $user_info['complete_name'];
34 34
 
35
-$course_list = SessionManager::get_course_list_by_session_id ($session_id);
35
+$course_list = SessionManager::get_course_list_by_session_id($session_id);
36 36
 $session_list = SessionManager::get_session_by_course($course_id);
37 37
 $total_quota_bytes = DocumentManager::get_course_quota();
38
-$quota_bytes = DocumentManager::documents_total_space($course_id, 0 , 0);
39
-$quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100;
38
+$quota_bytes = DocumentManager::documents_total_space($course_id, 0, 0);
39
+$quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100;
40 40
 
41 41
 $session[] = array(get_lang('Course').' ('.format_file_size($quota_bytes).')', $quota_percentage);
42 42
 
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
     foreach ($session_list as $session_data) {
47 47
         $quota_percentage = 0;
48 48
         $quota_bytes = intval(DocumentManager::documents_total_space($course_id, null, $session_data['id']));
49
-        if (!empty($quota_bytes))  {
50
-            $quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100;
49
+        if (!empty($quota_bytes)) {
50
+            $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100;
51 51
         }
52 52
         if ($session_id == $session_data['id']) {
53
-            $session_data['name'] = $session_data['name'] . ' * ';
53
+            $session_data['name'] = $session_data['name'].' * ';
54 54
         }
55 55
         $used_quota_bytes += $quota_bytes;
56 56
         $session[] = array(
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
         $quota_percentage = 0;
67 67
         $my_group_id = $group_data['id'];
68 68
         $quota_bytes = intval(DocumentManager::documents_total_space($course_id, $my_group_id, 0));
69
-        if (!empty($quota_bytes))  {
70
-            $quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100;
69
+        if (!empty($quota_bytes)) {
70
+            $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100;
71 71
         }
72 72
         if ($group_id == $my_group_id) {
73
-            $group_data['name'] = $group_data['name'] . ' * ';
73
+            $group_data['name'] = $group_data['name'].' * ';
74 74
         }
75 75
         $used_quota_bytes += $quota_bytes;
76 76
         $session[] = array(addslashes(get_lang('Group').': '.$group_data['name']).' ('.format_file_size($quota_bytes).')', $quota_percentage);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         }
86 86
     }
87 87
     if ($quota_bytes != 0) {
88
-       $quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100;
88
+       $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100;
89 89
     }
90 90
 
91 91
     $session[] = array(addslashes(get_lang('Teacher').': '.$user_name).' ('.format_file_size($quota_bytes).')', $quota_percentage);
@@ -98,15 +98,15 @@  discard block
 block discarded – undo
98 98
                 $total_quota_bytes += DocumentManager::get_course_quota($course_data['id']);
99 99
             }
100 100
             if ($quota_bytes != 0) {
101
-                $quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100;
101
+                $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100;
102 102
             }
103 103
         }
104
-        $session[] = array(addslashes(sprintf(get_lang('TeacherXInSession'),$user_name)), $quota_percentage);
104
+        $session[] = array(addslashes(sprintf(get_lang('TeacherXInSession'), $user_name)), $quota_percentage);
105 105
 
106 106
    }
107 107
 }
108 108
 
109
-$quota_percentage = round(($total_quota_bytes - $used_quota_bytes)/$total_quota_bytes, 2)*100;
109
+$quota_percentage = round(($total_quota_bytes - $used_quota_bytes) / $total_quota_bytes, 2) * 100;
110 110
 $session[] = array(addslashes(get_lang('ShowCourseQuotaUse')).' ('.format_file_size($total_quota_bytes - $used_quota_bytes).') ', $quota_percentage);
111 111
 $quota_data = json_encode($session);
112 112
 
Please login to merge, or discard this patch.
main/resourcelinker/resourcelinker.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 use ChamiloSession as Session;
18 18
 
19 19
 include ('../inc/global.inc.php');
20
-$this_section=SECTION_COURSES;
20
+$this_section = SECTION_COURSES;
21 21
 
22 22
 api_protect_course_script();
23 23
 
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
 	$max_temp2 = $row[0];
111 111
 	if ($max_temp2 > $max_temp)
112 112
 	{
113
-		$order = $max_temp2 +1;
113
+		$order = $max_temp2 + 1;
114 114
 	}
115 115
 	else
116 116
 	{
117
-		$order = $max_temp +1;
117
+		$order = $max_temp + 1;
118 118
 	}
119 119
 
120 120
 	$sql = "INSERT INTO $tbl_learnpath_chapter "."(learnpath_id,chapter_name,chapter_description,parent_chapter_id,display_order) "." VALUES "."($learnpath_id, '$title', '$description', $chapter_id, $order )";
@@ -186,21 +186,21 @@  discard block
 block discarded – undo
186 186
 		//calculating the last order of the items of this chapter
187 187
 		$sql = "SELECT MAX(display_order) FROM $tbl_learnpath_item WHERE chapter_id=$chapter_id";
188 188
 		$result = Database::query($sql);
189
-		if(Database::num_rows($result)==0){
189
+		if (Database::num_rows($result) == 0) {
190 190
 			$lastorder_item = 0;
191
-		}else{
191
+		} else {
192 192
 			$row = Database::fetch_array($result);
193 193
 			$lastorder_item = ($row[0]);
194 194
 		}
195 195
 		$sql = "SELECT MAX(display_order) FROM $tbl_learnpath_chapter WHERE parent_chapter_id=$chapter_id";
196 196
 		$result = Database::query($sql);
197
-		if(Database::num_rows($result)==0){
197
+		if (Database::num_rows($result) == 0) {
198 198
 			$lastorder_chapter = 0;
199
-		}else{
199
+		} else {
200 200
 			$row = Database::fetch_array($result);
201 201
 			$lastorder_chapter = ($row[0]);
202 202
 		}
203
-		$lastorder = ($lastorder_chapter>$lastorder_item?$lastorder_chapter+1:$lastorder_item+1);
203
+		$lastorder = ($lastorder_chapter > $lastorder_item ? $lastorder_chapter + 1 : $lastorder_item + 1);
204 204
 
205 205
 		foreach ($addedresource as $addedresource_item)
206 206
 		{
@@ -251,8 +251,8 @@  discard block
 block discarded – undo
251 251
 				$addedresourceassigned[$i] = 1;
252 252
 				$resource_added = true;
253 253
 			}
254
-			$i ++;
255
-			$lastorder ++;
254
+			$i++;
255
+			$lastorder++;
256 256
 		}
257 257
 		//$_SESSION['addedresource']=null;
258 258
 		//$_SESSION['addedresourceid']=null;
@@ -294,34 +294,34 @@  discard block
 block discarded – undo
294 294
 				$url = "../calendar/agenda.php?action=add";
295 295
 			}
296 296
 			$originaltoolname = get_lang("Agenda");
297
-			$breadcrumbelement = array ("url" => $url, "name" => $originaltoolname);
297
+			$breadcrumbelement = array("url" => $url, "name" => $originaltoolname);
298 298
 			session_unregister('from_learnpath');
299 299
 			unset ($from_learnpath);
300 300
 			break;
301 301
 		case "2" : // coming from forum: new topic
302 302
 			$url = "../phpbb/newtopic.php?forum=$source_forum&md5=$md5";
303 303
 			$originaltoolname = get_lang("ForumAddNewTopic");
304
-			$breadcrumbelement = array ("url" => $url, "name" => $originaltoolname);
304
+			$breadcrumbelement = array("url" => $url, "name" => $originaltoolname);
305 305
 			session_unregister('from_learnpath');
306 306
 			unset ($from_learnpath);
307 307
 			break;
308 308
 		case "3" : // coming from forum: edit topic
309 309
 			$url = "../phpbb/editpost.php?post_id=$post_id&topic=$topic&forum=$forum&md5=$md5&originalresource=no";
310 310
 			$originaltoolname = get_lang("ForumEditTopic");
311
-			$breadcrumbelement = array ("url" => $url, "name" => $originaltoolname);
311
+			$breadcrumbelement = array("url" => $url, "name" => $originaltoolname);
312 312
 			session_unregister('from_learnpath');
313 313
 			unset ($from_learnpath);
314 314
 			break;
315 315
 		case "4" : // coming from exercises: edit topic
316 316
 			$url = "../exercice/admin.php?modifyAnswers=$modifyAnswers";
317 317
 			$originaltoolname = get_lang("ExerciseAnswers");
318
-			$breadcrumbelement = array ("url" => $url, "name" => $originaltoolname);
318
+			$breadcrumbelement = array("url" => $url, "name" => $originaltoolname);
319 319
 			session_unregister('from_learnpath');
320 320
 			unset ($from_learnpath);
321 321
 			break;
322 322
 		case "5" : // coming from learning path
323 323
 			$from_learnpath = 'yes';
324
-			Session::write('from_learnpath',$from_learnpath);
324
+			Session::write('from_learnpath', $from_learnpath);
325 325
 			break;
326 326
 			/*************************************** end add [email protected] *********************************/
327 327
 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 	// We do not come from the learning path. We store the name of the tool & url in a session.
330 330
 	if ($from_learnpath != 'yes')
331 331
 	{
332
-		if (!$_SESSION["origintoolurl"] OR $_SESSION["origintoolurl"]<>$interbreadcrumb["url"])
332
+		if (!$_SESSION["origintoolurl"] OR $_SESSION["origintoolurl"] <> $interbreadcrumb["url"])
333 333
 		{
334 334
 			$_SESSION["origintoolurl"] = $breadcrumbelement["url"];
335 335
 			$_SESSION["origintoolname"] = $breadcrumbelement["name"];
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 if ($from_learnpath != 'yes')
345 345
 {
346 346
 	$nameTools = get_lang('AddResource');
347
-	$interbreadcrumb[] = array ("url" => $_SESSION["origintoolurl"], "name" => $_SESSION["origintoolname"]);
347
+	$interbreadcrumb[] = array("url" => $_SESSION["origintoolurl"], "name" => $_SESSION["origintoolname"]);
348 348
 }
349 349
 else
350 350
 {
@@ -360,9 +360,9 @@  discard block
 block discarded – undo
360 360
 
361 361
 	$from_learnpath = 'yes';
362 362
 	session_register('from_learnpath');
363
-	$interbreadcrumb[] = array ("url" => "../scorm/scormdocument.php", "name" => get_lang('LearningPath'));
364
-	$interbreadcrumb[] = array ("url" => "../learnpath/learnpath_handler.php?learnpath_id=$learnpath_id", "name" => "{$therow['learnpath_name']}");
365
-	$interbreadcrumb[] = array ("url" => api_get_self()."?action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no", "name" => "{$therow2['chapter_name']}");
363
+	$interbreadcrumb[] = array("url" => "../scorm/scormdocument.php", "name" => get_lang('LearningPath'));
364
+	$interbreadcrumb[] = array("url" => "../learnpath/learnpath_handler.php?learnpath_id=$learnpath_id", "name" => "{$therow['learnpath_name']}");
365
+	$interbreadcrumb[] = array("url" => api_get_self()."?action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no", "name" => "{$therow2['chapter_name']}");
366 366
 
367 367
 }
368 368
 
@@ -387,13 +387,13 @@  discard block
 block discarded – undo
387 387
 // we retrieve the tools that are active.
388 388
 // We use this to check which resources a student may add (only the modules that are active)
389 389
 // see http://www.dokeos.com/forum/viewtopic.php?t=4858
390
-$active_modules=array();
390
+$active_modules = array();
391 391
 $tool_table = Database::get_course_table(TABLE_TOOL_LIST);
392
-$sql_select_active="SELECT * FROM $tool_table WHERE visibility='1'";
393
-$result_select_active=Database::query($sql_select_active);
394
-while ($row=Database::fetch_array($result_select_active))
392
+$sql_select_active = "SELECT * FROM $tool_table WHERE visibility='1'";
393
+$result_select_active = Database::query($sql_select_active);
394
+while ($row = Database::fetch_array($result_select_active))
395 395
 {
396
-	$active_modules[]=$row['name'];
396
+	$active_modules[] = $row['name'];
397 397
 }
398 398
 
399 399
 
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
           <td width="26%"><b><?php echo get_lang('CourseResources'); ?></b></td>
409 409
         </tr>
410 410
         <?php
411
-        if (api_is_allowed_to_edit() OR in_array(TOOL_DOCUMENT,$active_modules))
411
+        if (api_is_allowed_to_edit() OR in_array(TOOL_DOCUMENT, $active_modules))
412 412
         {
413 413
         ?>
414 414
         <tr>
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
         </tr>
417 417
         <?php
418 418
         }
419
-        if (api_is_allowed_to_edit() OR in_array(TOOL_CALENDAR_EVENT,$active_modules))
419
+        if (api_is_allowed_to_edit() OR in_array(TOOL_CALENDAR_EVENT, $active_modules))
420 420
         {
421 421
         ?>
422 422
         <tr>
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
         </tr>
425 425
         <?php
426 426
         }
427
-        if (api_is_allowed_to_edit() OR in_array(TOOL_ANNOUNCEMENT,$active_modules))
427
+        if (api_is_allowed_to_edit() OR in_array(TOOL_ANNOUNCEMENT, $active_modules))
428 428
         {
429 429
         ?>
430 430
         <tr>
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
         </tr>
433 433
         <?php
434 434
         }
435
-        if (api_is_allowed_to_edit() OR in_array(TOOL_BB_FORUM,$active_modules))
435
+        if (api_is_allowed_to_edit() OR in_array(TOOL_BB_FORUM, $active_modules))
436 436
         {
437 437
         ?>
438 438
         <tr>
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
         </tr>
441 441
         <?php
442 442
         }
443
-        if (api_is_allowed_to_edit() OR in_array(TOOL_LINK,$active_modules))
443
+        if (api_is_allowed_to_edit() OR in_array(TOOL_LINK, $active_modules))
444 444
         {
445 445
         ?>
446 446
         <tr>
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
         </tr>
449 449
         <?php
450 450
         }
451
-        if (api_is_allowed_to_edit() OR in_array(TOOL_QUIZ,$active_modules))
451
+        if (api_is_allowed_to_edit() OR in_array(TOOL_QUIZ, $active_modules))
452 452
         {
453 453
         ?>
454 454
         <tr>
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 		<tr>
469 469
           <td width="26%"><b><?php echo get_lang('ExportableCourseResources'); ?></b></td>
470 470
         </tr>
471
-<?php if ($multi_level_learnpath === true ) { ?>
471
+<?php if ($multi_level_learnpath === true) { ?>
472 472
         <tr>
473 473
           <td><?php echo "<a href=\"".api_get_self()."?content=chapter&action=$action&id=$id&learnpath_id=$learnpath_id&chapter_id=$chapter_id&source_forum=$source_forum&originalresource=no\">".get_lang('Chapter')."</a>"; ?></td>
474 474
         </tr>
@@ -589,10 +589,10 @@  discard block
 block discarded – undo
589 589
 // Agenda items -->
590 590
 if ($content == "Agenda")
591 591
 {
592
-	$TABLEAGENDA 			= Database::get_course_table(TABLE_AGENDA);
593
-	$TABLE_ITEM_PROPERTY 	= Database::get_course_table(TABLE_ITEM_PROPERTY);
592
+	$TABLEAGENDA = Database::get_course_table(TABLE_AGENDA);
593
+	$TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
594 594
 
595
-	$sql="SELECT agenda.*, toolitemproperties.*
595
+	$sql = "SELECT agenda.*, toolitemproperties.*
596 596
 					FROM ".$TABLEAGENDA." agenda, ".$TABLE_ITEM_PROPERTY." toolitemproperties
597 597
 					WHERE agenda.id = toolitemproperties.ref
598 598
 					AND toolitemproperties.tool='".TOOL_CALENDAR_EVENT."'
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 // 2. we come to the resource linker for the first time (documents = default). In this case it can only be shown if
639 639
 //  			a. one is a teacher (documents can be shown even if the tool is inactive)
640 640
 //				b. one is a student AND the documents tool is active. Student cannot add documents if the documents tool is inactive (teacher can do this)
641
-if ($content == "Document" OR (empty($content) AND (api_is_allowed_to_edit() OR in_array(TOOL_DOCUMENT,$active_modules))) AND !$_GET['showresources'])
641
+if ($content == "Document" OR (empty($content) AND (api_is_allowed_to_edit() OR in_array(TOOL_DOCUMENT, $active_modules))) AND !$_GET['showresources'])
642 642
 {
643 643
 	// setting variables for file locations
644 644
 	$baseServDir = $_configuration['root_sys'];
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 {
699 699
 	$TBL_FORUMS 		= Database::get_course_table(TABLE_FORUM);
700 700
 	$TBL_CATAGORIES 	= Database::get_course_table(TABLE_FORUM_CATEGORY);
701
-	$TBL_FORUMTOPICS 	= Database::get_course_table(TABLE_FORUM_POST);
701
+	$TBL_FORUMTOPICS = Database::get_course_table(TABLE_FORUM_POST);
702 702
 	$tbl_posts 			= Database::get_course_table(TABLE_FORUM_POST);
703 703
 	$tbl_posts_text 	= Database::get_course_table(TOOL_FORUM_POST_TEXT_TABLE);
704 704
 
@@ -883,9 +883,9 @@  discard block
 block discarded – undo
883 883
 ?>
884 884
 	</tr>
885 885
     <tr>
886
-      <td><?php if ($is_allowedToEdit) {echo get_lang('AddToLinks');} ?></td>
886
+      <td><?php if ($is_allowedToEdit) {echo get_lang('AddToLinks'); } ?></td>
887 887
       <td>
888
-  	  <?php if ($is_allowedToEdit){?>
888
+  	  <?php if ($is_allowedToEdit) {?>
889 889
 	  <select name="add_2_links" id="add_2_links">
890 890
       <option value="niet toevoegen" selected="selected">-<?php echo get_lang('DontAdd'); ?>-</option>
891 891
 	  <option value="0"><?php echo get_lang('MainCategory'); ?></option>
Please login to merge, or discard this patch.
main/template/default/auth/courses_list.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 <!-- Actions: The menu with the different options in cathe course management -->
18 18
 <div id="actions" class="actions">
19 19
     <?php if ($action != 'createcoursecategory') { ?>
20
-	<a href="<?php echo api_get_self(); ?>?action=createcoursecategory"><?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'),'','32'); ?></a>
20
+	<a href="<?php echo api_get_self(); ?>?action=createcoursecategory"><?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'), '', '32'); ?></a>
21 21
     <?php } ?>
22 22
 </div>
23 23
 
@@ -49,26 +49,26 @@  discard block
 block discarded – undo
49 49
             $max_category_key = count($user_course_categories);
50 50
             if ($action != 'unsubscribe') { ?>
51 51
                 <a href="courses.php?action=sortmycourses&amp;categoryid=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>#category<?php echo $row['id']; ?>">
52
-                <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?>
52
+                <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?>
53 53
                 </a>
54 54
 
55 55
                 <?php if ($row['id'] != $user_course_categories[0]['id']) { ?>
56 56
                         <a href="courses.php?action=<?php echo $action ?>&amp;move=up&amp;category=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>">
57
-                        <?php echo Display::return_icon('up.png', get_lang('Up'),'',22); ?>
57
+                        <?php echo Display::return_icon('up.png', get_lang('Up'), '', 22); ?>
58 58
                         </a>
59 59
                 <?php } else { ?>
60
-                    <?php echo Display::return_icon('up_na.png', get_lang('Up'),'',22); ?>
60
+                    <?php echo Display::return_icon('up_na.png', get_lang('Up'), '', 22); ?>
61 61
                <?php } ?>
62 62
 
63 63
                 <?php if ($row['id'] != $user_course_categories[$max_category_key - 1]['id']) { ?>
64 64
                     <a href="courses.php?action=<?php echo $action; ?>&amp;move=down&amp;category=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>">
65
-                    <?php echo Display::return_icon('down.png', get_lang('Down'),'',22); ?>
65
+                    <?php echo Display::return_icon('down.png', get_lang('Down'), '', 22); ?>
66 66
                     </a>
67 67
                 <?php } else { ?>
68
-                    <?php echo Display::return_icon('down_na.png', get_lang('Down'),'',22); ?>
68
+                    <?php echo Display::return_icon('down_na.png', get_lang('Down'), '', 22); ?>
69 69
                 <?php } ?>
70 70
                 <a href="courses.php?action=deletecoursecategory&amp;id=<?php echo $row['id']; ?>&amp;sec_token=<?php echo $stok; ?>">
71
-                <?php echo Display::display_icon('delete.png', get_lang('Delete'), array('onclick' => "javascript: if (!confirm('".addslashes(api_htmlentities(get_lang("CourseCategoryAbout2bedeleted"), ENT_QUOTES, api_get_system_encoding()))."')) return false;"),22) ?>
71
+                <?php echo Display::display_icon('delete.png', get_lang('Delete'), array('onclick' => "javascript: if (!confirm('".addslashes(api_htmlentities(get_lang("CourseCategoryAbout2bedeleted"), ENT_QUOTES, api_get_system_encoding()))."')) return false;"), 22) ?>
72 72
                 </a>
73 73
             <?php }
74 74
             echo '<br /><br />';
@@ -122,35 +122,35 @@  discard block
 block discarded – undo
122 122
                     <div style="float:left;width:110px;">
123 123
                     <?php
124 124
                         if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
125
-                            $icon_title = get_lang('CourseDetails') . ' - ' . $course['title'];
125
+                            $icon_title = get_lang('CourseDetails').' - '.$course['title'];
126 126
                     ?>
127 127
                     <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" data-title="<?php echo $icon_title ?>" title="<?php echo $icon_title ?>" class="ajax">
128
-                        <?php echo Display::return_icon('info.png', $icon_title,'','22') ?>
128
+                        <?php echo Display::return_icon('info.png', $icon_title, '', '22') ?>
129 129
                        <?php } ?>
130 130
                     </a>
131 131
 
132 132
                     <?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) { ?>
133
-                          <?php echo Display::display_icon('edit_na.png', get_lang('Edit'),'',22); ?>
133
+                          <?php echo Display::display_icon('edit_na.png', get_lang('Edit'), '', 22); ?>
134 134
                     <?php } else { ?>
135 135
                         <a href="courses.php?action=<?php echo $action; ?>&amp;edit=<?php echo $course['code']; ?>&amp;sec_token=<?php echo $stok; ?>">
136
-                            <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?>
136
+                            <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?>
137 137
                             </a>
138 138
                     <?php } ?>
139 139
 
140 140
                     <?php if ($key > 0) { ?>
141 141
                         <a href="courses.php?action=<?php echo $action; ?>&amp;move=up&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
142
-                        <?php echo Display::display_icon('up.png', get_lang('Up'),'',22); ?>
142
+                        <?php echo Display::display_icon('up.png', get_lang('Up'), '', 22); ?>
143 143
                         </a>
144 144
                     <?php } else { ?>
145
-                        <?php echo Display::display_icon('up_na.png', get_lang('Up'),'',22); ?>
145
+                        <?php echo Display::display_icon('up_na.png', get_lang('Up'), '', 22); ?>
146 146
                     <?php } ?>
147 147
 
148 148
                     <?php if ($key < $number_of_courses - 1) { ?>
149 149
                         <a href="courses.php?action=<?php echo $action; ?>&amp;move=down&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
150
-                        <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?>
150
+                        <?php echo Display::display_icon('down.png', get_lang('Down'), '', 22); ?>
151 151
                         </a>
152 152
                     <?php } else { ?>
153
-                        <?php echo Display::display_icon('down_na.png', get_lang('Down'),'',22); ?>
153
+                        <?php echo Display::display_icon('down_na.png', get_lang('Down'), '', 22); ?>
154 154
                     <?php } ?>
155 155
 
156 156
                   </div>
@@ -221,36 +221,36 @@  discard block
 block discarded – undo
221 221
             <div style="float:left; width:110px">
222 222
             <?php
223 223
             if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
224
-            $icon_title = get_lang('CourseDetails') . ' - ' . $course['title'];
224
+            $icon_title = get_lang('CourseDetails').' - '.$course['title'];
225 225
             ?>
226 226
             <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" data-title="<?php echo $icon_title ?>" title="<?php echo $icon_title ?>" class="ajax">
227
-                <?php echo Display::return_icon('info.png', $icon_title, '','22'); ?>
227
+                <?php echo Display::return_icon('info.png', $icon_title, '', '22'); ?>
228 228
             </a>
229 229
             <?php } ?>
230 230
 
231 231
              <?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) {   ?>
232
-                    <?php echo Display::display_icon('edit_na.png', get_lang('Edit'),'',22); ?>
232
+                    <?php echo Display::display_icon('edit_na.png', get_lang('Edit'), '', 22); ?>
233 233
                   <?php } else { ?>
234 234
                     <a href="courses.php?action=<?php echo $action; ?>&amp;edit=<?php echo $course['code']; ?>&amp;sec_token=<?php echo $stok; ?>">
235
-                    <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?>
235
+                    <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?>
236 236
                     </a>
237 237
              <?php } ?>
238 238
 
239 239
             <!-- up /down icons-->
240 240
             <?php if ($key > 0) { ?>
241 241
                     <a href="courses.php?action=<?php echo $action; ?>&amp;move=up&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
242
-                    <?php echo Display::display_icon('up.png', get_lang('Up'),'',22) ?>
242
+                    <?php echo Display::display_icon('up.png', get_lang('Up'), '', 22) ?>
243 243
                     </a>
244 244
             <?php } else {
245
-                    echo Display::display_icon('up_na.png', get_lang('Up'),'',22);
245
+                    echo Display::display_icon('up_na.png', get_lang('Up'), '', 22);
246 246
                   }
247 247
 
248 248
                   if ($key < $number_of_courses - 1) { ?>
249 249
                     <a href="courses.php?action=<?php echo $action; ?>&amp;move=down&amp;course=<?php echo $course['code']; ?>&amp;category=<?php echo $course['user_course_cat']; ?>&amp;sec_token=<?php echo $stok; ?>">
250
-                    <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?>
250
+                    <?php echo Display::display_icon('down.png', get_lang('Down'), '', 22); ?>
251 251
                     </a>
252 252
             <?php } else {
253
-                    echo Display::display_icon('down_na.png', get_lang('Down'),'',22);
253
+                    echo Display::display_icon('down_na.png', get_lang('Down'), '', 22);
254 254
                   }?>
255 255
                 </div>
256 256
                  <div style="float:left; margin-right:10px;">
Please login to merge, or discard this patch.
main/template/default/auth/categories_list.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 <!-- Actions: The menu with the different options in cathe course management -->
17 17
 <div id="actions" class="actions">
18 18
     <a href="<?php echo api_get_self() ?>?action=sortmycourses">
19
-        <?php echo Display::return_icon('back.png', get_lang('Back'),'','32'); ?>
19
+        <?php echo Display::return_icon('back.png', get_lang('Back'), '', '32'); ?>
20 20
     </a>
21 21
 </div>
22 22
 
Please login to merge, or discard this patch.
main/group/group_overview.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
  */
16 16
 require_once '../inc/global.inc.php';
17 17
 $this_section = SECTION_COURSES;
18
-$current_course_tool  = TOOL_GROUP;
18
+$current_course_tool = TOOL_GROUP;
19 19
 
20 20
 // Notice for unauthorized people.
21 21
 api_protect_course_script(true);
@@ -85,29 +85,29 @@  discard block
 block discarded – undo
85 85
         Display::return_icon('add.png', get_lang('NewGroupCreate'), '', ICON_SIZE_MEDIUM).'</a>';
86 86
 
87 87
     if (api_get_setting('allow_group_categories') == 'true') {
88
-        $actions.= '<a href="group_category.php?'.api_get_cidreq().'&action=add_category">'.
88
+        $actions .= '<a href="group_category.php?'.api_get_cidreq().'&action=add_category">'.
89 89
             Display::return_icon('new_folder.png', get_lang('AddCategory'), '', ICON_SIZE_MEDIUM).'</a>';
90 90
     } else {
91
-        $actions.= '<a href="group_category.php?'.api_get_cidreq().'&id=2">'.
91
+        $actions .= '<a href="group_category.php?'.api_get_cidreq().'&id=2">'.
92 92
             Display::return_icon('settings.png', get_lang('PropModify'), '', ICON_SIZE_MEDIUM).'</a>';
93 93
     }
94
-    $actions.= '<a href="import.php?'.api_get_cidreq().'&action=import">'.
94
+    $actions .= '<a href="import.php?'.api_get_cidreq().'&action=import">'.
95 95
         Display::return_icon('import_csv.png', get_lang('Import'), '', ICON_SIZE_MEDIUM).'</a>';
96 96
 
97
-    $actions.= '<a href="group_overview.php?'.api_get_cidreq().'&action=export_all&type=csv">'.
97
+    $actions .= '<a href="group_overview.php?'.api_get_cidreq().'&action=export_all&type=csv">'.
98 98
         Display::return_icon('export_csv.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>';
99 99
 
100
-    $actions.= '<a href="group_overview.php?'.api_get_cidreq().'&action=export&type=xls">'.
100
+    $actions .= '<a href="group_overview.php?'.api_get_cidreq().'&action=export&type=xls">'.
101 101
     Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM).'</a>';
102 102
 
103
-    $actions.= '<a href="group_overview.php?'.api_get_cidreq().'&action=export_pdf">'.
103
+    $actions .= '<a href="group_overview.php?'.api_get_cidreq().'&action=export_pdf">'.
104 104
         Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM).'</a>';
105 105
 
106
-    $actions.= '<a href="group.php?'.api_get_cidreq().'">'.
107
-        Display::return_icon('group.png', get_lang('Groups'),'',ICON_SIZE_MEDIUM).'</a>';
106
+    $actions .= '<a href="group.php?'.api_get_cidreq().'">'.
107
+        Display::return_icon('group.png', get_lang('Groups'), '', ICON_SIZE_MEDIUM).'</a>';
108 108
 
109 109
 
110
-    $actions.= '<a href="../user/user.php?'.api_get_cidreq().'">'.
110
+    $actions .= '<a href="../user/user.php?'.api_get_cidreq().'">'.
111 111
     Display::return_icon('user.png', get_lang('GoTo').' '.get_lang('Users'), '', ICON_SIZE_MEDIUM).'</a>';
112 112
 
113 113
 // Action links
Please login to merge, or discard this patch.
main/group/member_settings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 require_once '../inc/global.inc.php';
15 15
 $this_section = SECTION_COURSES;
16
-$current_course_tool  = TOOL_GROUP;
16
+$current_course_tool = TOOL_GROUP;
17 17
 
18 18
 // Notice for unauthorized people.
19 19
 api_protect_course_script(true);
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 // Group members
163 163
 $group_member_list = GroupManager::get_subscribed_users($current_group['id']);
164 164
 
165
-$selected_users = array ();
165
+$selected_users = array();
166 166
 if (!empty($group_member_list)) {
167 167
     foreach ($group_member_list as $index => $user) {
168 168
         $selected_users[] = $user['user_id'];
Please login to merge, or discard this patch.
main/dropbox/dropbox_download.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                 ON (post.file_id = file.id AND post.c_id = $course_id AND file.c_id = $course_id)
51 51
                 WHERE
52 52
                     post.cat_id = ".intval($_GET['cat_id'])." AND
53
-                    post.dest_user_id = $user_id" ;
53
+                    post.dest_user_id = $user_id";
54 54
     }
55 55
     $files_to_download = array();
56 56
     $result = Database::query($sql);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     $_SESSION['_seen'][$_course['id']][TOOL_DROPBOX][] = intval($_GET['id']);
97 97
 
98 98
     $work = new Dropbox_Work($_GET['id']);
99
-    $path = dropbox_cnf('sysPath') . '/' . $work -> filename; //path to file as stored on server
99
+    $path = dropbox_cnf('sysPath').'/'.$work -> filename; //path to file as stored on server
100 100
 
101 101
     if (!Security::check_abs_path($path, dropbox_cnf('sysPath').'/')) {
102 102
         exit;
Please login to merge, or discard this patch.
main/dropbox/dropbox_class.inc.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
         $action = isset($_GET['action']) ? $_GET['action'] : null;
185 185
 
186 186
         // Do some sanity checks
187
-        $id	= intval($id);
187
+        $id = intval($id);
188 188
 
189 189
         // Get the data from DB
190 190
         $sql = "SELECT uploader_id, filename, filesize, title, description, author, upload_date, last_upload_date, cat_id
@@ -226,14 +226,14 @@  discard block
 block discarded – undo
226 226
                 $row_feedback['feedback'] = Security::remove_XSS($row_feedback['feedback']);
227 227
                 $feedback2[] = $row_feedback;
228 228
             }
229
-            $this->feedback2= $feedback2;
229
+            $this->feedback2 = $feedback2;
230 230
         }
231 231
 	}
232 232
 }
233 233
 
234 234
 class Dropbox_SentWork extends Dropbox_Work
235 235
 {
236
-	public $recipients;	//array of ['id']['name'] arrays
236
+	public $recipients; //array of ['id']['name'] arrays
237 237
 
238 238
 	/**
239 239
 	 * Constructor calls private functions to create a new work or retreive an existing work from DB
@@ -290,15 +290,15 @@  discard block
 block discarded – undo
290 290
 		settype($uploader_id, 'integer') or die(get_lang('GeneralError').' (code 208)'); // Set $uploader_id to correct type
291 291
 
292 292
 		$justSubmit = false;
293
-		if ( is_int($recipient_ids)) {
293
+		if (is_int($recipient_ids)) {
294 294
 			$justSubmit = true;
295 295
 			$recipient_ids = array($recipient_ids + $this->id);
296
-		} elseif ( count($recipient_ids) == 0) {
296
+		} elseif (count($recipient_ids) == 0) {
297 297
 			$justSubmit = true;
298 298
 			$recipient_ids = array($uploader_id);
299 299
 		}
300 300
 
301
-		if (! is_array($recipient_ids) || count($recipient_ids) == 0) {
301
+		if (!is_array($recipient_ids) || count($recipient_ids) == 0) {
302 302
 			die(get_lang('GeneralError').' (code 209)');
303 303
 		}
304 304
 
@@ -313,11 +313,11 @@  discard block
 block discarded – undo
313 313
         $table_person = $dropbox_cnf['tbl_person'];
314 314
         $session_id = api_get_session_id();
315 315
         $uploader_id = $this->uploader_id;
316
-        $user  = api_get_user_id();
316
+        $user = api_get_user_id();
317 317
 		// Insert data in dropbox_post and dropbox_person table for each recipient
318 318
 		foreach ($this->recipients as $rec) {
319
-            $file_id = (int)$this->id;
320
-            $user_id = (int)$rec['id'];
319
+            $file_id = (int) $this->id;
320
+            $user_id = (int) $rec['id'];
321 321
 			$sql = "INSERT INTO $table_post (c_id, file_id, dest_user_id, session_id)
322 322
                     VALUES ($course_id, $file_id, $user_id, $session_id)";
323 323
 	        Database::query($sql);
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 
334 334
                 // Do not add recipient in person table if mailing zip or just upload.
335 335
                 if (!$justSubmit) {
336
-                    Database::query($sql);	// If work already exists no error is generated
336
+                    Database::query($sql); // If work already exists no error is generated
337 337
                 }
338 338
             }
339 339
 
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 			    $ownerid = getUserOwningThisMailing($ownerid);
343 343
 			}
344 344
 			if (($recipid = $rec["id"]) > $dropbox_cnf['mailingIdBase']) {
345
-			    $recipid = $ownerid;  // mailing file recipient = mailing id, not a person
345
+			    $recipid = $ownerid; // mailing file recipient = mailing id, not a person
346 346
 			}
347 347
             api_item_property_update(
348 348
                 $_course,
@@ -401,13 +401,13 @@  discard block
 block discarded – undo
401 401
 class Dropbox_Person
402 402
 {
403 403
 	// The receivedWork and the sentWork arrays are sorted.
404
-	public $receivedWork;	// an array of Dropbox_Work objects
405
-	public $sentWork;		// an array of Dropbox_SentWork objects
404
+	public $receivedWork; // an array of Dropbox_Work objects
405
+	public $sentWork; // an array of Dropbox_SentWork objects
406 406
 
407 407
 	public $userId = 0;
408 408
 	public $isCourseAdmin = false;
409 409
 	public $isCourseTutor = false;
410
-	public $_orderBy = '';	// private property that determines by which field
410
+	public $_orderBy = ''; // private property that determines by which field
411 411
 
412 412
 	/**
413 413
 	 * Constructor for recreating the Dropbox_Person object
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 	 */
507 507
 	function orderSentWork($sort)
508 508
     {
509
-		switch($sort) {
509
+		switch ($sort) {
510 510
 			case 'lastDate':
511 511
 				$this->_orderBy = 'last_upload_date';
512 512
 				break;
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 	 */
540 540
 	function orderReceivedWork($sort)
541 541
     {
542
-		switch($sort) {
542
+		switch ($sort) {
543 543
 			case 'lastDate':
544 544
 				$this->_orderBy = 'last_upload_date';
545 545
 				break;
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
         $sql = "DELETE FROM ".$dropbox_cnf['tbl_person']."
633 633
                 WHERE c_id = $course_id AND user_id = '".$this->userId."' AND file_id ='".$id."'";
634 634
 		Database::query($sql);
635
-		removeUnusedFiles();	// Check for unused files
635
+		removeUnusedFiles(); // Check for unused files
636 636
 	}
637 637
 
638 638
 	/**
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 			Database::query($sql);
650 650
 			removeMoreIfMailing($w->id);
651 651
 		}
652
-		removeUnusedFiles();	// Check for unused files
652
+		removeUnusedFiles(); // Check for unused files
653 653
 	}
654 654
 
655 655
 	/**
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
                 WHERE c_id = $course_id AND user_id='".$this->userId."' AND file_id='".$id."'";
684 684
 		Database::query($sql);
685 685
 		removeMoreIfMailing($id);
686
-		removeUnusedFiles();	// Check for unused files
686
+		removeUnusedFiles(); // Check for unused files
687 687
 	}
688 688
 
689 689
 	/**
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 		$wi = -1;
706 706
 		foreach ($this->receivedWork as $w) {
707 707
 			$wi++;
708
-			if ($w->id == $id){
708
+			if ($w->id == $id) {
709 709
 			   $found = true;
710 710
 			   break;
711 711
 			}  // foreach (... as $wi -> $w) gives error 221! (no idea why...)
Please login to merge, or discard this patch.