Completed
Push — 1.11.x ( ac8a66...46c8b4 )
by José
126:29 queued 89:25
created
main/lp/aicc.class.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 class aicc extends learnpath
13 13
 {
14 14
     public $config = array();
15
-    public $config_basename = '';	// The configuration files might be multiple and might have
15
+    public $config_basename = ''; // The configuration files might be multiple and might have
16 16
                                     // funny names. We need to keep the name of that file while we
17 17
                                     // install the content.
18 18
     public $config_files = array();
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
     public $cstlist = array();
33 33
     public $orelist = array();
34 34
 
35
-    public $subdir = '';	// Path between the scorm/ directory and the config files e.g. maritime_nav/maritime_nav. This is the path that will be used in the lp_path when importing a package.
36
-    public $zipname = '';	// Keeps the zipfile safe for the object's life so that we can use it if there is no title available.
37
-    public $lastzipnameindex = 0;	// Keeps an index of the number of uses of the zipname so far.
35
+    public $subdir = ''; // Path between the scorm/ directory and the config files e.g. maritime_nav/maritime_nav. This is the path that will be used in the lp_path when importing a package.
36
+    public $zipname = ''; // Keeps the zipfile safe for the object's life so that we can use it if there is no title available.
37
+    public $lastzipnameindex = 0; // Keeps an index of the number of uses of the zipname so far.
38 38
     public $config_encoding = 'ISO-8859-1';
39 39
     public $debug = 0;
40 40
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             //echo '<pre>des:'.print_r($des_params, true).'</pre>';
133 133
             if ($this->debug > 1) { error_log('New LP - In aicc::parse_config_files() - '.$des_file.' has been parsed', 0); }
134 134
             // Distribute des params into the aicc object.
135
-            foreach ($des_params as $des){
135
+            foreach ($des_params as $des) {
136 136
                 // One AU in AICC is equivalent to one SCO in SCORM (scormItem class).
137 137
                 $oDes = new aiccResource('config', $des);
138 138
                 $this->deslist[$oDes->identifier] = $oDes;
@@ -242,12 +242,12 @@  discard block
 block discarded – undo
242 242
 
243 243
         $this->config_encoding = "ISO-8859-1"; // TODO: We may apply detection for this value, see the function api_detect_encoding().
244 244
 
245
-        $sql = "INSERT INTO $new_lp (c_id, lp_type, name, ref, description, path, force_commit, default_view_mod, default_encoding, js_lib, content_maker,display_order)" .
246
-                "VALUES " .
247
-                "($course_id, 3, '".$this->course_title."', '".$this->course_id."','".$this->course_description."'," .
248
-                "'".$this->subdir."', 0, 'embedded', '".$this->config_encoding."'," .
245
+        $sql = "INSERT INTO $new_lp (c_id, lp_type, name, ref, description, path, force_commit, default_view_mod, default_encoding, js_lib, content_maker,display_order)".
246
+                "VALUES ".
247
+                "($course_id, 3, '".$this->course_title."', '".$this->course_id."','".$this->course_description."',".
248
+                "'".$this->subdir."', 0, 'embedded', '".$this->config_encoding."',".
249 249
                 "'aicc_api.php','".$this->course_creator."',$dsp)";
250
-        if ($this->debug > 2) { error_log('New LP - In import_aicc(), inserting path: '. $sql, 0); }
250
+        if ($this->debug > 2) { error_log('New LP - In import_aicc(), inserting path: '.$sql, 0); }
251 251
         Database::query($sql);
252 252
         $lp_id = Database::insert_id();
253 253
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 
277 277
         $previous = 0;
278 278
         foreach ($this->aulist as $identifier => $dummy) {
279
-            $oAu =& $this->aulist[$identifier];
279
+            $oAu = & $this->aulist[$identifier];
280 280
             //echo "Item ".$oAu->identifier;
281 281
             $field_add = '';
282 282
             $value_add = '';
@@ -294,12 +294,12 @@  discard block
 block discarded – undo
294 294
             $parent = 0; // TODO: Deal with the parent.
295 295
             $previous = 0;
296 296
             $prereq = $oAu->prereq_string;
297
-            $sql_item = "INSERT INTO $new_lp_item (c_id, lp_id,item_type,ref,title, path,min_score,max_score, $field_add parent_item_id,previous_item_id,next_item_id, prerequisite,display_order,parameters) " .
298
-                    "VALUES " .
299
-                    "($course_id, $lp_id, 'au','".$oAu->identifier."','".$title."'," .
300
-                    "'$path',0,100, $value_add" .
301
-                    "$parent, $previous, 0, " .
302
-                    "'$prereq', 0,'".(!empty($oAu->parameters)?Database::escape_string($oAu->parameters):'')."'" .
297
+            $sql_item = "INSERT INTO $new_lp_item (c_id, lp_id,item_type,ref,title, path,min_score,max_score, $field_add parent_item_id,previous_item_id,next_item_id, prerequisite,display_order,parameters) ".
298
+                    "VALUES ".
299
+                    "($course_id, $lp_id, 'au','".$oAu->identifier."','".$title."',".
300
+                    "'$path',0,100, $value_add".
301
+                    "$parent, $previous, 0, ".
302
+                    "'$prereq', 0,'".(!empty($oAu->parameters) ? Database::escape_string($oAu->parameters) : '')."'".
303 303
                     ")";
304 304
             Database::query($sql_item);
305 305
             if ($this->debug > 1) { error_log('New LP - In aicc::import_aicc() - inserting item : '.$sql_item.' : ', 0); }
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
         $zip_file_name = $zip_file_info['name'];
351 351
 
352 352
         if ($this->debug > 0) { error_log('New LP - aicc::import_package() - Zip file path = '.$zip_file_path.', zip file name = '.$zip_file_name, 0); }
353
-        $course_rel_dir  = api_get_course_path().'/scorm'; // Scorm dir web path starting from /courses
353
+        $course_rel_dir = api_get_course_path().'/scorm'; // Scorm dir web path starting from /courses
354 354
         $course_sys_dir = api_get_path(SYS_COURSE_PATH).$course_rel_dir; // The absolute system path of this course.
355 355
         $current_dir = api_replace_dangerous_char(trim($current_dir)); // Current dir we are in, inside scorm/
356 356
         if ($this->debug > 0) { error_log('New LP - aicc::import_package() - Current_dir = '.$current_dir, 0); }
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
         if ($this->debug > 0) { error_log('New LP - aicc::import_package() - Base file name is : '.$file_base_name, 0); }
368 368
         $new_dir = api_replace_dangerous_char(trim($file_base_name));
369 369
         $this->subdir = $new_dir;
370
-        if($this->debug > 0) { error_log('New LP - aicc::import_package() - Subdir is first set to : '.$this->subdir, 0); }
370
+        if ($this->debug > 0) { error_log('New LP - aicc::import_package() - Subdir is first set to : '.$this->subdir, 0); }
371 371
 
372 372
         /*
373 373
         if (check_name_exist($course_sys_dir.$current_dir.'/'.$new_dir)) {
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
                         $subdir_isset = true;
414 414
                     } else {
415 415
                         if (!$subdir_isset) {
416
-                            if (preg_match('?^.*/aicc$?i',dirname($thisContent['filename']))) {
416
+                            if (preg_match('?^.*/aicc$?i', dirname($thisContent['filename']))) {
417 417
                                 //echo "Cutting subdir<br/>";
418 418
                                 $this->subdir .= '/'.substr(dirname($thisContent['filename']), 0, -5);
419 419
                             } else {
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
                         // TODO: RENAMING FILES CAN BE VERY DANGEROUS AICC-WISE, avoid that as much as possible!
517 517
                         //$safe_file = api_replace_dangerous_char($file, 'strict');
518 518
                         $find_str = array('\\', '.php', '.phtml');
519
-                        $repl_str = array('/',  '.txt', '.txt');
519
+                        $repl_str = array('/', '.txt', '.txt');
520 520
                         $safe_file = str_replace($find_str, $repl_str, $file);
521 521
 
522 522
                         if ($safe_file != $file) {
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
         if ($this->debug > 0) { error_log('In aicc::get_res_path('.$id.') method', 0); }
718 718
         $path = '';
719 719
         if (isset($this->resources[$id])) {
720
-            $oRes =& $this->resources[$id];
720
+            $oRes = & $this->resources[$id];
721 721
             $path = @$oRes->get_path();
722 722
         }
723 723
         return $path;
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
         if ($this->debug > 0) { error_log('In aicc::get_res_type('.$id.') method', 0); }
734 734
         $type = '';
735 735
         if (isset($this->resources[$id])) {
736
-            $oRes =& $this->resources[$id];
736
+            $oRes = & $this->resources[$id];
737 737
             $temptype = $oRes->get_scorm_type();
738 738
             if (!empty($temptype)) {
739 739
                 $type = $temptype;
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
      * Gets the default organisation's title
747 747
      * @return	string	The organization's title
748 748
      */
749
-    function get_title(){
749
+    function get_title() {
750 750
         if ($this->debug > 0) { error_log('In aicc::get_title() method', 0); }
751 751
         $title = '';
752 752
         if (isset($this->config['organizations']['default'])) {
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
             $chr = $data{$i};
908 908
             switch ($chr) {
909 909
                 case $enclosure:
910
-                    if ($enclosed && $data{$i+1} == $enclosure) {
910
+                    if ($enclosed && $data{$i + 1} == $enclosure) {
911 911
                         $fldval .= $chr;
912 912
                         ++$i; // Skip the next character.
913 913
                     } else
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
                         $fldval .= $chr;
922 922
                     break;
923 923
                 case "\r":
924
-                    if (!$enclosed&&$data{$i+1} == "\n")
924
+                    if (!$enclosed && $data{$i + 1} == "\n")
925 925
                         continue;
926 926
                 case "\n":
927 927
                     if (!$enclosed) {
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
                         $fldval .= $chr;
933 933
                     break;
934 934
                 case "\\r":
935
-                    if (!$enclosed&&$data{$i+1} == "\\n")
935
+                    if (!$enclosed && $data{$i + 1} == "\\n")
936 936
                         continue;
937 937
                 case "\\n":
938 938
                     if (!$enclosed) {
Please login to merge, or discard this patch.
main/lp/aicc_api.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -78,33 +78,33 @@  discard block
 block discarded – undo
78 78
 var commit = false ;
79 79
 
80 80
 // Strictly SCORM variables.
81
-var score=<?php echo $oItem->get_score();?>;
82
-var max=<?php echo $oItem->get_max();?>;
83
-var min=<?php echo $oItem->get_min();?>;
84
-var lesson_status='<?php echo $oItem->get_status();?>';
85
-var session_time='<?php echo $oItem->get_scorm_time('js');?>';
86
-var suspend_data = '<?php echo $oItem->get_suspend_data();?>';
87
-var lesson_location = '<?php echo $oItem->get_lesson_location();?>';
88
-var total_time = '<?php echo $oItem->get_scorm_time('js');?>';
81
+var score=<?php echo $oItem->get_score(); ?>;
82
+var max=<?php echo $oItem->get_max(); ?>;
83
+var min=<?php echo $oItem->get_min(); ?>;
84
+var lesson_status='<?php echo $oItem->get_status(); ?>';
85
+var session_time='<?php echo $oItem->get_scorm_time('js'); ?>';
86
+var suspend_data = '<?php echo $oItem->get_suspend_data(); ?>';
87
+var lesson_location = '<?php echo $oItem->get_lesson_location(); ?>';
88
+var total_time = '<?php echo $oItem->get_scorm_time('js'); ?>';
89 89
 
90 90
 // Chamilo internal variables.
91 91
 var saved_lesson_status = 'not attempted';
92
-var lms_lp_id = <?php echo $oLP->get_id();?>;
93
-var lms_item_id = <?php echo $oItem->get_id();?>;
92
+var lms_lp_id = <?php echo $oLP->get_id(); ?>;
93
+var lms_item_id = <?php echo $oItem->get_id(); ?>;
94 94
 //var lms_new_item_id = 0; //temporary value (only there between a load_item() and a LMSInitialize())
95 95
 var lms_been_synchronized = 0;
96 96
 var lms_initialized = 0;
97 97
 var lms_total_lessons = <?php echo $oLP->get_total_items_count(); ?>;
98
-var lms_complete_lessons = <?php echo $oLP->get_complete_items_count();?>;
99
-var lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode;?>';
98
+var lms_complete_lessons = <?php echo $oLP->get_complete_items_count(); ?>;
99
+var lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode; ?>';
100 100
 if(lms_progress_bar_mode == ''){lms_progress_bar_mode='%';}
101
-var lms_view_id = '<?php echo $oLP->get_view();?>';
101
+var lms_view_id = '<?php echo $oLP->get_view(); ?>';
102 102
 if(lms_view_id == ''){ lms_view_id = 1;}
103
-var lms_user_id = '<?php echo $_user['user_id'];?>';
104
-var lms_next_item = '<?php echo $oLP->get_next_item_id();?>';
105
-var lms_previous_item = '<?php echo $oLP->get_previous_item_id();?>';
106
-var lms_lp_type = '<?php echo $oLP->get_type();?>';
107
-var lms_item_type = '<?php echo $oItem->get_type();?>';
103
+var lms_user_id = '<?php echo $_user['user_id']; ?>';
104
+var lms_next_item = '<?php echo $oLP->get_next_item_id(); ?>';
105
+var lms_previous_item = '<?php echo $oLP->get_previous_item_id(); ?>';
106
+var lms_lp_type = '<?php echo $oLP->get_type(); ?>';
107
+var lms_item_type = '<?php echo $oItem->get_type(); ?>';
108 108
 
109 109
 // Backup for old values.
110 110
 var old_score = 0;
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
     }else if(param == 'cmi.core.lesson_mode'){
163 163
         result='normal';
164 164
     }else if(param == 'cmi.suspend_data'){
165
-        result='<?php echo $oItem->get_suspend_data();?>';
165
+        result='<?php echo $oItem->get_suspend_data(); ?>';
166 166
     }else if(param == 'cmi.launch_data'){
167 167
         result='';
168 168
     }else if(param == 'cmi.objectives._count'){
169
-        result='<?php echo $oItem->get_view_count();?>';
169
+        result='<?php echo $oItem->get_view_count(); ?>';
170 170
     }
171 171
     /*
172 172
     // Switch not working??? WTF???
@@ -227,13 +227,13 @@  discard block
 block discarded – undo
227 227
             result='normal';
228 228
             break;
229 229
         case 'cmi.suspend_data'		:
230
-            result='<?php echo $oItem->get_suspend_data();?>';
230
+            result='<?php echo $oItem->get_suspend_data(); ?>';
231 231
             break;
232 232
         case 'cmi.launch_data'		:
233 233
             result='';
234 234
             break;
235 235
         case 'cmi.objectives._count':
236
-            result='<?php echo $oItem->get_view_count();?>';
236
+            result='<?php echo $oItem->get_view_count(); ?>';
237 237
             break;
238 238
         default 					:
239 239
             result='';
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
     $url = $_SERVER['HTTP_HOST'].$self;
286 286
     $url = substr($url, 0, -14); // 14 is the length of this file's name (/scorm_api.php).
287 287
     echo $url;
288
-    ?>/lp_controller.php?<?php echo api_get_cidreq(); ?>&action=save&lp_id=<?php echo $oLP->get_id();?>&" + param + "";
288
+    ?>/lp_controller.php?<?php echo api_get_cidreq(); ?>&action=save&lp_id=<?php echo $oLP->get_id(); ?>&" + param + "";
289 289
     logit_lms('saving data (status='+lesson_status+')',1);
290 290
     xajax_save_item(lms_lp_id, lms_user_id, lms_view_id, lms_item_id, score, max, min, lesson_status, session_time, suspend_data, lesson_location);
291 291
     //xajax_update_pgs();
Please login to merge, or discard this patch.
main/lp/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.
main/lp/lp_ajax_switch_item.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -198,7 +198,7 @@
 block discarded – undo
198 198
         //"lms_progress_bar_mode='".$myprogress_mode."';" .
199 199
         "olms.lms_view_id=".$view_id.";".
200 200
         "olms.lms_user_id=".$user_id.";".
201
-        "olms.next_item=".$new_item_id.";". // This one is very important to replace possible literal strings.
201
+        "olms.next_item=".$new_item_id.";".// This one is very important to replace possible literal strings.
202 202
         "olms.lms_next_item=".$mynext.";".
203 203
         "olms.lms_previous_item=".$myprevious.";".
204 204
         "olms.lms_item_type = '".$myitemtype."';".
Please login to merge, or discard this patch.
main/lp/lp_edit_item.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 }
100 100
 
101 101
 if (!empty($gradebook) && $gradebook == 'view') {
102
-    $interbreadcrumb[] = array (
102
+    $interbreadcrumb[] = array(
103 103
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
104 104
         'name' => get_lang('ToolGradebook')
105 105
     );
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 $show_learn_path = true;
113 113
 $lp_theme_css = $_SESSION['oLP']->get_theme();
114 114
 
115
-Display::display_header(get_lang('Edit'),'Path');
115
+Display::display_header(get_lang('Edit'), 'Path');
116 116
 $suredel = trim(get_lang('AreYouSureToDeleteJS'));
117 117
 
118 118
 ?>
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
 $path_item = isset($_GET['path_item']) ? $_GET['path_item'] : 0;
166 166
 $path_item = Database::escape_string($path_item);
167 167
 $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
168
-$sql_doc = "SELECT path FROM " . $tbl_doc . "
169
-            WHERE c_id = $course_id AND id = '". $path_item."' ";
168
+$sql_doc = "SELECT path FROM ".$tbl_doc."
169
+            WHERE c_id = $course_id AND id = '".$path_item."' ";
170 170
 
171 171
 $res_doc = Database::query($sql_doc);
172 172
 $path_file = Database::result($res_doc, 0, 0);
Please login to merge, or discard this patch.
main/lp/lp_ajax_save_objectives.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
         error_log('In xajax_save_objectives('.$lp_id.','.$user_id.','.$view_id.','.$item_id.',"'.(count($objectives) > 0 ? count($objectives) : '').'")', 0);
29 29
     }
30 30
     $mylp = learnpath::getLpFromSession(api_get_course_id(), $lp_id, $user_id);
31
-    $mylpi =& $mylp->items[$item_id];
32
-    if (is_array($objectives) && count($objectives)>0){
33
-        foreach ($objectives as $index=>$objective){
34
-            $mylpi->add_objective($index,$objectives[$index]);
31
+    $mylpi = & $mylp->items[$item_id];
32
+    if (is_array($objectives) && count($objectives) > 0) {
33
+        foreach ($objectives as $index=>$objective) {
34
+            $mylpi->add_objective($index, $objectives[$index]);
35 35
         }
36 36
         $mylpi->write_objectives_to_db();
37 37
     }
Please login to merge, or discard this patch.
main/lp/openoffice_text_document.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         $intro_content = api_substr($content, 0, api_strpos($content, $matches[0][0]));
118 118
         $items_to_create[get_lang('Introduction')] = $intro_content;
119 119
 
120
-        for ($i = 0; $i<count($matches[0]); $i++) {
120
+        for ($i = 0; $i < count($matches[0]); $i++) {
121 121
 
122 122
             if (empty($matches[1][$i]))
123 123
                 continue;
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
         $first_item = 0;
176 176
 
177
-        foreach($pages as $key => $page_content) {
177
+        foreach ($pages as $key => $page_content) {
178 178
             // For every pages, we create a new file.
179 179
 
180 180
             $key += 1;
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                     foreach ($specific_fields as $specific_field) {
214 214
                         if (isset($_REQUEST[$specific_field['code']])) {
215 215
                             $sterms = trim($_REQUEST[$specific_field['code']]);
216
-                            $all_specific_terms .= ' '. $sterms;
216
+                            $all_specific_terms .= ' '.$sterms;
217 217
                             if (!empty($sterms)) {
218 218
                                 $sterms = explode(',', $sterms);
219 219
                                 foreach ($sterms as $sterm) {
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                             }
223 223
                         }
224 224
                     }
225
-                    $page_content = $all_specific_terms .' '. $page_content;
225
+                    $page_content = $all_specific_terms.' '.$page_content;
226 226
                     $ic_slide->addValue('content', $page_content);
227 227
                     // Add a comment to say terms separated by commas.
228 228
                     $courseid = api_get_course_id();
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
                         SE_COURSE_ID => $courseid,
234 234
                         SE_TOOL_ID => TOOL_LEARNPATH,
235 235
                         SE_DATA => array('lp_id' => $lp_id, 'lp_item' => $previous, 'document_id' => $document_id),
236
-                        SE_USER => (int)api_get_user_id(),
236
+                        SE_USER => (int) api_get_user_id(),
237 237
                     );
238 238
                     $ic_slide->xapian_data = serialize($xapian_data);
239 239
                     $di->addChunk($ic_slide);
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
             $content = '<body><div style="width:'.$max_width.'">'.$content;
277 277
         }
278 278
 
279
-        $content = preg_replace('|</body>|i','</div>\\0', $content, -1, $count);
279
+        $content = preg_replace('|</body>|i', '</div>\\0', $content, -1, $count);
280 280
         if ($count < 1) {
281 281
             $content = $content.'</div></body>';
282 282
         }
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
                 }
305 305
 
306 306
             } elseif ($img_width > $max_width - 10) {
307
-                $picture_resized = str_ireplace('width='.$img_width, 'width="'.($max_width-10).'"', $images[0][$key]);
307
+                $picture_resized = str_ireplace('width='.$img_width, 'width="'.($max_width - 10).'"', $images[0][$key]);
308 308
                 $content = str_replace($images[0][$key], $picture_resized, $content);
309 309
             }
310 310
         }
Please login to merge, or discard this patch.
main/lp/lp_add_audio.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 
17 17
 $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
18 18
 
19
-$isStudentView = isset($_REQUEST['isStudentView']) ? (int)$_REQUEST['isStudentView'] : null;
20
-$learnpath_id = (int)$_REQUEST['lp_id'];
19
+$isStudentView = isset($_REQUEST['isStudentView']) ? (int) $_REQUEST['isStudentView'] : null;
20
+$learnpath_id = (int) $_REQUEST['lp_id'];
21 21
 $submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null;
22 22
 
23 23
 $type = isset($_GET['type']) ? $_GET['type'] : null;
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 }
42 42
 
43 43
 if (!empty($gradebook) && $gradebook == 'view') {
44
-    $interbreadcrumb[] = array (
44
+    $interbreadcrumb[] = array(
45 45
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
46 46
         'name' => get_lang('ToolGradebook')
47 47
     );
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
         );
66 66
         break;
67 67
     default:
68
-        $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewStep'));
68
+        $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewStep'));
69 69
         break;
70 70
 }
71 71
 
72 72
 if ($action == 'add_item' && $type == 'document') {
73
-    $interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewDocumentCreated'));
73
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewDocumentCreated'));
74 74
 }
75 75
 
76 76
 // Theme calls.
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 $form = new FormValidator(
87 87
     'add_audio',
88 88
     'post',
89
-    api_get_self() . '?action=add_audio&id=' . $lp_item_id . '&' . api_get_cidreq().'&lp_id='.$learnpath_id,
89
+    api_get_self().'?action=add_audio&id='.$lp_item_id.'&'.api_get_cidreq().'&lp_id='.$learnpath_id,
90 90
     null,
91 91
     array('enctype' => 'multipart/form-data')
92 92
 );
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
     $urlFile = api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document/audio/'.$lp_item->audio.'?'.api_get_cidreq();
101 101
 
102 102
     if (!file_exists($file)) {
103
-        $file = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'.$lpPathInfo['dir'] . '/' . $lp_item->audio;
104
-        $urlFile = api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document'.$lpPathInfo['dir'] . '/' . $lp_item->audio.'?'.api_get_cidreq();
103
+        $file = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'.$lpPathInfo['dir'].'/'.$lp_item->audio;
104
+        $urlFile = api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document'.$lpPathInfo['dir'].'/'.$lp_item->audio.'?'.api_get_cidreq();
105 105
     }
106 106
 }
107 107
 
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
 
118 118
 $page .= '<div id="doc_form" class="col-md-8">';
119 119
 
120
-$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'rtc/RecordRTC.js"></script>';
121
-$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'wami-recorder/recorder.js"></script>';
122
-$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_PATH) . 'wami-recorder/gui.js"></script>';
123
-$htmlHeadXtra[] = '<script type="text/javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'swfobject/swfobject.js"></script>';
120
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_JS_PATH).'rtc/RecordRTC.js"></script>';
121
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'wami-recorder/recorder.js"></script>';
122
+$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'wami-recorder/gui.js"></script>';
123
+$htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'swfobject/swfobject.js"></script>';
124 124
 
125 125
 $tpl = new Template(null);
126 126
 $tpl->assign('unique_file_id', api_get_unique_id());
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         Display::getMediaPlayer($file, array('url' => $urlFile)).
142 142
         "</div>";
143 143
     $form->addElement('label', get_lang('Listen'), $audioPlayer);
144
-    $url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?lp_id='.$_SESSION['oLP']->get_id().'&action=add_audio&id='.$lp_item_id.'&delete_file=1&'.api_get_cidreq();
144
+    $url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?lp_id='.$_SESSION['oLP']->get_id().'&action=add_audio&id='.$lp_item_id.'&delete_file=1&'.api_get_cidreq();
145 145
     $form->addElement('label', null, Display::url(get_lang('RemoveAudio'), $url, array('class' => 'btn btn-danger')));
146 146
 } else {
147 147
     $form->addElement('file', 'file');
Please login to merge, or discard this patch.
main/lp/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.