@@ -198,7 +198,7 @@ |
||
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."';". |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | }*/ |
87 | 87 | |
88 | 88 | // Get max display_order so far in this parent chapter. |
89 | - $sql = "SELECT MAX(display_order) as maxi FROM $tbl_lp_item " . |
|
89 | + $sql = "SELECT MAX(display_order) as maxi FROM $tbl_lp_item ". |
|
90 | 90 | "WHERE c_id = $course_id AND lp_id = $learnpath_id ". |
91 | 91 | " AND parent_item_id = $chapter_id"; |
92 | 92 | $res = Database::query($sql); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $lastorder_item = 0; |
97 | 97 | $previous = 0; |
98 | 98 | } else { |
99 | - $sql = "SELECT id FROM $tbl_lp_item " . |
|
99 | + $sql = "SELECT id FROM $tbl_lp_item ". |
|
100 | 100 | "WHERE lp_id = $learnpath_id AND parent_item_id=$chapter_id AND display_order = $lastorder_item"; |
101 | 101 | $result = Database::query($sql); |
102 | 102 | $row = Database::fetch_array($result); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | $order = $lastorder_item + 1; |
106 | 106 | |
107 | - $sql = "INSERT INTO $tbl_lp_item "."(c_id, lp_id,item_type,title,parent_item_id,previous_item_id, next_item_id, display_order) " . |
|
107 | + $sql = "INSERT INTO $tbl_lp_item "."(c_id, lp_id,item_type,title,parent_item_id,previous_item_id, next_item_id, display_order) ". |
|
108 | 108 | "VALUES "."($course_id, $learnpath_id,'dokeos_chapter','$title', $chapter_id, $previous, 0, $order )"; |
109 | 109 | //error_log('New LP - Inserting new resource: '.$sql, 0); |
110 | 110 | $res = Database::query($sql); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | if ($from_learnpath == 'yes') { |
174 | 174 | $i = 0; |
175 | 175 | // Calculating the last order of the items of this chapter. |
176 | - $sql = "SELECT MAX(display_order) as maxi FROM $tbl_lp_item " . |
|
176 | + $sql = "SELECT MAX(display_order) as maxi FROM $tbl_lp_item ". |
|
177 | 177 | "WHERE c_id = $course_id AND lp_id = $learnpath_id AND parent_item_id=$chapter_id"; |
178 | 178 | $result = Database::query($sql); |
179 | 179 | $row = Database::fetch_array($result); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $lastorder_item = 0; |
183 | 183 | $previous = 0; |
184 | 184 | } else { |
185 | - $sql = "SELECT id FROM $tbl_lp_item " . |
|
185 | + $sql = "SELECT id FROM $tbl_lp_item ". |
|
186 | 186 | "WHERE lp_id = $learnpath_id AND parent_item_id=$chapter_id AND display_order = $lastorder_item"; |
187 | 187 | //error_log('New LP - resourcelinker.php - '.$sql, 0); |
188 | 188 | $result = Database::query($sql); |
@@ -193,8 +193,8 @@ discard block |
||
193 | 193 | foreach ($addedresource as $addedresource_item) { |
194 | 194 | // In the case we added a chapter, add this into the chapters list with the correct parent_id. |
195 | 195 | if ($addedresource_item == 'Chap') { |
196 | - $sql = "INSERT INTO $tbl_lp_item " . |
|
197 | - "(c_id, lp_id,item_type,title,parent_item_id,previous_item_id,next_item_id,display_order) " . |
|
196 | + $sql = "INSERT INTO $tbl_lp_item ". |
|
197 | + "(c_id, lp_id,item_type,title,parent_item_id,previous_item_id,next_item_id,display_order) ". |
|
198 | 198 | "VALUES ($course_id, ".$learnpath_id.",'dokeos_chapter','".$learnpath_chapter_name."',".$chapter_id.",$previous,0,".$lastorder.")"; |
199 | 199 | //error_log('New LP - Inserting new resource: '.$sql, 0); |
200 | 200 | $res = Database::query($sql); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | //get title from tool-type table |
256 | 256 | $tooltable = Database::get_course_table(TABLE_DOCUMENT); |
257 | 257 | $result = Database::query("SELECT * FROM $tooltable WHERE id=".$addedresourceid[$i]); |
258 | - $myrow=Database::fetch_array($result); |
|
258 | + $myrow = Database::fetch_array($result); |
|
259 | 259 | $title = $myrow['title']; |
260 | 260 | break; |
261 | 261 | case 'Exercise': |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | //get title from tool-type table |
264 | 264 | $tooltable = Database::get_course_table(TABLE_QUIZ_TEST); |
265 | 265 | $result = Database::query("SELECT * FROM $tooltable WHERE id=".$addedresourceid[$i]); |
266 | - $myrow=Database::fetch_array($result); |
|
266 | + $myrow = Database::fetch_array($result); |
|
267 | 267 | $title = $myrow['title']; |
268 | 268 | break; |
269 | 269 | case 'Forum': |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | //get title from tool-type table |
276 | 276 | $tooltable = Database::get_course_table(TABLE_AGENDA); |
277 | 277 | $result = Database::query("SELECT * FROM $tooltable WHERE id=".$addedresourceid[$i]); |
278 | - $myrow=Database::fetch_array($result); |
|
278 | + $myrow = Database::fetch_array($result); |
|
279 | 279 | $title = $myrow['title']; |
280 | 280 | break; |
281 | 281 | case 'Ad_Valvas': |
@@ -283,12 +283,12 @@ discard block |
||
283 | 283 | //get title from tool-type table |
284 | 284 | $tooltable = Database::get_course_table(TABLE_ANNOUNCEMENT); |
285 | 285 | $result = Database::query("SELECT * FROM $tooltable WHERE id=".$addedresourceid[$i]); |
286 | - $myrow=Database::fetch_array($result); |
|
286 | + $myrow = Database::fetch_array($result); |
|
287 | 287 | $title = $myrow['title']; |
288 | 288 | break; |
289 | 289 | |
290 | 290 | } |
291 | - $sql = "INSERT INTO $tbl_lp_item (c_id, lp_id, title, parent_item_id, item_type, ref, previous_item_id, next_item_id, display_order) " . |
|
291 | + $sql = "INSERT INTO $tbl_lp_item (c_id, lp_id, title, parent_item_id, item_type, ref, previous_item_id, next_item_id, display_order) ". |
|
292 | 292 | "VALUES ($course_id, $learnpath_id, '$title','$chapter_id', '$addedresource_item','$addedresourceid[$i]',$previous,0,'".$lastorder."')"; |
293 | 293 | //error_log('New LP - Inserting new resource: '.$sql, 0); |
294 | 294 | $result = Database::query($sql); |
@@ -301,8 +301,8 @@ discard block |
||
301 | 301 | $addedresourceassigned[$i] = 1; |
302 | 302 | $resource_added = true; |
303 | 303 | } |
304 | - $i ++; |
|
305 | - $lastorder ++; |
|
304 | + $i++; |
|
305 | + $lastorder++; |
|
306 | 306 | } |
307 | 307 | //$_SESSION['addedresource']=null; |
308 | 308 | //$_SESSION['addedresourceid']=null; |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | } |
331 | 331 | |
332 | 332 | if (!empty($gradebook) && $gradebook == 'view') { |
333 | - $interbreadcrumb[] = array ( |
|
333 | + $interbreadcrumb[] = array( |
|
334 | 334 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
335 | 335 | 'name' => get_lang('ToolGradebook') |
336 | 336 | ); |
@@ -348,34 +348,34 @@ discard block |
||
348 | 348 | $url = "../calendar/agenda.php?action=add"; |
349 | 349 | } |
350 | 350 | $originaltoolname = get_lang('Agenda'); |
351 | - $breadcrumbelement = array ('url' => $url, 'name' => $originaltoolname); |
|
351 | + $breadcrumbelement = array('url' => $url, 'name' => $originaltoolname); |
|
352 | 352 | session_unregister('from_learnpath'); |
353 | 353 | unset ($from_learnpath); |
354 | 354 | break; |
355 | 355 | case '2': // coming from forum: new topic |
356 | 356 | $url = "../phpbb/newtopic.php?forum=$source_forum&md5=$md5"; |
357 | 357 | $originaltoolname = get_lang('ForumAddNewTopic'); |
358 | - $breadcrumbelement = array ('url' => $url, 'name' => $originaltoolname); |
|
358 | + $breadcrumbelement = array('url' => $url, 'name' => $originaltoolname); |
|
359 | 359 | session_unregister('from_learnpath'); |
360 | 360 | unset ($from_learnpath); |
361 | 361 | break; |
362 | 362 | case '3': // coming from forum: edit topic |
363 | 363 | $url = "../phpbb/editpost.php?post_id=$post_id&topic=$topic&forum=$forum&md5=$md5&originalresource=no"; |
364 | 364 | $originaltoolname = get_lang('ForumEditTopic'); |
365 | - $breadcrumbelement = array ('url' => $url, 'name' => $originaltoolname); |
|
365 | + $breadcrumbelement = array('url' => $url, 'name' => $originaltoolname); |
|
366 | 366 | session_unregister('from_learnpath'); |
367 | 367 | unset ($from_learnpath); |
368 | 368 | break; |
369 | 369 | case '4': // coming from exercises: edit topic |
370 | 370 | $url = "../exercice/admin.php?modifyAnswers=$modifyAnswers"; |
371 | 371 | $originaltoolname = get_lang('ExerciseAnswers'); |
372 | - $breadcrumbelement = array ('url' => $url, 'name' => $originaltoolname); |
|
372 | + $breadcrumbelement = array('url' => $url, 'name' => $originaltoolname); |
|
373 | 373 | session_unregister('from_learnpath'); |
374 | 374 | unset ($from_learnpath); |
375 | 375 | break; |
376 | 376 | case '5': // coming from learning path |
377 | 377 | $from_learnpath = 'yes'; |
378 | - Session::write('from_learnpath',$from_learnpath); |
|
378 | + Session::write('from_learnpath', $from_learnpath); |
|
379 | 379 | break; |
380 | 380 | |
381 | 381 | /* end add [email protected] */ |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | // the information from the session. Else we use the information of the learningpath itself. |
397 | 397 | if ($from_learnpath != 'yes') { |
398 | 398 | $nameTools = get_lang('Attachment'); |
399 | - $interbreadcrumb[] = array ('url' => $_SESSION['origintoolurl'], 'name' => $_SESSION['origintoolname']); |
|
399 | + $interbreadcrumb[] = array('url' => $_SESSION['origintoolurl'], 'name' => $_SESSION['origintoolname']); |
|
400 | 400 | } else { |
401 | 401 | $learnpath_select_query = " SELECT * FROM $tbl_lp |
402 | 402 | WHERE id=$learnpath_id"; |
@@ -410,9 +410,9 @@ discard block |
||
410 | 410 | |
411 | 411 | $from_learnpath = 'yes'; |
412 | 412 | session_register('from_learnpath'); |
413 | - $interbreadcrumb[] = array ('url' => "../newscorm/lp_controller.php?action=list", 'name' => get_lang('LearningPath')); |
|
414 | - $interbreadcrumb[] = array ('url' => "../newscorm/lp_controller.php?action=admin_view&lp_id=$learnpath_id", 'name' => stripslashes("{$therow['name']}")); |
|
415 | - $interbreadcrumb[] = array ('url' => api_get_self()."?action=$action&lp_id=$learnpath_id&parent_item_id=$chapter_id&originalresource=no", 'name' => "{$therow2['title']}"); |
|
413 | + $interbreadcrumb[] = array('url' => "../newscorm/lp_controller.php?action=list", 'name' => get_lang('LearningPath')); |
|
414 | + $interbreadcrumb[] = array('url' => "../newscorm/lp_controller.php?action=admin_view&lp_id=$learnpath_id", 'name' => stripslashes("{$therow['name']}")); |
|
415 | + $interbreadcrumb[] = array('url' => api_get_self()."?action=$action&lp_id=$learnpath_id&parent_item_id=$chapter_id&originalresource=no", 'name' => "{$therow2['title']}"); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | $htmlHeadXtra[] = '<script type="text/javascript"> |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | $tool_table = Database::get_course_table(TABLE_TOOL_LIST); |
440 | 440 | $sql_select_active = "SELECT * FROM $tool_table WHERE visibility='1'"; |
441 | 441 | $result_select_active = Database::query($sql_select_active); |
442 | -while ($row=Database::fetch_array($result_select_active)) { |
|
442 | +while ($row = Database::fetch_array($result_select_active)) { |
|
443 | 443 | $active_modules[] = $row['name']; |
444 | 444 | } |
445 | 445 | ?> |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | <!--tr> |
501 | 501 | <td width="26%"><b><?php echo get_lang('ExportableCourseResources'); ?></b></td> |
502 | 502 | </tr--> |
503 | -<?php if ($multi_level_learnpath === true ) { ?> |
|
503 | +<?php if ($multi_level_learnpath === true) { ?> |
|
504 | 504 | <tr> |
505 | 505 | <td><?php echo "<a href=\"".api_get_self()."?content=chapter&action=$action&id=$id&lp_id=$learnpath_id&parent_item_id=$chapter_id&source_forum=$source_forum&originalresource=no\">".get_lang('Chapter')."</a>"; ?></td> |
506 | 506 | </tr> |
@@ -857,9 +857,9 @@ discard block |
||
857 | 857 | ?> |
858 | 858 | </tr> |
859 | 859 | <tr> |
860 | - <td><?php if ($is_allowedToEdit) {echo get_lang('AddToLinks');} ?></td> |
|
860 | + <td><?php if ($is_allowedToEdit) {echo get_lang('AddToLinks'); } ?></td> |
|
861 | 861 | <td> |
862 | - <?php if ($is_allowedToEdit){?> |
|
862 | + <?php if ($is_allowedToEdit) {?> |
|
863 | 863 | <select name="add_2_links" id="add_2_links"> |
864 | 864 | <option value="niet toevoegen" selected="selected">-<?php echo get_lang('DontAdd'); ?>-</option> |
865 | 865 | <option value="0"><?php echo get_lang('MainCategory'); ?></option> |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | require_once '../inc/global.inc.php'; |
27 | 27 | |
28 | -$file = (empty($_SESSION['file'])?'':$_SESSION['file']); |
|
28 | +$file = (empty($_SESSION['file']) ? '' : $_SESSION['file']); |
|
29 | 29 | /** @var learnpath $oLP */ |
30 | 30 | $oLP = unserialize($_SESSION['lpobject']); |
31 | 31 | /** @var learnpathItem $oItem */ |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | header('Content-type: text/javascript'); |
43 | 43 | |
44 | -?>var scorm_logs=<?php echo ((empty($oLP->scorm_debug) or (!api_is_course_admin() && !api_is_platform_admin()) )?'0':'3');?>; //debug log level for SCORM. 0 = none, 1=light, 2=a lot, 3=all - displays logs in log frame |
|
44 | +?>var scorm_logs=<?php echo ((empty($oLP->scorm_debug) or (!api_is_course_admin() && !api_is_platform_admin())) ? '0' : '3'); ?>; //debug log level for SCORM. 0 = none, 1=light, 2=a lot, 3=all - displays logs in log frame |
|
45 | 45 | var lms_logs = 0; //debug log level for LMS actions. 0=none, 1=light, 2=a lot, 3=all |
46 | 46 | |
47 | 47 | // API Object initialization (eases access later on) |
@@ -144,25 +144,25 @@ discard block |
||
144 | 144 | olms.statusSignalReceived = 0; |
145 | 145 | |
146 | 146 | // Strictly scorm variables |
147 | -olms.score=<?php echo $oItem->get_score();?>; |
|
148 | -olms.max='<?php echo $oItem->get_max();?>'; |
|
149 | -olms.min='<?php echo $oItem->get_min();?>'; |
|
150 | -olms.lesson_status='<?php echo $oItem->get_status();?>'; |
|
151 | -olms.session_time='<?php echo $oItem->get_scorm_time('js');?>'; |
|
152 | -olms.suspend_data = '<?php echo $oItem->get_suspend_data();?>'; |
|
153 | -olms.lesson_location = '<?php echo $oItem->get_lesson_location();?>'; |
|
154 | -olms.total_time = '<?php echo $oItem->get_scorm_time('js');?>'; |
|
155 | -olms.mastery_score = '<?php echo $oItem->get_mastery_score();?>'; |
|
147 | +olms.score=<?php echo $oItem->get_score(); ?>; |
|
148 | +olms.max='<?php echo $oItem->get_max(); ?>'; |
|
149 | +olms.min='<?php echo $oItem->get_min(); ?>'; |
|
150 | +olms.lesson_status='<?php echo $oItem->get_status(); ?>'; |
|
151 | +olms.session_time='<?php echo $oItem->get_scorm_time('js'); ?>'; |
|
152 | +olms.suspend_data = '<?php echo $oItem->get_suspend_data(); ?>'; |
|
153 | +olms.lesson_location = '<?php echo $oItem->get_lesson_location(); ?>'; |
|
154 | +olms.total_time = '<?php echo $oItem->get_scorm_time('js'); ?>'; |
|
155 | +olms.mastery_score = '<?php echo $oItem->get_mastery_score(); ?>'; |
|
156 | 156 | olms.launch_data = '<?php echo $oItem->get_launch_data(); ?>'; |
157 | -olms.max_time_allowed = '<?php echo $oItem->get_max_time_allowed();?>'; |
|
158 | -olms.interactions = new Array(<?php echo $oItem->get_interactions_js_array();?>); |
|
157 | +olms.max_time_allowed = '<?php echo $oItem->get_max_time_allowed(); ?>'; |
|
158 | +olms.interactions = new Array(<?php echo $oItem->get_interactions_js_array(); ?>); |
|
159 | 159 | olms.item_objectives = new Array(); |
160 | 160 | olms.info_lms_item = new Array(); |
161 | 161 | |
162 | 162 | // Chamilo internal variables (not SCORM) |
163 | 163 | // olms.saved_lesson_status = 'not attempted'; |
164 | -olms.lms_lp_id = <?php echo $oLP->get_id();?>; |
|
165 | -olms.lms_item_id = <?php echo $oItem->get_id();?>; |
|
164 | +olms.lms_lp_id = <?php echo $oLP->get_id(); ?>; |
|
165 | +olms.lms_item_id = <?php echo $oItem->get_id(); ?>; |
|
166 | 166 | olms.lms_initialized = 0; |
167 | 167 | // switch_finished indicates if the switch process is finished (if it has gone |
168 | 168 | // through LMSInitialize() for the new item. Until then, all LMSSetValue() |
@@ -171,26 +171,26 @@ discard block |
||
171 | 171 | olms.switch_finished = 0; |
172 | 172 | |
173 | 173 | //olms.lms_total_lessons = <?php echo $oLP->get_total_items_count(); ?>; |
174 | -//olms.lms_complete_lessons = <?php echo $oLP->get_complete_items_count();?>; |
|
175 | -//olms.lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode;?>'; |
|
174 | +//olms.lms_complete_lessons = <?php echo $oLP->get_complete_items_count(); ?>; |
|
175 | +//olms.lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode; ?>'; |
|
176 | 176 | //if(lms_progress_bar_mode == ''){lms_progress_bar_mode='%';} |
177 | 177 | |
178 | -olms.lms_view_id = '<?php echo $oLP->get_view();?>'; |
|
178 | +olms.lms_view_id = '<?php echo $oLP->get_view(); ?>'; |
|
179 | 179 | if(olms.lms_view_id == ''){ olms.lms_view_id = 1;} |
180 | -olms.lms_user_id = '<?php echo $userId;?>'; |
|
181 | -olms.lms_next_item = '<?php echo $oLP->get_next_item_id();?>'; |
|
182 | -olms.lms_previous_item = '<?php echo $oLP->get_previous_item_id();?>'; |
|
183 | -olms.lms_lp_type = '<?php echo $oLP->get_type();?>'; |
|
184 | -olms.lms_item_type = '<?php echo $oItem->get_type();?>'; |
|
185 | -olms.lms_item_credit = '<?php echo $oItem->get_credit();?>'; |
|
186 | -olms.lms_item_lesson_mode = '<?php echo $oItem->get_lesson_mode();?>'; |
|
187 | -olms.lms_item_launch_data = '<?php echo addslashes($oItem->get_launch_data());?>'; |
|
188 | -olms.lms_item_core_exit = '<?php echo $oItem->get_core_exit();?>'; |
|
180 | +olms.lms_user_id = '<?php echo $userId; ?>'; |
|
181 | +olms.lms_next_item = '<?php echo $oLP->get_next_item_id(); ?>'; |
|
182 | +olms.lms_previous_item = '<?php echo $oLP->get_previous_item_id(); ?>'; |
|
183 | +olms.lms_lp_type = '<?php echo $oLP->get_type(); ?>'; |
|
184 | +olms.lms_item_type = '<?php echo $oItem->get_type(); ?>'; |
|
185 | +olms.lms_item_credit = '<?php echo $oItem->get_credit(); ?>'; |
|
186 | +olms.lms_item_lesson_mode = '<?php echo $oItem->get_lesson_mode(); ?>'; |
|
187 | +olms.lms_item_launch_data = '<?php echo addslashes($oItem->get_launch_data()); ?>'; |
|
188 | +olms.lms_item_core_exit = '<?php echo $oItem->get_core_exit(); ?>'; |
|
189 | 189 | olms.lms_course_id = '<?php echo $oLP->get_course_int_id(); ?>'; |
190 | 190 | olms.lms_session_id = '<?php echo api_get_session_id(); ?>'; |
191 | 191 | olms.lms_course_code = '<?php echo $oLP->getCourseCode(); ?>'; |
192 | 192 | olms.lms_course_id = '<?php echo $oLP->get_course_int_id(); ?>'; |
193 | -<?php echo $oLP->get_items_details_as_js('olms.lms_item_types');?> |
|
193 | +<?php echo $oLP->get_items_details_as_js('olms.lms_item_types'); ?> |
|
194 | 194 | |
195 | 195 | // Following definition of cmi.core.score.raw in SCORM 1.2, "LMS should |
196 | 196 | // initialize this to an empty string ("") upon initial launch of a SCO. The |
@@ -227,8 +227,8 @@ discard block |
||
227 | 227 | logit_scorm('Other SCORM calls are shown in orange.', 1); |
228 | 228 | logit_lms('To add new messages to these logs, use logit_lms() or logit_scorm().'); |
229 | 229 | |
230 | - olms.info_lms_item[0] = '<?php echo $oItem->get_id();?>'; |
|
231 | - olms.info_lms_item[1] = '<?php echo $oItem->get_id();?>'; |
|
230 | + olms.info_lms_item[0] = '<?php echo $oItem->get_id(); ?>'; |
|
231 | + olms.info_lms_item[1] = '<?php echo $oItem->get_id(); ?>'; |
|
232 | 232 | |
233 | 233 | $("#content_id").load(function() { |
234 | 234 | logit_lms('#content_id load event starts'); |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | result = 'id,score,status'; |
500 | 500 | } else if(param == 'cmi.objectives._count'){ |
501 | 501 | // ---- cmi.objectives._count |
502 | - //result='<?php echo $oItem->get_view_count();?>'; |
|
502 | + //result='<?php echo $oItem->get_view_count(); ?>'; |
|
503 | 503 | result = olms.item_objectives.length; |
504 | 504 | } else if(param.substring(0,15)== 'cmi.objectives.'){ |
505 | 505 | var myres = ''; |
@@ -73,7 +73,7 @@ |
||
73 | 73 | |
74 | 74 | echo '<div class="actions">'; |
75 | 75 | echo '<a href="lp_controller.php?'.api_get_cidreq().'">'. |
76 | - Display::return_icon('back.png', get_lang('ReturnToLearningPaths'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
76 | + Display::return_icon('back.png', get_lang('ReturnToLearningPaths'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
77 | 77 | echo '</div>'; |
78 | 78 | |
79 | 79 | $form->display(); |
@@ -12,7 +12,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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) { |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | // Set status to completed for hotpotatoes if score > 80%. |
164 | 164 | if ($my_type == 'hotpotatoes') { |
165 | 165 | if ((empty($status) || $status == 'undefined' || $status == 'not attempted') && $max > 0) { |
166 | - if (($score/$max) > 0.8) { |
|
166 | + if (($score / $max) > 0.8) { |
|
167 | 167 | $myStatus = 'completed'; |
168 | 168 | if ($debug > 1) { |
169 | 169 | error_log('Calling set_status('.$myStatus.') for hotpotatoes', 0); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | error_log('Done calling set_status for hotpotatoes - now '.$myLPI->get_status(false), 0); |
175 | 175 | } |
176 | 176 | } |
177 | - } elseif ($status == 'completed' && $max > 0 && ($score/$max) < 0.8) { |
|
177 | + } elseif ($status == 'completed' && $max > 0 && ($score / $max) < 0.8) { |
|
178 | 178 | $myStatus = 'failed'; |
179 | 179 | if ($debug > 1) { |
180 | 180 | error_log('Calling set_status('.$myStatus.') for hotpotatoes', 0); |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | $myLPI->current_data = $suspend; |
368 | 368 | } |
369 | 369 | |
370 | - if (isset($location) && $location != '' && $location!='undefined') { |
|
370 | + if (isset($location) && $location != '' && $location != 'undefined') { |
|
371 | 371 | $myLPI->set_lesson_location($location); |
372 | 372 | } |
373 | 373 |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | if ((!$is_allowed_to_edit) || ($isStudentView)) { |
41 | 41 | error_log('New LP - User not authorized in lp_edit_item_prereq.php'); |
42 | - header('location:lp_controller.php?action=view&lp_id=' . $learnpath_id); |
|
42 | + header('location:lp_controller.php?action=view&lp_id='.$learnpath_id); |
|
43 | 43 | } |
44 | 44 | $course_id = api_get_course_int_id(); |
45 | 45 | |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | |
56 | 56 | if (!empty($gradebook) && $gradebook == 'view') { |
57 | 57 | $interbreadcrumb[] = array( |
58 | - 'url' => '../gradebook/' . $_SESSION['gradebook_dest'], |
|
58 | + 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
|
59 | 59 | 'name' => get_lang('ToolGradebook') |
60 | 60 | ); |
61 | 61 | } |
62 | 62 | |
63 | 63 | $interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths')); |
64 | -$interbreadcrumb[] = array('url' => api_get_self() . "?action=build&lp_id=$learnpath_id", 'name' => stripslashes("{$therow['name']}")); |
|
65 | -$interbreadcrumb[] = array('url' => api_get_self() . "?action=add_item&type=step&lp_id=$learnpath_id", 'name' => get_lang('NewStep')); |
|
64 | +$interbreadcrumb[] = array('url' => api_get_self()."?action=build&lp_id=$learnpath_id", 'name' => stripslashes("{$therow['name']}")); |
|
65 | +$interbreadcrumb[] = array('url' => api_get_self()."?action=add_item&type=step&lp_id=$learnpath_id", 'name' => get_lang('NewStep')); |
|
66 | 66 | |
67 | 67 | // Theme calls. |
68 | 68 | $show_learn_path = true; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | // View |
108 | 108 | $interbreadcrumb[] = [ |
109 | - 'url' => api_get_path(WEB_CODE_PATH) . 'newscorm/lp_controller.php?'.api_get_cidreq(), |
|
109 | + 'url' => api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq(), |
|
110 | 110 | 'name' => get_lang('LearningPaths') |
111 | 111 | ]; |
112 | 112 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | array(), |
118 | 118 | ICON_SIZE_MEDIUM |
119 | 119 | ), |
120 | - api_get_path(WEB_CODE_PATH) . 'newscorm/lp_controller.php?' . api_get_cidreq() |
|
120 | + api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq() |
|
121 | 121 | ); |
122 | 122 | |
123 | 123 | $template = new Template(get_lang('StudentScore')); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | // Create the directory |
53 | 53 | $this->base_work_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
54 | 54 | ///learning_path/ppt_dirname directory |
55 | - $this->created_dir = substr($result['dir'], 0, strlen($result['dir']) -1); |
|
55 | + $this->created_dir = substr($result['dir'], 0, strlen($result['dir']) - 1); |
|
56 | 56 | $this->file_path = $this->created_dir.'/'.api_replace_dangerous_char($file['name']); |
57 | 57 | |
58 | 58 | //var_dump($this->file_name, $this->file_path, $this->base_work_dir, $this->created_dir); |
@@ -89,18 +89,18 @@ discard block |
||
89 | 89 | $perm = api_get_setting('permissions_for_new_files'); |
90 | 90 | |
91 | 91 | if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php |
92 | - $converter_path = str_replace('/', '\\', api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png'); |
|
93 | - $class_path = $converter_path . ';' . $converter_path . '/jodconverter-2.2.2.jar;' . $converter_path . '/jodconverter-cli-2.2.2.jar'; |
|
92 | + $converter_path = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png'); |
|
93 | + $class_path = $converter_path.';'.$converter_path.'/jodconverter-2.2.2.jar;'.$converter_path.'/jodconverter-cli-2.2.2.jar'; |
|
94 | 94 | //$cmd = 'java -cp "'.$class_path.'" DokeosConverter'; |
95 | - $cmd = 'java -Dfile.encoding=UTF-8 -cp "' . $class_path . '" DokeosConverter'; |
|
95 | + $cmd = 'java -Dfile.encoding=UTF-8 -cp "'.$class_path.'" DokeosConverter'; |
|
96 | 96 | } else { |
97 | - $converter_path = api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png'; |
|
97 | + $converter_path = api_get_path(SYS_PATH).'main/inc/lib/ppt2png'; |
|
98 | 98 | //$class_path = '-cp .:jodconverter-2.2.1.jar:jodconverter-cli-2.2.1.jar'; |
99 | 99 | $class_path = ' -Dfile.encoding=UTF-8 -cp .:jodconverter-2.2.2.jar:jodconverter-cli-2.2.2.jar'; |
100 | - $cmd = 'cd ' . $converter_path . ' && java ' . $class_path . ' DokeosConverter'; |
|
100 | + $cmd = 'cd '.$converter_path.' && java '.$class_path.' DokeosConverter'; |
|
101 | 101 | } |
102 | 102 | |
103 | - $cmd .= ' -p ' . api_get_setting('service_ppt2lp', 'port'); |
|
103 | + $cmd .= ' -p '.api_get_setting('service_ppt2lp', 'port'); |
|
104 | 104 | // Call to the function implemented by child. |
105 | 105 | $cmd .= $this->add_command_parameters(); |
106 | 106 | // To allow openoffice to manipulate docs. |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | @chmod($this->base_work_dir.$this->file_path, 0777); |
110 | 110 | |
111 | 111 | $locale = $this->original_locale; // TODO: Improve it because we're not sure this locale is present everywhere. |
112 | - putenv('LC_ALL=' . $locale); |
|
112 | + putenv('LC_ALL='.$locale); |
|
113 | 113 | |
114 | 114 | $files = array(); |
115 | 115 | $return = 0; |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | if (!empty($result['images'])) { |
140 | 140 | foreach ($result['images'] as $image => $img_data) { |
141 | 141 | $image_path = $this->base_work_dir.$this->created_dir; |
142 | - @file_put_contents($image_path . '/' . $image, base64_decode($img_data)); |
|
143 | - @chmod($image_path . '/' . $image, 0777); |
|
142 | + @file_put_contents($image_path.'/'.$image, base64_decode($img_data)); |
|
143 | + @chmod($image_path.'/'.$image, 0777); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | |
@@ -233,38 +233,38 @@ discard block |
||
233 | 233 | $ppt2lpHost = api_get_setting('service_ppt2lp', 'host'); |
234 | 234 | $permissionFile = api_get_permissions_for_new_files(); |
235 | 235 | $permissionFolder = api_get_permissions_for_new_directories(); |
236 | - if (file_exists($this->base_work_dir . '/' . $this->created_dir)) { |
|
236 | + if (file_exists($this->base_work_dir.'/'.$this->created_dir)) { |
|
237 | 237 | |
238 | 238 | return $ids; |
239 | 239 | } |
240 | 240 | |
241 | 241 | if ($ppt2lpHost == 'localhost') { |
242 | 242 | if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php |
243 | - $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png'); |
|
244 | - $classPath = $converterPath . ';' . $converterPath . '/jodconverter-2.2.2.jar;' . $converterPath . '/jodconverter-cli-2.2.2.jar'; |
|
245 | - $cmd = 'java -Dfile.encoding=UTF-8 -jar "' . $classPath . '/jodconverter-2.2.2.jar"'; |
|
243 | + $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png'); |
|
244 | + $classPath = $converterPath.';'.$converterPath.'/jodconverter-2.2.2.jar;'.$converterPath.'/jodconverter-cli-2.2.2.jar'; |
|
245 | + $cmd = 'java -Dfile.encoding=UTF-8 -jar "'.$classPath.'/jodconverter-2.2.2.jar"'; |
|
246 | 246 | } else { |
247 | - $converterPath = api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png'; |
|
247 | + $converterPath = api_get_path(SYS_PATH).'main/inc/lib/ppt2png'; |
|
248 | 248 | $classPath = ' -Dfile.encoding=UTF-8 -jar jodconverter-cli-2.2.2.jar'; |
249 | - $cmd = 'cd ' . $converterPath . ' && java ' . $classPath . ' '; |
|
249 | + $cmd = 'cd '.$converterPath.' && java '.$classPath.' '; |
|
250 | 250 | } |
251 | 251 | |
252 | - $cmd .= ' -p ' . api_get_setting('service_ppt2lp', 'port'); |
|
252 | + $cmd .= ' -p '.api_get_setting('service_ppt2lp', 'port'); |
|
253 | 253 | // Call to the function implemented by child. |
254 | - $cmd .= ' "' . $this->base_work_dir . '/' . $this->file_path . '" "' . $this->base_work_dir . '/' . $this->created_dir . '"'; |
|
254 | + $cmd .= ' "'.$this->base_work_dir.'/'.$this->file_path.'" "'.$this->base_work_dir.'/'.$this->created_dir.'"'; |
|
255 | 255 | // To allow openoffice to manipulate docs. |
256 | 256 | @chmod($this->base_work_dir, $permissionFolder); |
257 | - @chmod($this->base_work_dir . '/' . $this->file_path, $permissionFile); |
|
257 | + @chmod($this->base_work_dir.'/'.$this->file_path, $permissionFile); |
|
258 | 258 | |
259 | 259 | $locale = $this->original_locale; // TODO: Improve it because we're not sure this locale is present everywhere. |
260 | - putenv('LC_ALL=' . $locale); |
|
260 | + putenv('LC_ALL='.$locale); |
|
261 | 261 | |
262 | 262 | $files = array(); |
263 | 263 | $return = 0; |
264 | 264 | $shell = exec($cmd, $files, $return); |
265 | 265 | // TODO: Chown is not working, root keep user privileges, should be www-data |
266 | - @chown($this->base_work_dir . '/' . $this->created_dir, 'www-data'); |
|
267 | - @chmod($this->base_work_dir . '/' . $this->created_dir, $permissionFile); |
|
266 | + @chown($this->base_work_dir.'/'.$this->created_dir, 'www-data'); |
|
267 | + @chmod($this->base_work_dir.'/'.$this->created_dir, $permissionFile); |
|
268 | 268 | |
269 | 269 | if ($return != 0) { // If the java application returns an error code. |
270 | 270 | switch ($return) { |
@@ -303,14 +303,14 @@ discard block |
||
303 | 303 | */ |
304 | 304 | } |
305 | 305 | |
306 | - if (file_exists($this->base_work_dir . '/' . $this->created_dir)) { |
|
306 | + if (file_exists($this->base_work_dir.'/'.$this->created_dir)) { |
|
307 | 307 | |
308 | 308 | // Register Files to Document tool |
309 | 309 | $ids[] = add_document( |
310 | 310 | $_course, |
311 | - '/' . $this->created_dir, |
|
311 | + '/'.$this->created_dir, |
|
312 | 312 | 'file', |
313 | - filesize($this->base_work_dir . '/' . $this->created_dir), |
|
313 | + filesize($this->base_work_dir.'/'.$this->created_dir), |
|
314 | 314 | $convertedTitle, |
315 | 315 | sprintf( |
316 | 316 | get_lang('FileConvertedFromXToY'), |