Completed
Pull Request — 1.11.x (#1185)
by José
58:02 queued 15:33
created
main/admin/course_import.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,13 +15,13 @@  discard block
 block discarded – undo
15 15
  */
16 16
 function validate_data($courses)
17 17
 {
18
-    $errors = array ();
19
-    $coursecodes = array ();
18
+    $errors = array();
19
+    $coursecodes = array();
20 20
     foreach ($courses as $index => $course) {
21
-        $course['line'] = $index +1;
21
+        $course['line'] = $index + 1;
22 22
 
23 23
         // 1. Check whether mandatory fields are set.
24
-        $mandatory_fields = array ('Code', 'Title', 'CourseCategory');
24
+        $mandatory_fields = array('Code', 'Title', 'CourseCategory');
25 25
         foreach ($mandatory_fields as $field) {
26 26
             if (empty($course[$field])) {
27 27
                 $course['error'] = get_lang($field.'Mandatory');
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             }
65 65
         }
66 66
 
67
-        if(!empty($course['CourseCategory'])) {
67
+        if (!empty($course['CourseCategory'])) {
68 68
             $categoryInfo = CourseCategory::getCategory($course['CourseCategory']);
69 69
             if (empty($categoryInfo)) {
70 70
                 CourseCategory::addNode($course['CourseCategory'], $course['CourseCategoryName'] ? $course['CourseCategoryName'] : $course['CourseCategory'], 'TRUE', null);
Please login to merge, or discard this patch.