Passed
Push — 1.10.x ( 2d286e...59f957 )
by Yannick
48:16
created
main/newscorm/lp_add_audio.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 $isStudentView  = isset($_REQUEST['isStudentView']) ? (int) $_REQUEST['isStudentView'] : null;
19 19
 $learnpath_id   = (int) $_REQUEST['lp_id'];
20
-$submit			= isset($_POST['submit_button']) ? $_POST['submit_button'] : null;
20
+$submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null;
21 21
 
22 22
 $type = isset($_GET['type']) ? $_GET['type'] : null;
23 23
 $action = isset($_GET['action']) ? $_GET['action'] : null;
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 }
41 41
 
42 42
 if (!empty($gradebook) && $gradebook == 'view') {
43
-    $interbreadcrumb[] = array (
43
+    $interbreadcrumb[] = array(
44 44
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
45 45
         'name' => get_lang('ToolGradebook')
46 46
     );
@@ -51,19 +51,19 @@  discard block
 block discarded – undo
51 51
 
52 52
 switch ($type) {
53 53
     case 'chapter':
54
-        $interbreadcrumb[]= array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep'));
55
-        $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewChapter'));
54
+        $interbreadcrumb[] = array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep'));
55
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewChapter'));
56 56
         break;
57 57
     case 'document':
58
-        $interbreadcrumb[]= array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep'));
58
+        $interbreadcrumb[] = array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$_SESSION['oLP']->get_id(), 'name' => get_lang('NewStep'));
59 59
         break;
60 60
     default:
61
-        $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewStep'));
61
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewStep'));
62 62
         break;
63 63
 }
64 64
 
65 65
 if ($action == 'add_item' && $type == 'document') {
66
-    $interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewDocumentCreated'));
66
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewDocumentCreated'));
67 67
 }
68 68
 
69 69
 // Theme calls.
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 $form = new FormValidator(
80 80
     'add_audio',
81 81
     'post',
82
-    api_get_self() . '?action=add_audio&id=' . $lp_item_id . '&' . api_get_cidreq().'&lp_id='.$learnpath_id,
82
+    api_get_self().'?action=add_audio&id='.$lp_item_id.'&'.api_get_cidreq().'&lp_id='.$learnpath_id,
83 83
     null,
84 84
     array('enctype' => 'multipart/form-data')
85 85
 );
Please login to merge, or discard this patch.
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 1 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 1 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 1 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.
main/newscorm/scormOrganization.class.php 1 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 1 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.
main/newscorm/lp_view_item.php 1 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 1 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.