Completed
Push — 1.10.x ( f409b5...1f80a0 )
by Julito
112:29 queued 56:28
created
main/inc/lib/gradebook.lib.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         }
57 57
 
58 58
         $c_id = $c_id ? intval($c_id) : api_get_course_int_id();
59
-        $table  = Database::get_course_table(TABLE_TOOL_LIST);
59
+        $table = Database::get_course_table(TABLE_TOOL_LIST);
60 60
         $sql = "SELECT * from $table
61 61
                 WHERE c_id = $c_id and name='$name'
62 62
                 LIMIT 1";
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $clean_gradebook = array();
114 114
 
115 115
         if (!empty($skill_gradebooks_source)) {
116
-            foreach($skill_gradebooks_source as $source) {
116
+            foreach ($skill_gradebooks_source as $source) {
117 117
                 $clean_gradebook[] = $source['skill_id'];
118 118
             }
119 119
         }
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         $selected_skills = self::get_skills_by_gradebook($gradebook_id);
193 193
         $clean_selected_skills = array();
194 194
         if (!empty($selected_skills)) {
195
-            foreach($selected_skills as $skill) {
195
+            foreach ($selected_skills as $skill) {
196 196
                 $clean_selected_skills[] = $skill['id'];
197 197
             }
198 198
         }
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
      * @todo the form should be auto generated
74 74
      * @param   string  url
75 75
      * @param   string  action add, edit
76
-     * @return  obj     form validator obj
76
+     * @return  FormValidator     form validator obj
77 77
      */
78 78
     public function return_form($url, $action)
79 79
     {
Please login to merge, or discard this patch.
main/inc/lib/database.lib.php 2 patches
Spacing   +18 added lines, -19 removed lines patch added patch discarded remove patch
@@ -115,8 +115,7 @@  discard block
 block discarded – undo
115 115
      */
116 116
     public static function getUTCDateTimeTypeClass()
117 117
     {
118
-        return isset(self::$utcDateTimeClass) ? self::$utcDateTimeClass :
119
-        'Application\DoctrineExtensions\DBAL\Types\UTCDateTimeType';
118
+        return isset(self::$utcDateTimeClass) ? self::$utcDateTimeClass : 'Application\DoctrineExtensions\DBAL\Types\UTCDateTimeType';
120 119
     }
121 120
 
122 121
     /**
@@ -393,7 +392,7 @@  discard block
 block discarded – undo
393 392
 
394 393
         if (!empty($params)) {
395 394
             $sql = 'INSERT INTO '.$table_name.' ('.implode(',', $params).')
396
-                    VALUES (:'.implode(', :' ,$params).')';
395
+                    VALUES (:'.implode(', :', $params).')';
397 396
 
398 397
             $statement = self::getManager()->getConnection()->prepare($sql);
399 398
             $result = $statement->execute($attributes);
@@ -434,7 +433,7 @@  discard block
 block discarded – undo
434 433
             foreach ($attributes as $key => $value) {
435 434
                 $update_sql .= "$key = :$key ";
436 435
                 if ($count < count($attributes)) {
437
-                    $update_sql.=', ';
436
+                    $update_sql .= ', ';
438 437
                 }
439 438
                 $count++;
440 439
             }
@@ -481,7 +480,7 @@  discard block
 block discarded – undo
481 480
             if ($columns == '*') {
482 481
                 $clean_columns = '*';
483 482
             } else {
484
-                $clean_columns = (string)$columns;
483
+                $clean_columns = (string) $columns;
485 484
             }
486 485
         }
487 486
 
@@ -527,9 +526,9 @@  discard block
 block discarded – undo
527 526
                     foreach ($condition_data as $condition => $value_array) {
528 527
                         if (is_array($value_array)) {
529 528
                             $clean_values = array();
530
-                            foreach($value_array as $item) {
529
+                            foreach ($value_array as $item) {
531 530
                                 $item = Database::escape_string($item);
532
-                                $clean_values[]= $item;
531
+                                $clean_values[] = $item;
533 532
                             }
534 533
                         } else {
535 534
                             $value_array = Database::escape_string($value_array);
@@ -537,23 +536,23 @@  discard block
 block discarded – undo
537 536
                         }
538 537
 
539 538
                         if (!empty($condition) && $clean_values != '') {
540
-                            $condition = str_replace('%',"'@percentage@'", $condition); //replace "%"
541
-                            $condition = str_replace("'?'","%s", $condition);
542
-                            $condition = str_replace("?","%s", $condition);
539
+                            $condition = str_replace('%', "'@percentage@'", $condition); //replace "%"
540
+                            $condition = str_replace("'?'", "%s", $condition);
541
+                            $condition = str_replace("?", "%s", $condition);
543 542
 
544
-                            $condition = str_replace("@%s@","@-@", $condition);
545
-                            $condition = str_replace("%s","'%s'", $condition);
546
-                            $condition = str_replace("@-@","@%s@", $condition);
543
+                            $condition = str_replace("@%s@", "@-@", $condition);
544
+                            $condition = str_replace("%s", "'%s'", $condition);
545
+                            $condition = str_replace("@-@", "@%s@", $condition);
547 546
 
548 547
                             // Treat conditions as string
549 548
                             $condition = vsprintf($condition, $clean_values);
550
-                            $condition = str_replace('@percentage@','%', $condition); //replace "%"
549
+                            $condition = str_replace('@percentage@', '%', $condition); //replace "%"
551 550
                             $where_return .= $condition;
552 551
                         }
553 552
                     }
554 553
 
555 554
                     if (!empty($where_return)) {
556
-                        $return_value = " WHERE $where_return" ;
555
+                        $return_value = " WHERE $where_return";
557 556
                     }
558 557
                     break;
559 558
                 case 'order':
@@ -565,7 +564,7 @@  discard block
 block discarded – undo
565 564
                         $new_order_array = explode(',', $order_array);
566 565
                         $temp_value = array();
567 566
 
568
-                        foreach($new_order_array as $element) {
567
+                        foreach ($new_order_array as $element) {
569 568
                             $element = explode(' ', $element);
570 569
                             $element = array_filter($element);
571 570
                             $element = array_values($element);
@@ -576,10 +575,10 @@  discard block
 block discarded – undo
576 575
                                 if (in_array($element[1], array('desc', 'asc'))) {
577 576
                                     $order = $element[1];
578 577
                                 }
579
-                                $temp_value[]= $element[0].' '.$order.' ';
578
+                                $temp_value[] = $element[0].' '.$order.' ';
580 579
                             } else {
581 580
                                 //by default DESC
582
-                                $temp_value[]= $element[0].' DESC ';
581
+                                $temp_value[] = $element[0].' DESC ';
583 582
                             }
584 583
                         }
585 584
                         if (!empty($temp_value)) {
@@ -594,7 +593,7 @@  discard block
 block discarded – undo
594 593
                     if (!empty($limit_array)) {
595 594
                         if (count($limit_array) > 1) {
596 595
                             $return_value .= ' LIMIT '.intval($limit_array[0]).' , '.intval($limit_array[1]);
597
-                        }  else {
596
+                        } else {
598 597
                             $return_value .= ' LIMIT '.intval($limit_array[0]);
599 598
                         }
600 599
                     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -594,7 +594,7 @@
 block discarded – undo
594 594
                     if (!empty($limit_array)) {
595 595
                         if (count($limit_array) > 1) {
596 596
                             $return_value .= ' LIMIT '.intval($limit_array[0]).' , '.intval($limit_array[1]);
597
-                        }  else {
597
+                        } else {
598 598
                             $return_value .= ' LIMIT '.intval($limit_array[0]);
599 599
                         }
600 600
                     }
Please login to merge, or discard this patch.
main/inc/lib/svg-edit/svg-editor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * @since 25/september/2010
6 6
  */
7 7
 
8
-require_once '../../../inc/global.inc.php';//hack for Chamilo
8
+require_once '../../../inc/global.inc.php'; //hack for Chamilo
9 9
 api_protect_course_script();
10 10
 api_block_anonymous_users();
11 11
 if (!isset($_SESSION['draw_dir'])) {
Please login to merge, or discard this patch.
main/inc/lib/svg-edit/extensions/imagelib/index.php 3 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -23,22 +23,22 @@  discard block
 block discarded – undo
23 23
 $array_to_search = is_array($docs_and_folders) ? $docs_and_folders : array();
24 24
 
25 25
 if (count($array_to_search) > 0) {
26
-	while (list($key) = each($array_to_search)) {
27
-		$all_files[] = basename($array_to_search[$key]['path']);
28
-	}
26
+    while (list($key) = each($array_to_search)) {
27
+        $all_files[] = basename($array_to_search[$key]['path']);
28
+    }
29 29
 }
30 30
 
31 31
 //get all svg and png files
32 32
 $accepted_extensions = array('.svg', '.png');
33 33
 
34 34
 if (is_array($all_files) && count($all_files) > 0) {
35
-	foreach ($all_files as & $file) {
36
-		$slideshow_extension = strrchr($file, '.');
37
-		$slideshow_extension = strtolower($slideshow_extension);
38
-		if (in_array($slideshow_extension, $accepted_extensions)) {
39
-			$png_svg_files[] =$file;
40
-		}
41
-	}
35
+    foreach ($all_files as & $file) {
36
+        $slideshow_extension = strrchr($file, '.');
37
+        $slideshow_extension = strtolower($slideshow_extension);
38
+        if (in_array($slideshow_extension, $accepted_extensions)) {
39
+            $png_svg_files[] =$file;
40
+        }
41
+    }
42 42
 }
43 43
 
44 44
 $disk_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document/images/gallery/';
@@ -57,24 +57,24 @@  discard block
 block discarded – undo
57 57
 <?php
58 58
 echo '<h2>'.get_lang('Course').': '.$course_info['name'].'</h2>';
59 59
 if (!empty($png_svg_files)) {
60
-	echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>';
61
-	echo '<ul>';
62
-	foreach($png_svg_files as $filename) {
63
-		$image=$disk_path.$filename;
64
-
65
-		if (strpos($filename, "svg")){
66
-			$new_sizes['width'] = 60;
67
-			$new_sizes['height'] = 60;
68
-		}
69
-		else {
70
-			$new_sizes = api_resize_image($image, 60, 60);
71
-		}
72
-
73
-		echo '<li style="display:inline; padding:8px;"><a href="'.$web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
74
-	}
75
-	echo '</ul>';
60
+    echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>';
61
+    echo '<ul>';
62
+    foreach($png_svg_files as $filename) {
63
+        $image=$disk_path.$filename;
64
+
65
+        if (strpos($filename, "svg")){
66
+            $new_sizes['width'] = 60;
67
+            $new_sizes['height'] = 60;
68
+        }
69
+        else {
70
+            $new_sizes = api_resize_image($image, 60, 60);
71
+        }
72
+
73
+        echo '<li style="display:inline; padding:8px;"><a href="'.$web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
74
+    }
75
+    echo '</ul>';
76 76
 } else {
77
-	Display::display_warning_message(get_lang('NoSVGImagesInImagesGalleryPath'));
77
+    Display::display_warning_message(get_lang('NoSVGImagesInImagesGalleryPath'));
78 78
 }
79 79
 ?>
80 80
 </body>
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
14 14
 
15
-$curdirpath='/images/gallery'; //path of library directory
15
+$curdirpath = '/images/gallery'; //path of library directory
16 16
 
17 17
 $course_info = api_get_course_info();
18 18
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 		$slideshow_extension = strrchr($file, '.');
37 37
 		$slideshow_extension = strtolower($slideshow_extension);
38 38
 		if (in_array($slideshow_extension, $accepted_extensions)) {
39
-			$png_svg_files[] =$file;
39
+			$png_svg_files[] = $file;
40 40
 		}
41 41
 	}
42 42
 }
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 $style = '<style>';
48 48
 $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";';
49 49
 $style .= '@import "'.api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/default.css";';
50
-$style .='</style>';
50
+$style .= '</style>';
51 51
 
52 52
 ?>
53 53
 <!doctype html>
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
 if (!empty($png_svg_files)) {
60 60
 	echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>';
61 61
 	echo '<ul>';
62
-	foreach($png_svg_files as $filename) {
63
-		$image=$disk_path.$filename;
62
+	foreach ($png_svg_files as $filename) {
63
+		$image = $disk_path.$filename;
64 64
 
65
-		if (strpos($filename, "svg")){
65
+		if (strpos($filename, "svg")) {
66 66
 			$new_sizes['width'] = 60;
67 67
 			$new_sizes['height'] = 60;
68 68
 		}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,8 +65,7 @@
 block discarded – undo
65 65
 		if (strpos($filename, "svg")){
66 66
 			$new_sizes['width'] = 60;
67 67
 			$new_sizes['height'] = 60;
68
-		}
69
-		else {
68
+		} else {
70 69
 			$new_sizes = api_resize_image($image, 60, 60);
71 70
 		}
72 71
 
Please login to merge, or discard this patch.
main/inc/lib/svg-edit/extensions/imagelib/groups.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
 $array_to_search = is_array($docs_and_folders) ? $docs_and_folders : array();
35 35
 
36 36
 if (count($array_to_search) > 0) {
37
-	while (list($key) = each($array_to_search)) {
38
-		$all_files[] = basename($array_to_search[$key]['path']);
39
-	}
37
+    while (list($key) = each($array_to_search)) {
38
+        $all_files[] = basename($array_to_search[$key]['path']);
39
+    }
40 40
 }
41 41
 
42 42
 //get all svg and png group files
@@ -70,26 +70,26 @@  discard block
 block discarded – undo
70 70
         ($is_allowed_to_edit || GroupManager :: is_user_in_group($_user['user_id'], $groupId))) || $group_properties['doc_state'] == 1
71 71
 ){
72 72
 
73
-	if (!empty($png_svg_files)) {
74
-		echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>';
75
-		echo '<ul>';
76
-		foreach($png_svg_files as $filename) {
77
-			$image = $group_disk_path.$filename;
78
-
79
-			if (strpos($filename, "svg")){
80
-				$new_sizes['width'] = 60;
81
-				$new_sizes['height'] = 60;
82
-			} else {
83
-				$new_sizes = api_resize_image($image, 60, 60);
84
-			}
73
+    if (!empty($png_svg_files)) {
74
+        echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>';
75
+        echo '<ul>';
76
+        foreach($png_svg_files as $filename) {
77
+            $image = $group_disk_path.$filename;
78
+
79
+            if (strpos($filename, "svg")){
80
+                $new_sizes['width'] = 60;
81
+                $new_sizes['height'] = 60;
82
+            } else {
83
+                $new_sizes = api_resize_image($image, 60, 60);
84
+            }
85 85
             echo '<li style="display:inline; padding:8px;">';
86 86
             echo '<a href = "'.$group_web_path.$filename.'" alt="'.$filename.'" title="'.$filename.'">';
87 87
             echo '<img src = "'.$group_web_path.$filename.'" width = "'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
88
-		}
89
-		echo '</ul>';
90
-	}
88
+        }
89
+        echo '</ul>';
90
+    }
91 91
 } else {
92
-	echo Display::display_warning_message(get_lang('OnlyAccessFromYourGroup'));
92
+    echo Display::display_warning_message(get_lang('OnlyAccessFromYourGroup'));
93 93
 }
94 94
 ?>
95 95
 </body>
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $slideshow_extension = strrchr($file, '.');
48 48
         $slideshow_extension = strtolower($slideshow_extension);
49 49
         if (in_array($slideshow_extension, $accepted_extensions)) {
50
-            $png_svg_files[] =$file;
50
+            $png_svg_files[] = $file;
51 51
         }
52 52
     }
53 53
 }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 $style = '<style>';
56 56
 $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";';
57 57
 $style .= '@import "'.api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/default.css";';
58
-$style .='</style>';
58
+$style .= '</style>';
59 59
 
60 60
 ?>
61 61
 <!doctype html>
@@ -68,15 +68,15 @@  discard block
 block discarded – undo
68 68
 if ((
69 69
         $group_properties['doc_state'] == 2 &&
70 70
         ($is_allowed_to_edit || GroupManager :: is_user_in_group($_user['user_id'], $groupId))) || $group_properties['doc_state'] == 1
71
-){
71
+) {
72 72
 
73 73
 	if (!empty($png_svg_files)) {
74 74
 		echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>';
75 75
 		echo '<ul>';
76
-		foreach($png_svg_files as $filename) {
76
+		foreach ($png_svg_files as $filename) {
77 77
 			$image = $group_disk_path.$filename;
78 78
 
79
-			if (strpos($filename, "svg")){
79
+			if (strpos($filename, "svg")) {
80 80
 				$new_sizes['width'] = 60;
81 81
 				$new_sizes['height'] = 60;
82 82
 			} else {
Please login to merge, or discard this patch.
main/inc/lib/svg-edit/extensions/imagelib/users.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
 		$slideshow_extension = strrchr($file, '.');
26 26
 		$slideshow_extension = strtolower($slideshow_extension);
27 27
 		if (in_array($slideshow_extension, $accepted_extensions)) {
28
-			$png_svg_files[] =$file;
28
+			$png_svg_files[] = $file;
29 29
 		}
30 30
 	}
31 31
 }
32 32
 $style = '<style>';
33 33
 $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";';
34 34
 $style .= '@import "'.api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/default.css";';
35
-$style .='</style>';
35
+$style .= '</style>';
36 36
 
37 37
 ?>
38 38
 <!doctype html>
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
 if (!empty($png_svg_files)) {
49 49
 	echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>';
50 50
 	echo '<ul>';
51
-	foreach($png_svg_files as $filename) {
51
+	foreach ($png_svg_files as $filename) {
52 52
 		$image = $user_disk_path.$filename;
53 53
 
54
-		if (strpos($filename, "svg")){
54
+		if (strpos($filename, "svg")) {
55 55
 			$new_sizes['width'] = 60;
56 56
 			$new_sizes['height'] = 60;
57 57
 		} else {
Please login to merge, or discard this patch.
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -16,19 +16,19 @@  discard block
 block discarded – undo
16 16
 //get all files and folders
17 17
 $scan_files = [];
18 18
 if (is_dir($user_disk_path)) {
19
-	$scan_files = scandir($user_disk_path);
19
+    $scan_files = scandir($user_disk_path);
20 20
 }
21 21
 //get all svg and png files
22 22
 $accepted_extensions = array('.svg', '.png');
23 23
 
24 24
 if (is_array($scan_files) && count($scan_files) > 0) {
25
-	foreach ($scan_files as & $file) {
26
-		$slideshow_extension = strrchr($file, '.');
27
-		$slideshow_extension = strtolower($slideshow_extension);
28
-		if (in_array($slideshow_extension, $accepted_extensions)) {
29
-			$png_svg_files[] =$file;
30
-		}
31
-	}
25
+    foreach ($scan_files as & $file) {
26
+        $slideshow_extension = strrchr($file, '.');
27
+        $slideshow_extension = strtolower($slideshow_extension);
28
+        if (in_array($slideshow_extension, $accepted_extensions)) {
29
+            $png_svg_files[] =$file;
30
+        }
31
+    }
32 32
 }
33 33
 $style = '<style>';
34 34
 $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";';
@@ -47,23 +47,23 @@  discard block
 block discarded – undo
47 47
 echo '<h2>'.get_lang('SocialNetwork').': '.get_lang('MyFiles').'</h2>';
48 48
 
49 49
 if (!empty($png_svg_files)) {
50
-	echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>';
51
-	echo '<ul>';
52
-	foreach($png_svg_files as $filename) {
53
-		$image = $user_disk_path.$filename;
50
+    echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>';
51
+    echo '<ul>';
52
+    foreach($png_svg_files as $filename) {
53
+        $image = $user_disk_path.$filename;
54 54
 
55
-		if (strpos($filename, "svg")){
56
-			$new_sizes['width'] = 60;
57
-			$new_sizes['height'] = 60;
58
-		} else {
59
-			$new_sizes = api_resize_image($image, 60, 60);
60
-		}
55
+        if (strpos($filename, "svg")){
56
+            $new_sizes['width'] = 60;
57
+            $new_sizes['height'] = 60;
58
+        } else {
59
+            $new_sizes = api_resize_image($image, 60, 60);
60
+        }
61 61
 
62
-			echo '<li style="display:inline; padding:8px;"><a href="'.$user_web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$user_web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
63
-	}
64
-	echo '</ul>';
62
+            echo '<li style="display:inline; padding:8px;"><a href="'.$user_web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$user_web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
63
+    }
64
+    echo '</ul>';
65 65
 } else {
66
-	Display::display_warning_message(get_lang('NoSVGImages'));
66
+    Display::display_warning_message(get_lang('NoSVGImages'));
67 67
 }
68 68
 ?>
69 69
 </body>
Please login to merge, or discard this patch.
main/inc/lib/browser/Browser.php 3 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -256,9 +256,9 @@  discard block
 block discarded – undo
256 256
     }
257 257
 
258 258
     /**
259
-    * Is the browser from facebook?
260
-    * @return boolean True if the browser is from facebook otherwise false
261
-    */
259
+     * Is the browser from facebook?
260
+     * @return boolean True if the browser is from facebook otherwise false
261
+     */
262 262
     public function isFacebook() 
263 263
     { 
264 264
         return $this->_is_facebook;
@@ -591,12 +591,12 @@  discard block
 block discarded – undo
591 591
             }
592 592
             return true;
593 593
         } // Test for versions > IE 10
594
-		else if(stripos($this->_agent, 'trident') !== false) {
595
-			$this->setBrowser(self::BROWSER_IE);
596
-			$result = explode('rv:', $this->_agent);
597
-			$this->setVersion(preg_replace('/[^0-9.]+/', '', $result[1]));
598
-			$this->_agent = str_replace(array("Mozilla", "Gecko"), "MSIE", $this->_agent);
599
-		} // Test for Pocket IE
594
+        else if(stripos($this->_agent, 'trident') !== false) {
595
+            $this->setBrowser(self::BROWSER_IE);
596
+            $result = explode('rv:', $this->_agent);
597
+            $this->setVersion(preg_replace('/[^0-9.]+/', '', $result[1]));
598
+            $this->_agent = str_replace(array("Mozilla", "Gecko"), "MSIE", $this->_agent);
599
+        } // Test for Pocket IE
600 600
         else if (stripos($this->_agent, 'mspie') !== false || stripos($this->_agent, 'pocket') !== false) {
601 601
             $aresult = explode(' ', stristr($this->_agent, 'mspie'));
602 602
             $this->setPlatform(self::PLATFORM_WINDOWS_CE);
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -345,9 +345,9 @@  discard block
 block discarded – undo
345 345
      */
346 346
     public function __toString()
347 347
     {
348
-        return "<strong>Browser Name:</strong> {$this->getBrowser()}<br/>\n" .
349
-        "<strong>Browser Version:</strong> {$this->getVersion()}<br/>\n" .
350
-        "<strong>Browser User Agent String:</strong> {$this->getUserAgent()}<br/>\n" .
348
+        return "<strong>Browser Name:</strong> {$this->getBrowser()}<br/>\n".
349
+        "<strong>Browser Version:</strong> {$this->getVersion()}<br/>\n".
350
+        "<strong>Browser User Agent String:</strong> {$this->getUserAgent()}<br/>\n".
351 351
         "<strong>Platform:</strong> {$this->getPlatform()}<br/>";
352 352
     }
353 353
 
@@ -585,13 +585,13 @@  discard block
 block discarded – undo
585 585
             $aresult = explode(' ', stristr(str_replace(';', '; ', $this->_agent), 'msie'));
586 586
             $this->setBrowser(self::BROWSER_IE);
587 587
             $this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1]));
588
-            if(stripos($this->_agent, 'IEMobile') !== false) {
588
+            if (stripos($this->_agent, 'IEMobile') !== false) {
589 589
                 $this->setBrowser(self::BROWSER_POCKET_IE);
590 590
                 $this->setMobile(true);
591 591
             }
592 592
             return true;
593 593
         } // Test for versions > IE 10
594
-		else if(stripos($this->_agent, 'trident') !== false) {
594
+		else if (stripos($this->_agent, 'trident') !== false) {
595 595
 			$this->setBrowser(self::BROWSER_IE);
596 596
 			$result = explode('rv:', $this->_agent);
597 597
 			$this->setVersion(preg_replace('/[^0-9.]+/', '', $result[1]));
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
      */
1013 1013
     protected function checkFacebookExternalHit()
1014 1014
     {
1015
-        if(stristr($this->_agent,'FacebookExternalHit'))
1015
+        if (stristr($this->_agent, 'FacebookExternalHit'))
1016 1016
         {
1017 1017
             $this->setRobot(true);
1018 1018
             $this->setFacebook(true);
@@ -1027,7 +1027,7 @@  discard block
 block discarded – undo
1027 1027
      */
1028 1028
     protected function checkForFacebookIos()
1029 1029
     {
1030
-        if(stristr($this->_agent,'FBIOS'))
1030
+        if (stristr($this->_agent, 'FBIOS'))
1031 1031
         {
1032 1032
             $this->setFacebook(true);
1033 1033
             return true;
@@ -1041,10 +1041,10 @@  discard block
 block discarded – undo
1041 1041
      */
1042 1042
     protected function getSafariVersionOnIos()
1043 1043
     {
1044
-        $aresult = explode('/',stristr($this->_agent,'Version'));
1045
-        if( isset($aresult[1]) )
1044
+        $aresult = explode('/', stristr($this->_agent, 'Version'));
1045
+        if (isset($aresult[1]))
1046 1046
         {
1047
-            $aversion = explode(' ',$aresult[1]);
1047
+            $aversion = explode(' ', $aresult[1]);
1048 1048
             $this->setVersion($aversion[0]);
1049 1049
             return true;
1050 1050
         }
@@ -1057,10 +1057,10 @@  discard block
 block discarded – undo
1057 1057
      */
1058 1058
     protected function getChromeVersionOnIos()
1059 1059
     {
1060
-        $aresult = explode('/',stristr($this->_agent,'CriOS'));
1061
-        if( isset($aresult[1]) )
1060
+        $aresult = explode('/', stristr($this->_agent, 'CriOS'));
1061
+        if (isset($aresult[1]))
1062 1062
         {
1063
-            $aversion = explode(' ',$aresult[1]);
1063
+            $aversion = explode(' ', $aresult[1]);
1064 1064
             $this->setVersion($aversion[0]);
1065 1065
             $this->setBrowser(self::BROWSER_CHROME);
1066 1066
             return true;
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
      * @return boolean True if the browser is iPhone otherwise false
1074 1074
      */
1075 1075
     protected function checkBrowseriPhone() {
1076
-        if( stripos($this->_agent,'iPhone') !== false ) {
1076
+        if (stripos($this->_agent, 'iPhone') !== false) {
1077 1077
             $this->setVersion(self::VERSION_UNKNOWN);
1078 1078
             $this->setBrowser(self::BROWSER_IPHONE);
1079 1079
             $this->getSafariVersionOnIos();
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
      * @return boolean True if the browser is iPad otherwise false
1091 1091
      */
1092 1092
     protected function checkBrowseriPad() {
1093
-        if( stripos($this->_agent,'iPad') !== false ) {
1093
+        if (stripos($this->_agent, 'iPad') !== false) {
1094 1094
             $this->setVersion(self::VERSION_UNKNOWN);
1095 1095
             $this->setBrowser(self::BROWSER_IPAD);
1096 1096
             $this->getSafariVersionOnIos();
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
      * @return boolean True if the browser is iPod otherwise false
1108 1108
      */
1109 1109
     protected function checkBrowseriPod() {
1110
-        if( stripos($this->_agent,'iPod') !== false ) {
1110
+        if (stripos($this->_agent, 'iPod') !== false) {
1111 1111
             $this->setVersion(self::VERSION_UNKNOWN);
1112 1112
             $this->setBrowser(self::BROWSER_IPOD);
1113 1113
             $this->getSafariVersionOnIos();
Please login to merge, or discard this patch.
Braces   +16 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1152,68 +1152,52 @@
 block discarded – undo
1152 1152
         if (stripos($this->_agent, 'windows') !== false)
1153 1153
         {
1154 1154
             $this->_platform = self::PLATFORM_WINDOWS;
1155
-        }
1156
-        else if (stripos($this->_agent, 'iPad') !== false)
1155
+        } else if (stripos($this->_agent, 'iPad') !== false)
1157 1156
         {
1158 1157
             $this->_platform = self::PLATFORM_IPAD;
1159
-        }
1160
-        else if (stripos($this->_agent, 'iPod') !== false)
1158
+        } else if (stripos($this->_agent, 'iPod') !== false)
1161 1159
         {
1162 1160
             $this->_platform = self::PLATFORM_IPOD;
1163
-        }
1164
-        else if (stripos($this->_agent, 'iPhone') !== false)
1161
+        } else if (stripos($this->_agent, 'iPhone') !== false)
1165 1162
         {
1166 1163
             $this->_platform = self::PLATFORM_IPHONE;
1167
-        }
1168
-        elseif (stripos($this->_agent, 'mac') !== false)
1164
+        } elseif (stripos($this->_agent, 'mac') !== false)
1169 1165
         {
1170 1166
             $this->_platform = self::PLATFORM_APPLE;
1171
-        }
1172
-        elseif (stripos($this->_agent, 'android') !== false)
1167
+        } elseif (stripos($this->_agent, 'android') !== false)
1173 1168
         {
1174 1169
             $this->_platform = self::PLATFORM_ANDROID;
1175
-        }
1176
-        elseif (stripos($this->_agent, 'linux') !== false)
1170
+        } elseif (stripos($this->_agent, 'linux') !== false)
1177 1171
         {
1178 1172
             $this->_platform = self::PLATFORM_LINUX;
1179
-        }
1180
-        else if (stripos($this->_agent, 'Nokia') !== false)
1173
+        } else if (stripos($this->_agent, 'Nokia') !== false)
1181 1174
         {
1182 1175
             $this->_platform = self::PLATFORM_NOKIA;
1183
-        }
1184
-        else if (stripos($this->_agent, 'BlackBerry') !== false)
1176
+        } else if (stripos($this->_agent, 'BlackBerry') !== false)
1185 1177
         {
1186 1178
             $this->_platform = self::PLATFORM_BLACKBERRY;
1187
-        }
1188
-        elseif (stripos($this->_agent, 'FreeBSD') !== false)
1179
+        } elseif (stripos($this->_agent, 'FreeBSD') !== false)
1189 1180
         {
1190 1181
             $this->_platform = self::PLATFORM_FREEBSD;
1191
-        }
1192
-        elseif (stripos($this->_agent, 'OpenBSD') !== false)
1182
+        } elseif (stripos($this->_agent, 'OpenBSD') !== false)
1193 1183
         {
1194 1184
             $this->_platform = self::PLATFORM_OPENBSD;
1195
-        }
1196
-        elseif (stripos($this->_agent, 'NetBSD') !== false)
1185
+        } elseif (stripos($this->_agent, 'NetBSD') !== false)
1197 1186
         {
1198 1187
             $this->_platform = self::PLATFORM_NETBSD;
1199
-        }
1200
-        elseif (stripos($this->_agent, 'OpenSolaris') !== false)
1188
+        } elseif (stripos($this->_agent, 'OpenSolaris') !== false)
1201 1189
         {
1202 1190
             $this->_platform = self::PLATFORM_OPENSOLARIS;
1203
-        }
1204
-        elseif (stripos($this->_agent, 'SunOS') !== false)
1191
+        } elseif (stripos($this->_agent, 'SunOS') !== false)
1205 1192
         {
1206 1193
             $this->_platform = self::PLATFORM_SUNOS;
1207
-        }
1208
-        elseif (stripos($this->_agent, 'OS\/2') !== false)
1194
+        } elseif (stripos($this->_agent, 'OS\/2') !== false)
1209 1195
         {
1210 1196
             $this->_platform = self::PLATFORM_OS2;
1211
-        }
1212
-        elseif (stripos($this->_agent, 'BeOS') !== false)
1197
+        } elseif (stripos($this->_agent, 'BeOS') !== false)
1213 1198
         {
1214 1199
             $this->_platform = self::PLATFORM_BEOS;
1215
-        }
1216
-        elseif (stripos($this->_agent, 'win') !== false)
1200
+        } elseif (stripos($this->_agent, 'win') !== false)
1217 1201
         {
1218 1202
             $this->_platform = self::PLATFORM_WINDOWS;
1219 1203
         }
Please login to merge, or discard this patch.
main/inc/lib/certificate.lib.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
     }
145 145
 
146 146
     /**
147
-    *  Generates an HTML Certificate and fills the path_certificate field in the DB
148
-    **/
147
+     *  Generates an HTML Certificate and fills the path_certificate field in the DB
148
+     **/
149 149
     public function generate($params = array())
150 150
     {
151 151
         // The user directory should be set
@@ -261,12 +261,12 @@  discard block
 block discarded – undo
261 261
     }
262 262
 
263 263
     /**
264
-    * update user info about certificate
265
-    * @param int $cat_id category id
266
-    * @param int $user_id user id
267
-    * @param string $path_certificate the path name of the certificate
268
-    * @return void()
269
-    */
264
+     * update user info about certificate
265
+     * @param int $cat_id category id
266
+     * @param int $user_id user id
267
+     * @param string $path_certificate the path name of the certificate
268
+     * @return void()
269
+     */
270 270
     public function update_user_info_about_certificate(
271 271
         $cat_id,
272 272
         $user_id,
@@ -368,13 +368,13 @@  discard block
 block discarded – undo
368 368
     }
369 369
 
370 370
     /**
371
-    * Shows the student's certificate (HTML file). If the global setting
372
-    * allow_public_certificates is set to 'false', no certificate can be printed.
373
-    * If the global allow_public_certificates is set to 'true' and the course
374
-    * setting allow_public_certificates is set to 0, no certificate *in this
375
-    * course* can be printed (for anonymous users). Connected users can always
376
-    * print them.
377
-    */
371
+     * Shows the student's certificate (HTML file). If the global setting
372
+     * allow_public_certificates is set to 'false', no certificate can be printed.
373
+     * If the global allow_public_certificates is set to 'true' and the course
374
+     * setting allow_public_certificates is set to 0, no certificate *in this
375
+     * course* can be printed (for anonymous users). Connected users can always
376
+     * print them.
377
+     */
378 378
     public function show()
379 379
     {
380 380
         // Special rules for anonymous users
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
             $scoredisplay = ScoreDisplay :: instance();
168 168
             $scorecourse = $my_category[0]->calc_score($this->user_id);
169
-            $scorecourse_display = isset($scorecourse) ? $scoredisplay->display_score($scorecourse,SCORE_AVERAGE) : get_lang('NoResultsAvailable');
169
+            $scorecourse_display = isset($scorecourse) ? $scoredisplay->display_score($scorecourse, SCORE_AVERAGE) : get_lang('NoResultsAvailable');
170 170
 
171 171
             // Prepare all necessary variables:
172 172
             $organization_name = api_get_setting('Institution');
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                 $organization_name, $stud_fn.' '.$stud_ln, $my_category[0]->get_name(),
181 181
                 $scorecourse_display
182 182
             );
183
-            $certif_text = str_replace("\\n","\n", $certif_text);
183
+            $certif_text = str_replace("\\n", "\n", $certif_text);
184 184
 
185 185
             //If the gradebook is related to skills we added the skills to the user
186 186
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                             // Creating new name
220 220
                             $name = md5($this->user_id.$this->certificate_data['cat_id']).'.html';
221 221
                             $my_path_certificate = $this->certification_user_path.$name;
222
-                            $path_certificate    ='/'.$name;
222
+                            $path_certificate    = '/'.$name;
223 223
 
224 224
                             //Getting QR filename
225 225
                             $file_info = pathinfo($path_certificate);
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
                                 Display::img($this->certification_web_user_path.$file_info['filename'].'_qr.png', 'QR'),
231 231
                                 $new_content_html['content']
232 232
                             );
233
-                            $my_new_content_html = mb_convert_encoding($my_new_content_html,'UTF-8', api_get_system_encoding());
233
+                            $my_new_content_html = mb_convert_encoding($my_new_content_html, 'UTF-8', api_get_system_encoding());
234 234
 
235 235
                             $result = @file_put_contents($my_path_certificate, $my_new_content_html);
236 236
                             if ($result) {
@@ -273,8 +273,8 @@  discard block
 block discarded – undo
273 273
         $path_certificate
274 274
     ) {
275 275
         $table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE);
276
-        if (!UserManager::is_user_certified($cat_id,$user_id)) {
277
-            $sql='UPDATE '.$table_certificate.' SET path_certificate="'.Database::escape_string($path_certificate).'"
276
+        if (!UserManager::is_user_certified($cat_id, $user_id)) {
277
+            $sql = 'UPDATE '.$table_certificate.' SET path_certificate="'.Database::escape_string($path_certificate).'"
278 278
                  WHERE cat_id="'.intval($cat_id).'" AND user_id="'.intval($user_id).'" ';
279 279
             Database::query($sql);
280 280
         }
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 
331 331
         if (!empty($content)) {
332 332
             foreach ($content as $key => $value) {
333
-                $my_header = str_replace(array('((', '))') , '', $headers[$key]);
333
+                $my_header = str_replace(array('((', '))'), '', $headers[$key]);
334 334
                 $final_content[$my_header] = $value;
335 335
             }
336 336
         }
@@ -358,11 +358,11 @@  discard block
 block discarded – undo
358 358
             $final_content['gradebook_institution'].' - '.
359 359
             $final_content['gradebook_sitename'].' - '.
360 360
             get_lang('Certification').$break_space.
361
-            get_lang('Student'). ': '.$final_content['user_firstname'].' '.$final_content['user_lastname'].$break_space.
362
-            get_lang('Teacher'). ': '.$final_content['teacher_firstname'].' '.$final_content['teacher_lastname'].$break_space.
363
-            get_lang('Date'). ': '.$final_content['date_certificate'].$break_space.
364
-            get_lang('Score'). ': '.$final_content['gradebook_grade'].$break_space.
365
-            'URL'. ': '.$final_content['certificate_link'];
361
+            get_lang('Student').': '.$final_content['user_firstname'].' '.$final_content['user_lastname'].$break_space.
362
+            get_lang('Teacher').': '.$final_content['teacher_firstname'].' '.$final_content['teacher_lastname'].$break_space.
363
+            get_lang('Date').': '.$final_content['date_certificate'].$break_space.
364
+            get_lang('Score').': '.$final_content['gradebook_grade'].$break_space.
365
+            'URL'.': '.$final_content['certificate_link'];
366 366
 
367 367
         return $text;
368 368
     }
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
         if (!empty($this->certificate_data['path_certificate'])) {
416 416
             $user_certificate = $this->certification_user_path.basename($this->certificate_data['path_certificate']);
417 417
             if (file_exists($user_certificate)) {
418
-                header('Content-Type: text/html; charset='. api_get_system_encoding());
418
+                header('Content-Type: text/html; charset='.api_get_system_encoding());
419 419
                 echo @file_get_contents($user_certificate);
420 420
             }
421 421
         } else {
Please login to merge, or discard this patch.
main/inc/lib/phpmailer/language/phpmailer.lang-ar.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 $PHPMAILER_LANG['mailer_not_supported'] = ' mailer غير مدعوم.';
20 20
 //$PHPMAILER_LANG['provide_address']      = 'You must provide at least one recipient email address.';
21 21
 $PHPMAILER_LANG['recipients_failed']    = 'SMTP Error: الأخطاء التالية ' .
22
-                                          'فشل في الارسال لكل من : ';
22
+                                            'فشل في الارسال لكل من : ';
23 23
 $PHPMAILER_LANG['signing']              = 'خطأ في التوقيع: ';
24 24
 //$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';
25 25
 //$PHPMAILER_LANG['smtp_error']           = 'SMTP server error: ';
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 //$PHPMAILER_LANG['invalid_email']        = 'Not sending, email address is invalid: ';
19 19
 $PHPMAILER_LANG['mailer_not_supported'] = ' mailer غير مدعوم.';
20 20
 //$PHPMAILER_LANG['provide_address']      = 'You must provide at least one recipient email address.';
21
-$PHPMAILER_LANG['recipients_failed']    = 'SMTP Error: الأخطاء التالية ' .
21
+$PHPMAILER_LANG['recipients_failed']    = 'SMTP Error: الأخطاء التالية '.
22 22
                                           'فشل في الارسال لكل من : ';
23 23
 $PHPMAILER_LANG['signing']              = 'خطأ في التوقيع: ';
24 24
 //$PHPMAILER_LANG['smtp_connect_failed']  = 'SMTP Connect() failed.';
Please login to merge, or discard this patch.