Passed
Push — 1.10.x ( aae6b1...e5a590 )
by Yannick
131:05 queued 81:36
created
main/newscorm/openoffice_presentation.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             );
86 86
 
87 87
             // Generating the thumbnail.
88
-            $image = $this->base_work_dir.$this->created_dir .'/'. $file_name;
88
+            $image = $this->base_work_dir.$this->created_dir.'/'.$file_name;
89 89
 
90 90
             $pattern = '/(\w+)\.png$/';
91 91
             $replacement = '${1}_thumb.png';
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
             $my_new_image = new Image($image);
103 103
             $my_new_image->resize($thumb_width, $thumb_height);
104
-            $my_new_image->send_image($this->base_work_dir.$this->created_dir .'/'. $thumb_name, -1, 'png');
104
+            $my_new_image->send_image($this->base_work_dir.$this->created_dir.'/'.$thumb_name, -1, 'png');
105 105
 
106 106
             // Adding the thumbnail to documents.
107 107
             $document_id_thumb = add_document(
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     <body>
128 128
         <img src="'.$slide_src.'" />
129 129
     </body>
130
-</html>');  // This indentation is to make the generated html files to look well.
130
+</html>'); // This indentation is to make the generated html files to look well.
131 131
 
132 132
             fclose($fp);
133 133
             $document_id = add_document(
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                     foreach ($specific_fields as $specific_field) {
163 163
                         if (isset($_REQUEST[$specific_field['code']])) {
164 164
                             $sterms = trim($_REQUEST[$specific_field['code']]);
165
-                            $all_specific_terms .= ' '. $sterms;
165
+                            $all_specific_terms .= ' '.$sterms;
166 166
                             if (!empty($sterms)) {
167 167
                                 $sterms = explode(',', $sterms);
168 168
                                 foreach ($sterms as $sterm) {
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
                             }
172 172
                         }
173 173
                     }
174
-                    $slide_body = $all_specific_terms .' '. $slide_body;
174
+                    $slide_body = $all_specific_terms.' '.$slide_body;
175 175
                     $ic_slide->addValue('content', $slide_body);
176 176
                     /* FIXME:  cidReq:lp_id:doc_id al indexar  */
177 177
                     // Add a comment to say terms separated by commas.
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                         SE_COURSE_ID => $courseid,
184 184
                         SE_TOOL_ID => TOOL_LEARNPATH,
185 185
                         SE_DATA => array('lp_id' => $lp_id, 'lp_item' => $previous, 'document_id' => $document_id),
186
-                        SE_USER => (int)api_get_user_id(),
186
+                        SE_USER => (int) api_get_user_id(),
187 187
                     );
188 188
                     $ic_slide->xapian_data = serialize($xapian_data);
189 189
                     $di->addChunk($ic_slide);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         $_course = api_get_course_info();
222 222
         foreach ($files as $file) {
223 223
             // '||' is used as separator between slide name (with accents) and file name (without accents).
224
-            list($slide_name,$file_name) = explode('||',$file);
224
+            list($slide_name, $file_name) = explode('||', $file);
225 225
             $slide_name = api_htmlentities($slide_name, ENT_COMPAT, $this->original_charset);
226 226
             $slide_name = str_replace('&rsquo;', '\'', $slide_name);
227 227
             $slide_name = api_convert_encoding($slide_name, api_get_system_encoding(), $this->original_charset);
Please login to merge, or discard this patch.
main/newscorm/blank.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /* For licensing terms, see /license.txt */
3 3
 /**
4
- * Script that displays a blank page (with later a message saying why)
5
- * @package chamilo.learnpath
6
- * @author Yannick Warnier <[email protected]>
7
- */
4
+     * Script that displays a blank page (with later a message saying why)
5
+     * @package chamilo.learnpath
6
+     * @author Yannick Warnier <[email protected]>
7
+     */
8 8
 // Flag to allow for anonymous user - needs to be set before global.inc.php.
9 9
 $use_anonymous = true;
10 10
 require_once '../inc/global.inc.php';
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 Display::display_reduced_header();
17 17
 
18 18
 if (isset($_GET['error'])) {
19
-    switch ($_GET['error']){
19
+    switch ($_GET['error']) {
20 20
         case 'document_deleted':
21 21
             echo '<br /><br />';
22 22
             Display::display_error_message(get_lang('DocumentHasBeenDeleted'));
Please login to merge, or discard this patch.
main/newscorm/lp_move_item.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -23,23 +23,23 @@
 block discarded – undo
23 23
 $htmlHeadXtra[] = '<script type="text/javascript">'.
24 24
 $_SESSION['oLP']->get_js_dropdown_array() .
25 25
 'function load_cbo(id){' ."\n" .
26
-  'if (!id) {return false;}'.
27
-  'var cbo = document.getElementById(\'previous\');' .
28
-  'for(var i = cbo.length - 1; i > 0; i--) {' .
26
+    'if (!id) {return false;}'.
27
+    'var cbo = document.getElementById(\'previous\');' .
28
+    'for(var i = cbo.length - 1; i > 0; i--) {' .
29 29
     'cbo.options[i] = null;' .
30
- '}' ."\n" .
31
-  'var k=0;' .
32
-  'for(var i = 1; i <= child_name[id].length; i++){' ."\n" .
33
-  '  cbo.options[i] = new Option(child_name[id][i-1], child_value[id][i-1]);' ."\n" .
34
-  '  k=i;' ."\n" .
35
-  '}' ."\n" .
36
-  'cbo.options[k].selected = true;'."\n" .
30
+    '}' ."\n" .
31
+    'var k=0;' .
32
+    'for(var i = 1; i <= child_name[id].length; i++){' ."\n" .
33
+    '  cbo.options[i] = new Option(child_name[id][i-1], child_value[id][i-1]);' ."\n" .
34
+    '  k=i;' ."\n" .
35
+    '}' ."\n" .
36
+    'cbo.options[k].selected = true;'."\n" .
37 37
 '}'."\n" .
38 38
 '$().ready(function() {'."\n" .
39
-  'if ($(\'#previous\')) {'."\n" .
39
+    'if ($(\'#previous\')) {'."\n" .
40 40
     'if(\'parent is\'+$(\'#idParent\').val()) {'.
41
-      'load_cbo($(\'#idParent\').val());'."\n" .
42
-  '}}'."\n" .
41
+        'load_cbo($(\'#idParent\').val());'."\n" .
42
+    '}}'."\n" .
43 43
 '});</script>'."\n" ;
44 44
 
45 45
 /* Constants and variables */
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -21,26 +21,26 @@  discard block
 block discarded – undo
21 21
 
22 22
 /* Header and action code */
23 23
 $htmlHeadXtra[] = '<script type="text/javascript">'.
24
-$_SESSION['oLP']->get_js_dropdown_array() .
25
-'function load_cbo(id){' ."\n" .
24
+$_SESSION['oLP']->get_js_dropdown_array().
25
+'function load_cbo(id){'."\n".
26 26
   'if (!id) {return false;}'.
27
-  'var cbo = document.getElementById(\'previous\');' .
28
-  'for(var i = cbo.length - 1; i > 0; i--) {' .
29
-    'cbo.options[i] = null;' .
30
- '}' ."\n" .
31
-  'var k=0;' .
32
-  'for(var i = 1; i <= child_name[id].length; i++){' ."\n" .
33
-  '  cbo.options[i] = new Option(child_name[id][i-1], child_value[id][i-1]);' ."\n" .
34
-  '  k=i;' ."\n" .
35
-  '}' ."\n" .
36
-  'cbo.options[k].selected = true;'."\n" .
37
-'}'."\n" .
38
-'$().ready(function() {'."\n" .
39
-  'if ($(\'#previous\')) {'."\n" .
27
+  'var cbo = document.getElementById(\'previous\');'.
28
+  'for(var i = cbo.length - 1; i > 0; i--) {'.
29
+    'cbo.options[i] = null;'.
30
+ '}'."\n".
31
+  'var k=0;'.
32
+  'for(var i = 1; i <= child_name[id].length; i++){'."\n".
33
+  '  cbo.options[i] = new Option(child_name[id][i-1], child_value[id][i-1]);'."\n".
34
+  '  k=i;'."\n".
35
+  '}'."\n".
36
+  'cbo.options[k].selected = true;'."\n".
37
+'}'."\n".
38
+'$().ready(function() {'."\n".
39
+  'if ($(\'#previous\')) {'."\n".
40 40
     'if(\'parent is\'+$(\'#idParent\').val()) {'.
41
-      'load_cbo($(\'#idParent\').val());'."\n" .
42
-  '}}'."\n" .
43
-'});</script>'."\n" ;
41
+      'load_cbo($(\'#idParent\').val());'."\n".
42
+  '}}'."\n".
43
+'});</script>'."\n";
44 44
 
45 45
 /* Constants and variables */
46 46
 
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
 /* SHOWING THE ADMIN TOOLS */
80 80
 
81 81
 if (isset($_SESSION['gradebook'])) {
82
-    $gradebook=	$_SESSION['gradebook'];
82
+    $gradebook = $_SESSION['gradebook'];
83 83
 }
84 84
 
85 85
 if (!empty($gradebook) && $gradebook == 'view') {
86
-    $interbreadcrumb[] = array (
86
+    $interbreadcrumb[] = array(
87 87
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
88 88
         'name' => get_lang('ToolGradebook')
89 89
     );
Please login to merge, or discard this patch.
main/newscorm/lp_impress.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
     api_get_group_id()
37 37
 );
38 38
 if (!api_is_allowed_to_edit(null, true) && intval($visibility) == 0 ) {
39
-     api_not_allowed();
39
+        api_not_allowed();
40 40
 }
41 41
 
42 42
 if (empty($_SESSION['oLP'])) {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     null,
36 36
     api_get_group_id()
37 37
 );
38
-if (!api_is_allowed_to_edit(null, true) && intval($visibility) == 0 ) {
38
+if (!api_is_allowed_to_edit(null, true) && intval($visibility) == 0) {
39 39
      api_not_allowed();
40 40
 }
41 41
 
@@ -73,22 +73,22 @@  discard block
 block discarded – undo
73 73
 $html = '';
74 74
 $step = 1;
75 75
 foreach ($list as $toc) {
76
-    $x = 1000*$step;
76
+    $x = 1000 * $step;
77 77
     $html .= '<div id="step-'.$step.'" class="step slide" data-x="'.$x.'" data-y="-1500"  >';
78 78
     $html .= '<div class="impress-content">';
79 79
     $src = $_SESSION['oLP']->get_link('http', $toc['id']);
80 80
     if ($toc['type'] !== 'dokeos_chapter') {
81 81
         //just showing the src in a iframe ...
82 82
         $html .= '<h2>'.$toc['title'].'</h2>';
83
-        $html .= '<iframe border="0" frameborder="0" style="width:100%;height:600px" src="' . $src . '"></iframe>';
84
-    }else{
83
+        $html .= '<iframe border="0" frameborder="0" style="width:100%;height:600px" src="'.$src.'"></iframe>';
84
+    } else {
85 85
         $html .= "<div class='impress-title'>";
86 86
         $html .= '<h1>'.$toc['title'].'</h1>';
87 87
         $html .= "</div>";
88 88
     }
89 89
     $html .= "</div>";
90 90
     $html .= "</div>";
91
-    $step ++;
91
+    $step++;
92 92
 }
93 93
 
94 94
 //Setting the template
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
         //just showing the src in a iframe ...
82 82
         $html .= '<h2>'.$toc['title'].'</h2>';
83 83
         $html .= '<iframe border="0" frameborder="0" style="width:100%;height:600px" src="' . $src . '"></iframe>';
84
-    }else{
84
+    } else{
85 85
         $html .= "<div class='impress-title'>";
86 86
         $html .= '<h1>'.$toc['title'].'</h1>';
87 87
         $html .= "</div>";
Please login to merge, or discard this patch.
main/newscorm/scormOrganization.class.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -38,14 +38,14 @@  discard block
 block discarded – undo
38 38
                     //if ($first_item->type == XML_ELEMENT_NODE) this is already check prior to the call to this function.
39 39
                     $children = $element->childNodes;
40 40
                     foreach ($children as $child) {
41
-                         switch ($child->nodeType) {
41
+                            switch ($child->nodeType) {
42 42
                             case XML_ELEMENT_NODE:
43 43
                                 switch ($child->tagName) {
44 44
                                     case 'item':
45 45
                                          $oItem = new scormItem('manifest', $child);
46
-                                         if ($oItem->identifier != '') {
46
+                                            if ($oItem->identifier != '') {
47 47
                                             $this->items[$oItem->identifier] = $oItem;
48
-                                         }
48
+                                            }
49 49
                                         break;
50 50
                                     case 'metadata':
51 51
                                         $this->metadata = new scormMetadata('manifest', $child);
@@ -58,24 +58,24 @@  discard block
 block discarded – undo
58 58
                                         break;
59 59
                                 }
60 60
                                 break;
61
-                             case XML_TEXT_NODE:
61
+                                case XML_TEXT_NODE:
62 62
                                  break;
63
-                         }
63
+                            }
64 64
                     }
65 65
 
66 66
                     if ($element->hasAttributes()) {
67
-                         $attributes = $element->attributes;
68
-                         //$keep_href = '';
69
-                         foreach ($attributes as $attrib) {
70
-                             switch ($attrib->name) {
71
-                                 case 'identifier':
67
+                            $attributes = $element->attributes;
68
+                            //$keep_href = '';
69
+                            foreach ($attributes as $attrib) {
70
+                                switch ($attrib->name) {
71
+                                    case 'identifier':
72 72
                                      $this->identifier = $attrib->value;
73
-                                     break;
74
-                                 case 'structure':
73
+                                        break;
74
+                                    case 'structure':
75 75
                                      $this->structure = $attrib->value;
76
-                                     break;
77
-                             }
78
-                         }
76
+                                        break;
77
+                                }
78
+                            }
79 79
                     }
80 80
 
81 81
                     return true;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
         foreach ($this->items as $id => $dummy) {
99 99
             $abs_order = 0;
100 100
             // Passes the array as a pointer so it is modified in $list directly.
101
-            $this->items[$id]->get_flat_list($list,$abs_order, $i, 0);
101
+            $this->items[$id]->get_flat_list($list, $abs_order, $i, 0);
102 102
             $i++;
103 103
         }
104 104
 
Please login to merge, or discard this patch.
main/newscorm/storageapi.php 3 patches
Switch Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -15,52 +15,52 @@
 block discarded – undo
15 15
 }
16 16
 
17 17
 switch ($_REQUEST['action']) {
18
-    case "get":
19
-        print storage_get($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']);
20
-        break;
21
-    case "set":
22
-        if (storage_can_set($_REQUEST['svuser'])) {
23
-            print storage_set($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']);
24
-        }
25
-        break;
26
-    case "getall":
27
-        print storage_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco']);
28
-        break;
29
-    case "stackpush":
30
-        if (storage_can_set($_REQUEST['svuser'])) {
31
-            print storage_stack_push($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']);
32
-        }
33
-        break;
34
-    case "stackpop":
35
-        if (storage_can_set($_REQUEST['svuser'])) {
36
-            print storage_stack_pop($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']);
37
-        }
38
-        break;
39
-    case "stacklength":
40
-        print storage_stack_length($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']);
41
-        break;
42
-    case "stackclear":
43
-        if (storage_can_set($_REQUEST['svuser'])) {
44
-            print storage_stack_clear($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']);
45
-        }
46
-        break;
47
-    case "stackgetall":
48
-        if (storage_can_set($_REQUEST['svuser']))
49
-            print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']);
50
-        break;
51
-    case "getposition":
52
-        print storage_get_position($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc']);
53
-        break;
54
-    case "getleaders":
55
-        print storage_get_leaders($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc'], $_REQUEST['svlength']);
56
-        break;
57
-    case "usersgetall":
58
-// security issue
59
-        print "NOT allowed, security issue, see sources";
60
-//		print storage_get_all_users();
61
-        break;
62
-    default:
63
-        // Do nothing
18
+        case "get":
19
+            print storage_get($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']);
20
+            break;
21
+        case "set":
22
+            if (storage_can_set($_REQUEST['svuser'])) {
23
+                print storage_set($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']);
24
+            }
25
+            break;
26
+        case "getall":
27
+            print storage_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco']);
28
+            break;
29
+        case "stackpush":
30
+            if (storage_can_set($_REQUEST['svuser'])) {
31
+                print storage_stack_push($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svvalue']);
32
+            }
33
+            break;
34
+        case "stackpop":
35
+            if (storage_can_set($_REQUEST['svuser'])) {
36
+                print storage_stack_pop($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']);
37
+            }
38
+            break;
39
+        case "stacklength":
40
+            print storage_stack_length($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']);
41
+            break;
42
+        case "stackclear":
43
+            if (storage_can_set($_REQUEST['svuser'])) {
44
+                print storage_stack_clear($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']);
45
+            }
46
+            break;
47
+        case "stackgetall":
48
+            if (storage_can_set($_REQUEST['svuser']))
49
+                print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']);
50
+            break;
51
+        case "getposition":
52
+            print storage_get_position($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc']);
53
+            break;
54
+        case "getleaders":
55
+            print storage_get_leaders($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc'], $_REQUEST['svlength']);
56
+            break;
57
+        case "usersgetall":
58
+    // security issue
59
+            print "NOT allowed, security issue, see sources";
60
+    //		print storage_get_all_users();
61
+            break;
62
+        default:
63
+            // Do nothing
64 64
 }
65 65
 
66 66
 function storage_can_set($sv_user) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         and sco_id = '$sv_sco'
104 104
         and course_id = '$sv_course'
105 105
         and sv_key = '$sv_key'
106
-        order by sv_value ".($sv_asc ? "ASC": "DESC")." limit $sv_length";
106
+        order by sv_value ".($sv_asc ? "ASC" : "DESC")." limit $sv_length";
107 107
 //	$sql_data = "select sv.user_id as user_id, sv_key as variable, sv_value as value
108 108
 //		from ".Database::get_main_table(TABLE_TRACK_STORED_VALUES)." sv
109 109
 //		where sv.user_id in (select u2.user_id from ($sql_leaders) u2)
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         and search.sco_id = '$sv_sco'
136 136
         and search.course_id = '$sv_course'
137 137
         and search.sv_key = '$sv_key'
138
-        and list.sv_value ".($sv_asc ? "<=": ">=")." search.sv_value
138
+        and list.sv_value ".($sv_asc ? "<=" : ">=")." search.sv_value
139 139
         and list.sco_id = search.sco_id
140 140
         and list.course_id = search.course_id
141 141
         and list.sv_key = search.sv_key
Please login to merge, or discard this patch.
Braces   +6 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,8 +45,9 @@  discard block
 block discarded – undo
45 45
         }
46 46
         break;
47 47
     case "stackgetall":
48
-        if (storage_can_set($_REQUEST['svuser']))
49
-            print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']);
48
+        if (storage_can_set($_REQUEST['svuser'])) {
49
+                    print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']);
50
+        }
50 51
         break;
51 52
     case "getposition":
52 53
         print storage_get_position($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc']);
@@ -87,8 +88,7 @@  discard block
 block discarded – undo
87 88
         } else {
88 89
             return $row['sv_value'];
89 90
         }
90
-    }
91
-    else {
91
+    } else {
92 92
         return null;
93 93
     }
94 94
 }
@@ -144,8 +144,7 @@  discard block
 block discarded – undo
144 144
     if (Database::num_rows($res) > 0) {
145 145
         $row = Database::fetch_assoc($res);
146 146
         return $row['position'];
147
-    }
148
-    else {
147
+    } else {
149 148
         return null;
150 149
     }
151 150
 }
@@ -198,8 +197,7 @@  discard block
 block discarded – undo
198 197
     if ($resorder && $resinsert) {
199 198
         Database::query("commit");
200 199
         return 1;
201
-    }
202
-    else {
200
+    } else {
203 201
         Database::query("rollback");
204 202
         return 0;
205 203
     }
Please login to merge, or discard this patch.
main/newscorm/lp_view_item.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 // Using the resource linker as a tool for adding resources to the learning path.
66 66
 if ($action == 'add' && $type == 'learnpathitem') {
67
-     $htmlHeadXtra[] = "<script> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>";
67
+        $htmlHeadXtra[] = "<script> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>";
68 68
 }
69 69
 if ((!$is_allowed_to_edit) || ($isStudentView)) {
70 70
     error_log('New LP - User not authorized in lp_view_item.php');
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 // Theme calls
99 99
 $show_learn_path = true;
100 100
 if (isset($_SESSION['oLP']) && is_object($_SESSION['oLP'])) {
101
-	$lp_theme_css = $_SESSION['oLP']->get_theme();
101
+    $lp_theme_css = $_SESSION['oLP']->get_theme();
102 102
 }
103 103
 
104 104
 if ($mode == 'fullpage') {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 if (isset($_GET['lp_item_id'])) {
21 21
 
22 22
     // Get parameter only came from lp_view.php.
23
-    $lp_item_id  = intval($_GET['lp_item_id']);
23
+    $lp_item_id = intval($_GET['lp_item_id']);
24 24
     if (isset($_SESSION['lpobject'])) {
25 25
         $oLP = unserialize($_SESSION['lpobject']);
26 26
     }
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
         $src = $oLP->get_link('http', $lp_item_id);
29 29
     }
30 30
 
31
-    $url_info 		= parse_url($src);
32
-    $real_url_info	= parse_url(api_get_path(WEB_PATH));
31
+    $url_info = parse_url($src);
32
+    $real_url_info = parse_url(api_get_path(WEB_PATH));
33 33
 
34 34
     // The host must be the same.
35 35
     if ($url_info['host'] == $real_url_info['host']) {
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 
76 76
 $course_id = api_get_course_int_id();
77 77
 $sql_query = "SELECT * FROM $tbl_lp WHERE c_id = $course_id AND id = $learnpath_id";
78
-$result=Database::query($sql_query);
79
-$therow=Database::fetch_array($result);
78
+$result = Database::query($sql_query);
79
+$therow = Database::fetch_array($result);
80 80
 
81 81
 /* SHOWING THE ADMIN TOOLS	*/
82 82
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 }
86 86
 
87 87
 if (!empty($gradebook) && $gradebook == 'view') {
88
-    $interbreadcrumb[] = array (
88
+    $interbreadcrumb[] = array(
89 89
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
90 90
         'name' => get_lang('ToolGradebook')
91 91
     );
Please login to merge, or discard this patch.
main/newscorm/scormMetadata.class.php 2 patches
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -39,60 +39,60 @@
 block discarded – undo
39 39
                 case 'manifest': // Do the same as the default.
40 40
                      $children = $element->childNodes;
41 41
                     foreach ($children as $child) {
42
-                         switch ($child->nodeType) {
43
-                             case XML_ELEMENT_NODE:
42
+                            switch ($child->nodeType) {
43
+                                case XML_ELEMENT_NODE:
44 44
                                 // Could be 'lom', 'schema', 'schemaversion' or 'location'.
45 45
                                  switch ($child->tagName) {
46
-                                     case 'lom':
46
+                                        case 'lom':
47 47
                                          $childchildren = $child->childNodes;
48
-                                         foreach ($childchildren as $childchild) {
49
-                                             $this->lom = $childchild->nodeValue;
50
-                                         }
51
-                                         break;
52
-                                     case 'schema':
48
+                                            foreach ($childchildren as $childchild) {
49
+                                                $this->lom = $childchild->nodeValue;
50
+                                            }
51
+                                            break;
52
+                                        case 'schema':
53 53
                                          $childchildren = $child->childNodes;
54
-                                         foreach ($childchildren as $childchild) {
55
-                                             // There is generally only one child here.
56
-                                             $this->schema = $childchild->nodeValue;
57
-                                         }
58
-                                         break;
59
-                                     case 'schemaversion':
54
+                                            foreach ($childchildren as $childchild) {
55
+                                                // There is generally only one child here.
56
+                                                $this->schema = $childchild->nodeValue;
57
+                                            }
58
+                                            break;
59
+                                        case 'schemaversion':
60 60
                                          $childchildren = $child->childNodes;
61
-                                         foreach ($childchildren as $childchild) {
62
-                                             // There is generally only one child here.
63
-                                             $this->schemaversion = $childchild->nodeValue;
64
-                                         }
65
-                                         break;
66
-                                     case 'location':
61
+                                            foreach ($childchildren as $childchild) {
62
+                                                // There is generally only one child here.
63
+                                                $this->schemaversion = $childchild->nodeValue;
64
+                                            }
65
+                                            break;
66
+                                        case 'location':
67 67
                                          $childchildren = $child->childNodes;
68
-                                         foreach ($childchildren as $childchild) {
69
-                                             // There is generally only one child here.
70
-                                             $this->location = $childchild->nodeValue;
71
-                                         }
72
-                                         break;
73
-                                 }
74
-                                 break;
75
-                             case XML_TEXT_NODE:
68
+                                            foreach ($childchildren as $childchild) {
69
+                                                // There is generally only one child here.
70
+                                                $this->location = $childchild->nodeValue;
71
+                                            }
72
+                                            break;
73
+                                    }
74
+                                    break;
75
+                                case XML_TEXT_NODE:
76 76
                                  if (trim($child->textContent) != '') {
77
-                                     if (count($children == 1)) {
78
-                                         // If this is the only child at this level and it is a content... save differently.
79
-                                         $this->text = $child->textContent;
80
-                                     } else {
81
-                                         $this->text[$element->tagName] = $child->textContent;
82
-                                     }
83
-                                 }
84
-                                 break;
85
-                         }
86
-                     }
87
-                     $attributes = $element->attributes;
88
-                     //$keep_href = '';
89
-                     if (is_array($attributes)) {
90
-                         foreach ($attributes as $attrib) {
91
-                             if (trim($attrib->value) != ''){
92
-                                 $this->attribs[$attrib->name] = $attrib->value;
93
-                             }
94
-                         }
95
-                     }
77
+                                        if (count($children == 1)) {
78
+                                            // If this is the only child at this level and it is a content... save differently.
79
+                                            $this->text = $child->textContent;
80
+                                        } else {
81
+                                            $this->text[$element->tagName] = $child->textContent;
82
+                                        }
83
+                                    }
84
+                                    break;
85
+                            }
86
+                        }
87
+                        $attributes = $element->attributes;
88
+                        //$keep_href = '';
89
+                        if (is_array($attributes)) {
90
+                            foreach ($attributes as $attrib) {
91
+                                if (trim($attrib->value) != ''){
92
+                                    $this->attribs[$attrib->name] = $attrib->value;
93
+                                }
94
+                            }
95
+                        }
96 96
                     return true;
97 97
                     //break;
98 98
             }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
                      //$keep_href = '';
89 89
                      if (is_array($attributes)) {
90 90
                          foreach ($attributes as $attrib) {
91
-                             if (trim($attrib->value) != ''){
91
+                             if (trim($attrib->value) != '') {
92 92
                                  $this->attribs[$attrib->name] = $attrib->value;
93 93
                              }
94 94
                          }
Please login to merge, or discard this patch.
main/newscorm/scormItem.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                                         }
101 101
                                         break;
102 102
                                     case 'item':
103
-                                        $oItem = new scormItem('manifest',$child);
103
+                                        $oItem = new scormItem('manifest', $child);
104 104
                                         if ($oItem->identifier != '') {
105 105
                                             $this->sub_items[$oItem->identifier] = $oItem;
106 106
                                         }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                         $attributes = $element->attributes;
120 120
                         //$keep_href = '';
121 121
                         foreach ($attributes as $attrib) {
122
-                            switch($attrib->name){
122
+                            switch ($attrib->name) {
123 123
                                 case 'identifier':
124 124
                                     $this->identifier = $attrib->value;
125 125
                                     break;
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
         );
173 173
         $abs_order++;
174 174
         $i = 1;
175
-        foreach($this->sub_items as $id => $dummy) {
176
-            $oSubitem =& $this->sub_items[$id];
175
+        foreach ($this->sub_items as $id => $dummy) {
176
+            $oSubitem = & $this->sub_items[$id];
177 177
             $oSubitem->get_flat_list($list, $abs_order, $i, $level + 1);
178 178
             $i++;
179 179
         }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         parent::save($from_outside, $prereqs_complete);
189 189
         // Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent.
190 190
         $this->scorm_contact = true;
191
-        if (!$this->scorm_contact){
191
+        if (!$this->scorm_contact) {
192 192
             //error_log('New LP - was expecting SCORM message but none received', 0);
193 193
         }
194 194
     }
Please login to merge, or discard this patch.