Completed
Pull Request — 1.11.x (#1215)
by José
45:23
created
main/newscorm/lp_ajax_switch_item_toc.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -124,22 +124,22 @@
 block discarded – undo
124 124
     $coreExit = $myLPI->get_core_exit();
125 125
 
126 126
     $return .=
127
-        "olms.lms_lp_id=".$lpId.";" .
128
-        "olms.lms_item_id=".$newItemId.";" .
129
-        "olms.lms_old_item_id=".$oldItemId.";" .
130
-        "olms.lms_initialized=0;" .
131
-        "olms.lms_view_id=".$viewId.";" .
132
-        "olms.lms_user_id=".$userId.";" .
133
-        "olms.next_item=".$newItemId.";" . // This one is very important to replace possible literal strings.
134
-        "olms.lms_next_item=".$nextItemId.";" .
135
-        "olms.lms_previous_item=".$previousItemId.";" .
136
-        "olms.lms_item_type = '".$itemType."';" .
137
-        "olms.lms_item_credit = '".$credit."';" .
138
-        "olms.lms_item_lesson_mode = '".$lessonMode."';" .
139
-        "olms.lms_item_launch_data = '".$launchData."';" .
140
-        "olms.lms_item_interactions_count = '".$interactionsCount."';" .
141
-        "olms.lms_item_objectives_count = '".$objectivesCount."';" .
142
-        "olms.lms_item_core_exit = '".$coreExit."';" .
127
+        "olms.lms_lp_id=".$lpId.";".
128
+        "olms.lms_item_id=".$newItemId.";".
129
+        "olms.lms_old_item_id=".$oldItemId.";".
130
+        "olms.lms_initialized=0;".
131
+        "olms.lms_view_id=".$viewId.";".
132
+        "olms.lms_user_id=".$userId.";".
133
+        "olms.next_item=".$newItemId.";".// This one is very important to replace possible literal strings.
134
+        "olms.lms_next_item=".$nextItemId.";".
135
+        "olms.lms_previous_item=".$previousItemId.";".
136
+        "olms.lms_item_type = '".$itemType."';".
137
+        "olms.lms_item_credit = '".$credit."';".
138
+        "olms.lms_item_lesson_mode = '".$lessonMode."';".
139
+        "olms.lms_item_launch_data = '".$launchData."';".
140
+        "olms.lms_item_interactions_count = '".$interactionsCount."';".
141
+        "olms.lms_item_objectives_count = '".$objectivesCount."';".
142
+        "olms.lms_item_core_exit = '".$coreExit."';".
143 143
         "olms.asset_timer = 0;";
144 144
 
145 145
     $return .= "update_toc('unhighlight','".$currentItem."');".
Please login to merge, or discard this patch.
main/newscorm/download.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 $doc_url = str_replace(array('../', '\\..', '\\0', '..\\'), array('', '', '', ''), $doc_url); //echo $doc_url;
26 26
 
27
-if (strpos($doc_url,'../') OR strpos($doc_url,'/..')) {
27
+if (strpos($doc_url, '../') OR strpos($doc_url, '/..')) {
28 28
     $doc_url = '';
29 29
 }
30 30
 $sys_course_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/scorm';
@@ -50,5 +50,5 @@  discard block
 block discarded – undo
50 50
     }
51 51
 }
52 52
 
53
-Display::display_error_message(get_lang('ProtectedDocument'));//api_not_allowed backbutton won't work.
53
+Display::display_error_message(get_lang('ProtectedDocument')); //api_not_allowed backbutton won't work.
54 54
 exit;
Please login to merge, or discard this patch.
main/newscorm/lp_ajax_initialize.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -101,21 +101,21 @@  discard block
 block discarded – undo
101 101
 	$myobjectives = json_encode($phpobjectives);
102 102
 
103 103
     $return .=
104
-            "olms.score=".$myscore.";" .
105
-            "olms.max=".$mymax.";" .
106
-            "olms.min=".$mymin.";" .
107
-            "olms.lesson_status='".$mylesson_status."';" .
108
-            "olms.lesson_location='".$mylesson_location."';" .
109
-            "olms.session_time='".$mysession_time."';" .
110
-            "olms.suspend_data='".$mysuspend_data."';" .
111
-            "olms.total_time = '".$mytotal_time."';" .
112
-            "olms.mastery_score = '".$mymastery_score."';" .
113
-            "olms.max_time_allowed = '".$mymax_time_allowed."';" .
114
-            "olms.launch_data = '".$mylaunch_data."';" .
115
-            "olms.interactions = new Array(".$myistring.");" .
104
+            "olms.score=".$myscore.";".
105
+            "olms.max=".$mymax.";".
106
+            "olms.min=".$mymin.";".
107
+            "olms.lesson_status='".$mylesson_status."';".
108
+            "olms.lesson_location='".$mylesson_location."';".
109
+            "olms.session_time='".$mysession_time."';".
110
+            "olms.suspend_data='".$mysuspend_data."';".
111
+            "olms.total_time = '".$mytotal_time."';".
112
+            "olms.mastery_score = '".$mymastery_score."';".
113
+            "olms.max_time_allowed = '".$mymax_time_allowed."';".
114
+            "olms.launch_data = '".$mylaunch_data."';".
115
+            "olms.interactions = new Array(".$myistring.");".
116 116
             //"olms.item_objectives = new Array();" .
117
-            "olms.item_objectives = ".$myobjectives.";" .
118
-            "olms.G_lastError = 0;" .
117
+            "olms.item_objectives = ".$myobjectives.";".
118
+            "olms.G_lastError = 0;".
119 119
             "olms.G_LastErrorMessage = 'No error';".
120 120
             "olms.finishSignalReceived = 0;";
121 121
     /*
@@ -144,22 +144,22 @@  discard block
 block discarded – undo
144 144
     $mycore_exit = $mylpi->get_core_exit();
145 145
 
146 146
     $return .=
147
-            "olms.lms_lp_id=".$lp_id.";" .
148
-            "olms.lms_item_id=".$next_item.";" .
149
-            "olms.lms_old_item_id=0;" .
150
-            "olms.lms_initialized=0;" .
151
-            "olms.lms_view_id=".$view_id.";" .
152
-            "olms.lms_user_id=".$user_id.";" .
153
-            "olms.next_item=".$next_item.";" . // This one is very important to replace possible literal strings.
154
-            "olms.lms_next_item=".$mynext.";" .
155
-            "olms.lms_previous_item=".$myprevious.";" .
156
-            "olms.lms_item_type = '".$myitemtype."';" .
157
-            "olms.lms_item_credit = '".$mycredit."';" .
158
-            "olms.lms_item_lesson_mode = '".$mylesson_mode."';" .
159
-            "olms.lms_item_launch_data = '".$mylaunch_data."';" .
160
-            "olms.lms_item_interactions_count = '".$myinteractions_count."';" .
161
-            "olms.lms_item_objectives_count = '".$myinteractions_count."';" .
162
-            "olms.lms_item_core_exit = '".$mycore_exit."';" .
147
+            "olms.lms_lp_id=".$lp_id.";".
148
+            "olms.lms_item_id=".$next_item.";".
149
+            "olms.lms_old_item_id=0;".
150
+            "olms.lms_initialized=0;".
151
+            "olms.lms_view_id=".$view_id.";".
152
+            "olms.lms_user_id=".$user_id.";".
153
+            "olms.next_item=".$next_item.";".// This one is very important to replace possible literal strings.
154
+            "olms.lms_next_item=".$mynext.";".
155
+            "olms.lms_previous_item=".$myprevious.";".
156
+            "olms.lms_item_type = '".$myitemtype."';".
157
+            "olms.lms_item_credit = '".$mycredit."';".
158
+            "olms.lms_item_lesson_mode = '".$mylesson_mode."';".
159
+            "olms.lms_item_launch_data = '".$mylaunch_data."';".
160
+            "olms.lms_item_interactions_count = '".$myinteractions_count."';".
161
+            "olms.lms_item_objectives_count = '".$myinteractions_count."';".
162
+            "olms.lms_item_core_exit = '".$mycore_exit."';".
163 163
             "olms.asset_timer = 0;";
164 164
 
165 165
     $mylp->set_error_msg('');
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_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/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.