@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | // Using the resource linker as a tool for adding resources to the learning path. |
37 | 37 | if ($action=="add" and $type=="learnpathitem") { |
38 | - $htmlHeadXtra[] = "<script language='JavaScript' type='text/javascript'> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>"; |
|
38 | + $htmlHeadXtra[] = "<script language='JavaScript' type='text/javascript'> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>"; |
|
39 | 39 | } |
40 | 40 | if ((!$is_allowed_to_edit) || ($isStudentView)) { |
41 | 41 | error_log('New LP - User not authorized in lp_build.php'); |
@@ -99,7 +99,7 @@ discard block |
||
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 |
||
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 |
||
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); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | // Percentage progress as saved in the db. |
54 | 54 | public $progress_db = '0'; |
55 | 55 | public $proximity; // Wether the content is distant or local or unknown. |
56 | - public $refs_list = array (); //list of items by ref => db_id. Used only for prerequisites match. |
|
56 | + public $refs_list = array(); //list of items by ref => db_id. Used only for prerequisites match. |
|
57 | 57 | // !!!This array (refs_list) is built differently depending on the nature of the LP. |
58 | 58 | // If SCORM, uses ref, if Chamilo, uses id to keep a unique value. |
59 | 59 | public $type; //type of learnpath. Could be 'dokeos', 'scorm', 'scorm2004', 'aicc', ... |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | } |
155 | 155 | |
156 | 156 | if ($row['expired_on'] != '0000-00-00 00:00:00') { |
157 | - $this->expired_on = $row['expired_on']; |
|
157 | + $this->expired_on = $row['expired_on']; |
|
158 | 158 | } |
159 | 159 | if ($this->type == 2) { |
160 | 160 | if ($row['force_commit'] == 1) { |
@@ -198,12 +198,12 @@ discard block |
||
198 | 198 | ORDER BY view_count DESC"; |
199 | 199 | $res = Database::query($sql); |
200 | 200 | if ($this->debug > 2) { |
201 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - querying lp_view: ' . $sql, 0); |
|
201 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - querying lp_view: '.$sql, 0); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | if (Database :: num_rows($res) > 0) { |
205 | 205 | if ($this->debug > 2) { |
206 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - Found previous view', 0); |
|
206 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - Found previous view', 0); |
|
207 | 207 | } |
208 | 208 | $row = Database :: fetch_array($res); |
209 | 209 | $this->attempt = $row['view_count']; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $this->lp_view_session_id = $row['session_id']; |
214 | 214 | } else if (!api_is_invitee()) { |
215 | 215 | if ($this->debug > 2) { |
216 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - NOT Found previous view', 0); |
|
216 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - NOT Found previous view', 0); |
|
217 | 217 | } |
218 | 218 | $this->attempt = 1; |
219 | 219 | $params = [ |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $this->lp_view_id = Database::insert_id(); |
229 | 229 | |
230 | 230 | if ($this->debug > 2) { |
231 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - inserting new lp_view: ' . $sql, 0); |
|
231 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - inserting new lp_view: '.$sql, 0); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | $sql = "UPDATE $lp_table SET id = iid WHERE iid = ".$this->lp_view_id; |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $res = Database::query($sql); |
244 | 244 | |
245 | 245 | if ($this->debug > 2) { |
246 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - query lp items: ' . $sql, 0); |
|
246 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - query lp items: '.$sql, 0); |
|
247 | 247 | error_log('-- Start while--', 0); |
248 | 248 | } |
249 | 249 | |
@@ -263,8 +263,8 @@ discard block |
||
263 | 263 | $this->refs_list[$oItem->ref] = $my_item_id; |
264 | 264 | if ($this->debug > 2) { |
265 | 265 | error_log( |
266 | - 'New LP - learnpath::__construct() - ' . |
|
267 | - 'aicc object with id ' . $my_item_id . |
|
266 | + 'New LP - learnpath::__construct() - '. |
|
267 | + 'aicc object with id '.$my_item_id. |
|
268 | 268 | ' set in items[]', |
269 | 269 | 0 |
270 | 270 | ); |
@@ -283,19 +283,19 @@ discard block |
||
283 | 283 | |
284 | 284 | $this->refs_list[$oItem->ref] = $my_item_id; |
285 | 285 | if ($this->debug > 2) { |
286 | - error_log('New LP - object with id ' . $my_item_id . ' set in items[]', 0); |
|
286 | + error_log('New LP - object with id '.$my_item_id.' set in items[]', 0); |
|
287 | 287 | } |
288 | 288 | } |
289 | 289 | break; |
290 | 290 | case 1: |
291 | 291 | default: |
292 | 292 | if ($this->debug > 2) { |
293 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - calling learnpathItem', 0); |
|
293 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - calling learnpathItem', 0); |
|
294 | 294 | } |
295 | 295 | $oItem = new learnpathItem($row['id'], $user_id, $course_id, $row); |
296 | 296 | |
297 | 297 | if ($this->debug > 2) { |
298 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - end calling learnpathItem', 0); |
|
298 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - end calling learnpathItem', 0); |
|
299 | 299 | } |
300 | 300 | if (is_object($oItem)) { |
301 | 301 | $my_item_id = $oItem->get_id(); |
@@ -306,8 +306,8 @@ discard block |
||
306 | 306 | $this->refs_list[$my_item_id] = $my_item_id; |
307 | 307 | if ($this->debug > 2) { |
308 | 308 | error_log( |
309 | - 'New LP - learnpath::__construct() ' . __LINE__ . |
|
310 | - ' - object with id ' . $my_item_id . ' set in items[]', |
|
309 | + 'New LP - learnpath::__construct() '.__LINE__. |
|
310 | + ' - object with id '.$my_item_id.' set in items[]', |
|
311 | 311 | 0); |
312 | 312 | } |
313 | 313 | } |
@@ -325,13 +325,13 @@ discard block |
||
325 | 325 | $this->items[$row['id']]->set_lp_view($this->lp_view_id, $course_id); |
326 | 326 | if ($this->items[$row['id']]->get_type() == TOOL_HOTPOTATOES) { |
327 | 327 | $this->items[$row['id']]->current_start_time = 0; |
328 | - $this->items[$row['id']]->current_stop_time = 0; |
|
328 | + $this->items[$row['id']]->current_stop_time = 0; |
|
329 | 329 | } |
330 | 330 | } |
331 | 331 | } |
332 | 332 | |
333 | 333 | if ($this->debug > 2) { |
334 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' ----- end while ----', 0); |
|
334 | + error_log('New LP - learnpath::__construct() '.__LINE__.' ----- end while ----', 0); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | if (!empty($lp_item_id_list)) { |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | // TODO: Define the current item better. |
424 | 424 | $this->first(); |
425 | 425 | if ($this->debug > 2) { |
426 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - End of learnpath constructor for learnpath ' . $this->get_id(), 0); |
|
426 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - End of learnpath constructor for learnpath '.$this->get_id(), 0); |
|
427 | 427 | } |
428 | 428 | return true; |
429 | 429 | } |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | ) { |
501 | 501 | $course_id = $this->course_info['real_id']; |
502 | 502 | if ($this->debug > 0) { |
503 | - error_log('New LP - In learnpath::add_item(' . $parent . ',' . $previous . ',' . $type . ',' . $id . ',' . $title . ')', 0); |
|
503 | + error_log('New LP - In learnpath::add_item('.$parent.','.$previous.','.$type.','.$id.','.$title.')', 0); |
|
504 | 504 | } |
505 | 505 | if (empty($course_id)) { |
506 | 506 | // Sometimes Oogie doesn't catch the course info but sets $this->cc |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | FROM $tbl_lp_item |
523 | 523 | WHERE |
524 | 524 | c_id = $course_id AND |
525 | - lp_id = " . $this->get_id() . " AND |
|
525 | + lp_id = ".$this->get_id()." AND |
|
526 | 526 | parent_item_id = " . $parent; |
527 | 527 | |
528 | 528 | $res_count = Database::query($sql); |
@@ -532,11 +532,11 @@ discard block |
||
532 | 532 | if ($num > 0) { |
533 | 533 | if ($previous == 0) { |
534 | 534 | $sql = "SELECT id, next_item_id, display_order |
535 | - FROM " . $tbl_lp_item . " |
|
535 | + FROM " . $tbl_lp_item." |
|
536 | 536 | WHERE |
537 | 537 | c_id = $course_id AND |
538 | - lp_id = " . $this->get_id() . " AND |
|
539 | - parent_item_id = " . $parent . " AND |
|
538 | + lp_id = ".$this->get_id()." AND |
|
539 | + parent_item_id = " . $parent." AND |
|
540 | 540 | previous_item_id = 0 OR |
541 | 541 | previous_item_id=" . $parent; |
542 | 542 | $result = Database::query($sql); |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | FROM $tbl_lp_item |
552 | 552 | WHERE |
553 | 553 | c_id = $course_id AND |
554 | - lp_id = " . $this->get_id() . " AND |
|
554 | + lp_id = ".$this->get_id()." AND |
|
555 | 555 | id = " . $previous; |
556 | 556 | |
557 | 557 | $result = Database::query($sql); |
@@ -571,8 +571,8 @@ discard block |
||
571 | 571 | $typeCleaned = Database::escape_string($type); |
572 | 572 | if ($type == 'quiz') { |
573 | 573 | $sql = 'SELECT SUM(ponderation) |
574 | - FROM ' . Database :: get_course_table(TABLE_QUIZ_QUESTION) . ' as quiz_question |
|
575 | - INNER JOIN ' . Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION) . ' as quiz_rel_question |
|
574 | + FROM ' . Database :: get_course_table(TABLE_QUIZ_QUESTION).' as quiz_question |
|
575 | + INNER JOIN ' . Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION).' as quiz_rel_question |
|
576 | 576 | ON |
577 | 577 | quiz_question.id = quiz_rel_question.question_id AND |
578 | 578 | quiz_question.c_id = quiz_rel_question.c_id |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | $new_item_id = Database::insert($tbl_lp_item, $params); |
619 | 619 | |
620 | 620 | if ($this->debug > 2) { |
621 | - error_log('New LP - Inserting chapter: ' . $new_item_id, 0); |
|
621 | + error_log('New LP - Inserting chapter: '.$new_item_id, 0); |
|
622 | 622 | } |
623 | 623 | |
624 | 624 | if ($new_item_id) { |
@@ -635,28 +635,28 @@ discard block |
||
635 | 635 | Database::query($sql); |
636 | 636 | |
637 | 637 | // Update all the items after the new item. |
638 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
638 | + $sql = "UPDATE ".$tbl_lp_item." |
|
639 | 639 | SET display_order = display_order + 1 |
640 | 640 | WHERE |
641 | 641 | c_id = $course_id AND |
642 | - lp_id = " . $this->get_id() . " AND |
|
643 | - id <> " . $new_item_id . " AND |
|
644 | - parent_item_id = " . $parent . " AND |
|
642 | + lp_id = ".$this->get_id()." AND |
|
643 | + id <> " . $new_item_id." AND |
|
644 | + parent_item_id = " . $parent." AND |
|
645 | 645 | display_order > " . $display_order; |
646 | 646 | Database::query($sql); |
647 | 647 | |
648 | 648 | // Update the item that should come after the new item. |
649 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
650 | - SET ref = " . $new_item_id . " |
|
651 | - WHERE c_id = $course_id AND id = " . $new_item_id; |
|
649 | + $sql = "UPDATE ".$tbl_lp_item." |
|
650 | + SET ref = " . $new_item_id." |
|
651 | + WHERE c_id = $course_id AND id = ".$new_item_id; |
|
652 | 652 | Database::query($sql); |
653 | 653 | |
654 | 654 | // Upload audio. |
655 | 655 | if (!empty($_FILES['mp3']['name'])) { |
656 | 656 | // Create the audio folder if it does not exist yet. |
657 | - $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document/'; |
|
658 | - if (!is_dir($filepath . 'audio')) { |
|
659 | - mkdir($filepath . 'audio', api_get_permissions_for_new_directories()); |
|
657 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
658 | + if (!is_dir($filepath.'audio')) { |
|
659 | + mkdir($filepath.'audio', api_get_permissions_for_new_directories()); |
|
660 | 660 | $audio_id = add_document( |
661 | 661 | $_course, |
662 | 662 | '/audio', |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | $file_path = handle_uploaded_document( |
700 | 700 | $_course, |
701 | 701 | $_FILES['mp3'], |
702 | - api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document', |
|
702 | + api_get_path(SYS_COURSE_PATH).$_course['path'].'/document', |
|
703 | 703 | '/audio', |
704 | 704 | $userId, |
705 | 705 | '', |
@@ -715,8 +715,8 @@ discard block |
||
715 | 715 | |
716 | 716 | // Store the mp3 file in the lp_item table. |
717 | 717 | $sql = "UPDATE $tbl_lp_item SET |
718 | - audio = '" . Database::escape_string($file) . "' |
|
719 | - WHERE id = '" . intval($new_item_id) . "'"; |
|
718 | + audio = '".Database::escape_string($file)."' |
|
719 | + WHERE id = '" . intval($new_item_id)."'"; |
|
720 | 720 | Database::query($sql); |
721 | 721 | } |
722 | 722 | } |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | while (Database :: num_rows($res_name)) { |
796 | 796 | // There is already one such name, update the current one a bit. |
797 | 797 | $i++; |
798 | - $name = $name . ' - ' . $i; |
|
798 | + $name = $name.' - '.$i; |
|
799 | 799 | $check_name = "SELECT * FROM $tbl_lp WHERE c_id = $course_id AND name = '$name'"; |
800 | 800 | $res_name = Database::query($check_name); |
801 | 801 | } |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | // if $item points to an object and there is a parent. |
908 | 908 | if ($debug) { |
909 | 909 | error_log( |
910 | - 'Autocompleting parent of item ' . $item . ' "'.$currentItem->get_title().'" (item ' . $parent_id . ' "'.$parent->get_title().'") ', |
|
910 | + 'Autocompleting parent of item '.$item.' "'.$currentItem->get_title().'" (item '.$parent_id.' "'.$parent->get_title().'") ', |
|
911 | 911 | 0 |
912 | 912 | ); |
913 | 913 | } |
@@ -935,7 +935,7 @@ discard block |
||
935 | 935 | if ($childItemId != $item) { |
936 | 936 | if ($debug) { |
937 | 937 | error_log( |
938 | - 'Looking at brother #'.$childItemId . ' "' . $childItem->get_title() . '", status is ' . $childItem->get_status(), |
|
938 | + 'Looking at brother #'.$childItemId.' "'.$childItem->get_title().'", status is '.$childItem->get_status(), |
|
939 | 939 | 0 |
940 | 940 | ); |
941 | 941 | } |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | } else { |
956 | 956 | if ($debug > 2) { |
957 | 957 | error_log( |
958 | - 'Found one incomplete child of parent #' . $parent_id . ': child #'.$childItemId . ' "' . $childItem->get_title() . '", is ' . $childItem->get_status().' db_item_view_id:#'.$childItem->db_item_view_id, |
|
958 | + 'Found one incomplete child of parent #'.$parent_id.': child #'.$childItemId.' "'.$childItem->get_title().'", is '.$childItem->get_status().' db_item_view_id:#'.$childItem->db_item_view_id, |
|
959 | 959 | 0 |
960 | 960 | ); |
961 | 961 | } |
@@ -1060,15 +1060,15 @@ discard block |
||
1060 | 1060 | // Delete lp item id. |
1061 | 1061 | foreach ($this->items as $id => $dummy) { |
1062 | 1062 | $sql = "DELETE FROM $lp_item_view |
1063 | - WHERE c_id = $course_id AND lp_item_id = '" . $id . "'"; |
|
1063 | + WHERE c_id = $course_id AND lp_item_id = '".$id."'"; |
|
1064 | 1064 | Database::query($sql); |
1065 | 1065 | } |
1066 | 1066 | |
1067 | 1067 | // Proposed by Christophe (nickname: clefevre) |
1068 | - $sql = "DELETE FROM $lp_item WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
1068 | + $sql = "DELETE FROM $lp_item WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
1069 | 1069 | Database::query($sql); |
1070 | 1070 | |
1071 | - $sql = "DELETE FROM $lp_view WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
1071 | + $sql = "DELETE FROM $lp_view WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
1072 | 1072 | Database::query($sql); |
1073 | 1073 | |
1074 | 1074 | self::toggle_publish($this->lp_id, 'i'); |
@@ -1076,32 +1076,32 @@ discard block |
||
1076 | 1076 | if ($this->type == 2 || $this->type == 3) { |
1077 | 1077 | // This is a scorm learning path, delete the files as well. |
1078 | 1078 | $sql = "SELECT path FROM $lp |
1079 | - WHERE c_id = ".$course_id." AND id = " . $this->lp_id; |
|
1079 | + WHERE c_id = ".$course_id." AND id = ".$this->lp_id; |
|
1080 | 1080 | $res = Database::query($sql); |
1081 | 1081 | if (Database :: num_rows($res) > 0) { |
1082 | 1082 | $row = Database :: fetch_array($res); |
1083 | 1083 | $path = $row['path']; |
1084 | 1084 | $sql = "SELECT id FROM $lp |
1085 | - WHERE c_id = ".$course_id." AND path = '$path' AND id != " . $this->lp_id; |
|
1085 | + WHERE c_id = ".$course_id." AND path = '$path' AND id != ".$this->lp_id; |
|
1086 | 1086 | $res = Database::query($sql); |
1087 | 1087 | if (Database :: num_rows($res) > 0) { // Another learning path uses this directory, so don't delete it. |
1088 | 1088 | if ($this->debug > 2) { |
1089 | - error_log('New LP - In learnpath::delete(), found other LP using path ' . $path . ', keeping directory', 0); |
|
1089 | + error_log('New LP - In learnpath::delete(), found other LP using path '.$path.', keeping directory', 0); |
|
1090 | 1090 | } |
1091 | 1091 | } else { |
1092 | 1092 | // No other LP uses that directory, delete it. |
1093 | - $course_rel_dir = api_get_course_path() . '/scorm/'; // scorm dir web path starting from /courses |
|
1094 | - $course_scorm_dir = api_get_path(SYS_COURSE_PATH) . $course_rel_dir; // The absolute system path for this course. |
|
1095 | - if ($delete == 'remove' && is_dir($course_scorm_dir . $path) and !empty ($course_scorm_dir)) { |
|
1093 | + $course_rel_dir = api_get_course_path().'/scorm/'; // scorm dir web path starting from /courses |
|
1094 | + $course_scorm_dir = api_get_path(SYS_COURSE_PATH).$course_rel_dir; // The absolute system path for this course. |
|
1095 | + if ($delete == 'remove' && is_dir($course_scorm_dir.$path) and !empty ($course_scorm_dir)) { |
|
1096 | 1096 | if ($this->debug > 2) { |
1097 | - error_log('New LP - In learnpath::delete(), found SCORM, deleting directory: ' . $course_scorm_dir . $path, 0); |
|
1097 | + error_log('New LP - In learnpath::delete(), found SCORM, deleting directory: '.$course_scorm_dir.$path, 0); |
|
1098 | 1098 | } |
1099 | 1099 | // Proposed by Christophe (clefevre). |
1100 | 1100 | if (strcmp(substr($path, -2), "/.") == 0) { |
1101 | 1101 | $path = substr($path, 0, -1); // Remove "." at the end. |
1102 | 1102 | } |
1103 | 1103 | //exec('rm -rf ' . $course_scorm_dir . $path); // See Bug #5208, this is not OS-portable way. |
1104 | - rmdirr($course_scorm_dir . $path); |
|
1104 | + rmdirr($course_scorm_dir.$path); |
|
1105 | 1105 | } |
1106 | 1106 | } |
1107 | 1107 | } |
@@ -1114,7 +1114,7 @@ discard block |
||
1114 | 1114 | WHERE c_id = ".$course_id." AND (link LIKE '$link%' AND image='scormbuilder.gif')"; |
1115 | 1115 | Database::query($sql); |
1116 | 1116 | |
1117 | - $sql = "DELETE FROM $lp WHERE c_id = ".$course_id." AND id = " . $this->lp_id; |
|
1117 | + $sql = "DELETE FROM $lp WHERE c_id = ".$course_id." AND id = ".$this->lp_id; |
|
1118 | 1118 | Database::query($sql); |
1119 | 1119 | // Updates the display order of all lps. |
1120 | 1120 | $this->update_display_order(); |
@@ -1127,7 +1127,7 @@ discard block |
||
1127 | 1127 | api_get_user_id() |
1128 | 1128 | ); |
1129 | 1129 | |
1130 | - $link_info = GradebookUtils::is_resource_in_course_gradebook(api_get_course_id(), 4 , $id, api_get_session_id()); |
|
1130 | + $link_info = GradebookUtils::is_resource_in_course_gradebook(api_get_course_id(), 4, $id, api_get_session_id()); |
|
1131 | 1131 | if ($link_info !== false) { |
1132 | 1132 | GradebookUtils::remove_resource_from_course_gradebook($link_info['id']); |
1133 | 1133 | } |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | { |
1148 | 1148 | $course_id = $this->course_info['real_id']; |
1149 | 1149 | if ($this->debug > 0) { |
1150 | - error_log('New LP - In learnpath::delete_children_items(' . $id . ')', 0); |
|
1150 | + error_log('New LP - In learnpath::delete_children_items('.$id.')', 0); |
|
1151 | 1151 | } |
1152 | 1152 | $num = 0; |
1153 | 1153 | if (empty ($id) || $id != strval(intval($id))) { |
@@ -1158,7 +1158,7 @@ discard block |
||
1158 | 1158 | $res = Database::query($sql); |
1159 | 1159 | while ($row = Database :: fetch_array($res)) { |
1160 | 1160 | $num += $this->delete_children_items($row['id']); |
1161 | - $sql_del = "DELETE FROM $lp_item WHERE c_id = ".$course_id." AND id = " . $row['id']; |
|
1161 | + $sql_del = "DELETE FROM $lp_item WHERE c_id = ".$course_id." AND id = ".$row['id']; |
|
1162 | 1162 | Database::query($sql_del); |
1163 | 1163 | $num++; |
1164 | 1164 | } |
@@ -1199,12 +1199,12 @@ discard block |
||
1199 | 1199 | // Delete children items. |
1200 | 1200 | $num = $this->delete_children_items($id); |
1201 | 1201 | if ($this->debug > 2) { |
1202 | - error_log('New LP - learnpath::delete_item() - deleted ' . $num . ' children of element ' . $id, 0); |
|
1202 | + error_log('New LP - learnpath::delete_item() - deleted '.$num.' children of element '.$id, 0); |
|
1203 | 1203 | } |
1204 | 1204 | // Now delete the item. |
1205 | 1205 | $sql_del = "DELETE FROM $lp_item WHERE c_id = $course_id AND id = $id"; |
1206 | 1206 | if ($this->debug > 2) { |
1207 | - error_log('New LP - Deleting item: ' . $sql_del, 0); |
|
1207 | + error_log('New LP - Deleting item: '.$sql_del, 0); |
|
1208 | 1208 | } |
1209 | 1209 | Database::query($sql_del); |
1210 | 1210 | // Now update surrounding items. |
@@ -1279,15 +1279,15 @@ discard block |
||
1279 | 1279 | } |
1280 | 1280 | |
1281 | 1281 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
1282 | - $sql_select = "SELECT * FROM " . $tbl_lp_item . " WHERE c_id = ".$course_id." AND id = " . $id; |
|
1282 | + $sql_select = "SELECT * FROM ".$tbl_lp_item." WHERE c_id = ".$course_id." AND id = ".$id; |
|
1283 | 1283 | $res_select = Database::query($sql_select); |
1284 | 1284 | $row_select = Database :: fetch_array($res_select); |
1285 | 1285 | $audio_update_sql = ''; |
1286 | 1286 | if (is_array($audio) && !empty ($audio['tmp_name']) && $audio['error'] === 0) { |
1287 | 1287 | // Create the audio folder if it does not exist yet. |
1288 | - $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document/'; |
|
1289 | - if (!is_dir($filepath . 'audio')) { |
|
1290 | - mkdir($filepath . 'audio', api_get_permissions_for_new_directories()); |
|
1288 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
1289 | + if (!is_dir($filepath.'audio')) { |
|
1290 | + mkdir($filepath.'audio', api_get_permissions_for_new_directories()); |
|
1291 | 1291 | $audio_id = add_document( |
1292 | 1292 | $_course, |
1293 | 1293 | '/audio', |
@@ -1325,11 +1325,11 @@ discard block |
||
1325 | 1325 | $pi = pathinfo($audio['name']); |
1326 | 1326 | if ($pi['extension'] == 'mp3') { |
1327 | 1327 | $c_det = api_get_course_info($this->cc); |
1328 | - $bp = api_get_path(SYS_COURSE_PATH) . $c_det['path'] . '/document'; |
|
1328 | + $bp = api_get_path(SYS_COURSE_PATH).$c_det['path'].'/document'; |
|
1329 | 1329 | $path = handle_uploaded_document($c_det, $audio, $bp, '/audio', api_get_user_id(), 0, null, 0, 'rename', false, 0); |
1330 | 1330 | $path = substr($path, 7); |
1331 | 1331 | // Update reference in lp_item - audio path is the path from inside de document/audio/ dir. |
1332 | - $audio_update_sql = ", audio = '" . Database::escape_string($path) . "' "; |
|
1332 | + $audio_update_sql = ", audio = '".Database::escape_string($path)."' "; |
|
1333 | 1333 | } |
1334 | 1334 | } |
1335 | 1335 | |
@@ -1339,13 +1339,13 @@ discard block |
||
1339 | 1339 | // TODO: htmlspecialchars to be checked for encoding related problems. |
1340 | 1340 | if ($same_parent && $same_previous) { |
1341 | 1341 | // Only update title and description. |
1342 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1343 | - SET title = '" . Database::escape_string($title) . "', |
|
1344 | - prerequisite = '" . $prerequisites . "', |
|
1345 | - description = '" . Database::escape_string($description) . "' |
|
1346 | - " . $audio_update_sql . ", |
|
1347 | - max_time_allowed = '" . Database::escape_string($max_time_allowed) . "' |
|
1348 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
1342 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1343 | + SET title = '" . Database::escape_string($title)."', |
|
1344 | + prerequisite = '" . $prerequisites."', |
|
1345 | + description = '" . Database::escape_string($description)."' |
|
1346 | + " . $audio_update_sql.", |
|
1347 | + max_time_allowed = '" . Database::escape_string($max_time_allowed)."' |
|
1348 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
1349 | 1349 | Database::query($sql); |
1350 | 1350 | } else { |
1351 | 1351 | $old_parent = $row_select['parent_item_id']; |
@@ -1360,27 +1360,27 @@ discard block |
||
1360 | 1360 | |
1361 | 1361 | if ($old_previous != 0) { |
1362 | 1362 | // Next |
1363 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1364 | - SET next_item_id = " . $old_next . " |
|
1365 | - WHERE c_id = ".$course_id." AND id = " . $old_previous; |
|
1363 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1364 | + SET next_item_id = " . $old_next." |
|
1365 | + WHERE c_id = ".$course_id." AND id = ".$old_previous; |
|
1366 | 1366 | Database::query($sql); |
1367 | 1367 | } |
1368 | 1368 | |
1369 | 1369 | if ($old_next != 0) { |
1370 | 1370 | // Previous |
1371 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1372 | - SET previous_item_id = " . $old_previous . " |
|
1373 | - WHERE c_id = ".$course_id." AND id = " . $old_next; |
|
1371 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1372 | + SET previous_item_id = " . $old_previous." |
|
1373 | + WHERE c_id = ".$course_id." AND id = ".$old_next; |
|
1374 | 1374 | Database::query($sql); |
1375 | 1375 | } |
1376 | 1376 | |
1377 | 1377 | // display_order - 1 for every item with a display_order bigger then the display_order of the current item. |
1378 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1378 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1379 | 1379 | SET display_order = display_order - 1 |
1380 | 1380 | WHERE |
1381 | 1381 | c_id = ".$course_id." AND |
1382 | - display_order > " . $old_order . " AND |
|
1383 | - lp_id = " . $this->lp_id . " AND |
|
1382 | + display_order > " . $old_order." AND |
|
1383 | + lp_id = " . $this->lp_id." AND |
|
1384 | 1384 | parent_item_id = " . $old_parent; |
1385 | 1385 | Database::query($sql); |
1386 | 1386 | /* END -- virtually remove the current item id */ |
@@ -1390,11 +1390,11 @@ discard block |
||
1390 | 1390 | if ($previous == 0) { |
1391 | 1391 | // Select the data of the item that should come after the current item. |
1392 | 1392 | $sql = "SELECT id, display_order |
1393 | - FROM " . $tbl_lp_item . " |
|
1393 | + FROM " . $tbl_lp_item." |
|
1394 | 1394 | WHERE |
1395 | 1395 | c_id = ".$course_id." AND |
1396 | - lp_id = " . $this->lp_id . " AND |
|
1397 | - parent_item_id = " . $parent . " AND |
|
1396 | + lp_id = " . $this->lp_id." AND |
|
1397 | + parent_item_id = " . $parent." AND |
|
1398 | 1398 | previous_item_id = " . $previous; |
1399 | 1399 | $res_select_old = Database::query($sql); |
1400 | 1400 | $row_select_old = Database::fetch_array($res_select_old); |
@@ -1410,8 +1410,8 @@ discard block |
||
1410 | 1410 | } else { |
1411 | 1411 | // Select the data of the item that should come before the current item. |
1412 | 1412 | $sql = "SELECT next_item_id, display_order |
1413 | - FROM " . $tbl_lp_item . " |
|
1414 | - WHERE c_id = ".$course_id." AND id = " . $previous; |
|
1413 | + FROM " . $tbl_lp_item." |
|
1414 | + WHERE c_id = ".$course_id." AND id = ".$previous; |
|
1415 | 1415 | $res_select_old = Database::query($sql); |
1416 | 1416 | $row_select_old = Database :: fetch_array($res_select_old); |
1417 | 1417 | $new_next = $row_select_old['next_item_id']; |
@@ -1420,57 +1420,57 @@ discard block |
||
1420 | 1420 | |
1421 | 1421 | // TODO: htmlspecialchars to be checked for encoding related problems. |
1422 | 1422 | // Update the current item with the new data. |
1423 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1423 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1424 | 1424 | SET |
1425 | - title = '" . Database::escape_string($title) . "', |
|
1426 | - description = '" . Database::escape_string($description) . "', |
|
1427 | - parent_item_id = " . $parent . ", |
|
1428 | - previous_item_id = " . $previous . ", |
|
1429 | - next_item_id = " . $new_next . ", |
|
1430 | - display_order = " . $new_order . " |
|
1431 | - " . $audio_update_sql . " |
|
1432 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
1425 | + title = '" . Database::escape_string($title)."', |
|
1426 | + description = '" . Database::escape_string($description)."', |
|
1427 | + parent_item_id = " . $parent.", |
|
1428 | + previous_item_id = " . $previous.", |
|
1429 | + next_item_id = " . $new_next.", |
|
1430 | + display_order = " . $new_order." |
|
1431 | + " . $audio_update_sql." |
|
1432 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
1433 | 1433 | Database::query($sql); |
1434 | 1434 | |
1435 | 1435 | if ($previous != 0) { |
1436 | 1436 | // Update the previous item's next_item_id. |
1437 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1438 | - SET next_item_id = " . $id . " |
|
1439 | - WHERE c_id = ".$course_id." AND id = " . $previous; |
|
1437 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1438 | + SET next_item_id = " . $id." |
|
1439 | + WHERE c_id = ".$course_id." AND id = ".$previous; |
|
1440 | 1440 | Database::query($sql); |
1441 | 1441 | } |
1442 | 1442 | |
1443 | 1443 | if ($new_next != 0) { |
1444 | 1444 | // Update the next item's previous_item_id. |
1445 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1446 | - SET previous_item_id = " . $id . " |
|
1447 | - WHERE c_id = ".$course_id." AND id = " . $new_next; |
|
1445 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1446 | + SET previous_item_id = " . $id." |
|
1447 | + WHERE c_id = ".$course_id." AND id = ".$new_next; |
|
1448 | 1448 | Database::query($sql); |
1449 | 1449 | } |
1450 | 1450 | |
1451 | 1451 | if ($old_prerequisite != $prerequisites) { |
1452 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1453 | - SET prerequisite = '" . $prerequisites . "' |
|
1454 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
1452 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1453 | + SET prerequisite = '" . $prerequisites."' |
|
1454 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
1455 | 1455 | Database::query($sql); |
1456 | 1456 | } |
1457 | 1457 | |
1458 | 1458 | if ($old_max_time_allowed != $max_time_allowed) { |
1459 | 1459 | // update max time allowed |
1460 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1461 | - SET max_time_allowed = " . $max_time_allowed . " |
|
1462 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
1460 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1461 | + SET max_time_allowed = " . $max_time_allowed." |
|
1462 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
1463 | 1463 | Database::query($sql); |
1464 | 1464 | } |
1465 | 1465 | |
1466 | 1466 | // Update all the items with the same or a bigger display_order than the current item. |
1467 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1467 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1468 | 1468 | SET display_order = display_order + 1 |
1469 | 1469 | WHERE |
1470 | 1470 | c_id = ".$course_id." AND |
1471 | - lp_id = " . $this->get_id() . " AND |
|
1472 | - id <> " . $id . " AND |
|
1473 | - parent_item_id = " . $parent . " AND |
|
1471 | + lp_id = " . $this->get_id()." AND |
|
1472 | + id <> " . $id." AND |
|
1473 | + parent_item_id = " . $parent." AND |
|
1474 | 1474 | display_order >= " . $new_order; |
1475 | 1475 | |
1476 | 1476 | Database::query($sql); |
@@ -1496,7 +1496,7 @@ discard block |
||
1496 | 1496 | { |
1497 | 1497 | $course_id = api_get_course_int_id(); |
1498 | 1498 | if ($this->debug > 0) { |
1499 | - error_log('New LP - In learnpath::edit_item_prereq(' . $id . ',' . $prerequisite_id . ',' . $mastery_score . ',' . $max_score . ')', 0); |
|
1499 | + error_log('New LP - In learnpath::edit_item_prereq('.$id.','.$prerequisite_id.','.$mastery_score.','.$max_score.')', 0); |
|
1500 | 1500 | } |
1501 | 1501 | |
1502 | 1502 | if (empty($id) || ($id != strval(intval($id))) || empty ($prerequisite_id)) { |
@@ -1594,8 +1594,8 @@ discard block |
||
1594 | 1594 | error_log('New LP - In learnpath::get_brother_chapters()', 0); |
1595 | 1595 | } |
1596 | 1596 | |
1597 | - if (empty($id)|| $id != strval(intval($id))) { |
|
1598 | - return array (); |
|
1597 | + if (empty($id) || $id != strval(intval($id))) { |
|
1598 | + return array(); |
|
1599 | 1599 | } |
1600 | 1600 | |
1601 | 1601 | $lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
@@ -1613,13 +1613,13 @@ discard block |
||
1613 | 1613 | item_type='dokeos_chapter' |
1614 | 1614 | ORDER BY display_order"; |
1615 | 1615 | $res_bros = Database::query($sql_bros); |
1616 | - $list = array (); |
|
1616 | + $list = array(); |
|
1617 | 1617 | while ($row_bro = Database :: fetch_array($res_bros)) { |
1618 | 1618 | $list[] = $row_bro; |
1619 | 1619 | } |
1620 | 1620 | return $list; |
1621 | 1621 | } |
1622 | - return array (); |
|
1622 | + return array(); |
|
1623 | 1623 | } |
1624 | 1624 | |
1625 | 1625 | /** |
@@ -1632,11 +1632,11 @@ discard block |
||
1632 | 1632 | { |
1633 | 1633 | $course_id = api_get_course_int_id(); |
1634 | 1634 | if ($this->debug > 0) { |
1635 | - error_log('New LP - In learnpath::get_brother_items(' . $id . ')', 0); |
|
1635 | + error_log('New LP - In learnpath::get_brother_items('.$id.')', 0); |
|
1636 | 1636 | } |
1637 | 1637 | |
1638 | 1638 | if (empty ($id) || $id != strval(intval($id))) { |
1639 | - return array (); |
|
1639 | + return array(); |
|
1640 | 1640 | } |
1641 | 1641 | |
1642 | 1642 | $lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
@@ -1648,13 +1648,13 @@ discard block |
||
1648 | 1648 | $sql_bros = "SELECT * FROM $lp_item WHERE c_id = ".$course_id." AND parent_item_id = $parent |
1649 | 1649 | ORDER BY display_order"; |
1650 | 1650 | $res_bros = Database::query($sql_bros); |
1651 | - $list = array (); |
|
1651 | + $list = array(); |
|
1652 | 1652 | while ($row_bro = Database :: fetch_array($res_bros)) { |
1653 | 1653 | $list[] = $row_bro; |
1654 | 1654 | } |
1655 | 1655 | return $list; |
1656 | 1656 | } |
1657 | - return array (); |
|
1657 | + return array(); |
|
1658 | 1658 | } |
1659 | 1659 | |
1660 | 1660 | /** |
@@ -1724,7 +1724,7 @@ discard block |
||
1724 | 1724 | $current = $this->current; |
1725 | 1725 | } |
1726 | 1726 | if ($this->debug > 2) { |
1727 | - error_log('New LP - In learnpath::get_current_item_id() - Returning ' . $current, 0); |
|
1727 | + error_log('New LP - In learnpath::get_current_item_id() - Returning '.$current, 0); |
|
1728 | 1728 | } |
1729 | 1729 | return $current; |
1730 | 1730 | } |
@@ -1805,7 +1805,7 @@ discard block |
||
1805 | 1805 | ) { |
1806 | 1806 | |
1807 | 1807 | if ($this->debug > 2) { |
1808 | - error_log('New LP - In learnpath::first() - Last item seen is ' . $this->last_item_seen.' of type '.$this->items[$this->last_item_seen]->get_type(), 0); |
|
1808 | + error_log('New LP - In learnpath::first() - Last item seen is '.$this->last_item_seen.' of type '.$this->items[$this->last_item_seen]->get_type(), 0); |
|
1809 | 1809 | } |
1810 | 1810 | $index = -1; |
1811 | 1811 | foreach ($this->ordered_items as $myindex => $item_id) { |
@@ -1817,7 +1817,7 @@ discard block |
||
1817 | 1817 | if ($index == -1) { |
1818 | 1818 | // Index hasn't changed, so item not found - panic (this shouldn't happen). |
1819 | 1819 | if ($this->debug > 2) { |
1820 | - error_log('New LP - Last item (' . $this->last_item_seen . ') was found in items but not in ordered_items, panic!', 0); |
|
1820 | + error_log('New LP - Last item ('.$this->last_item_seen.') was found in items but not in ordered_items, panic!', 0); |
|
1821 | 1821 | } |
1822 | 1822 | return false; |
1823 | 1823 | } else { |
@@ -1832,7 +1832,7 @@ discard block |
||
1832 | 1832 | $index = 0; |
1833 | 1833 | // Loop through all ordered items and stop at the first item that is |
1834 | 1834 | // not a directory *and* that has not been completed yet. |
1835 | - while ( !empty($this->ordered_items[$index]) AND |
|
1835 | + while (!empty($this->ordered_items[$index]) AND |
|
1836 | 1836 | is_a($this->items[$this->ordered_items[$index]], 'learnpathItem') AND |
1837 | 1837 | ( |
1838 | 1838 | $this->items[$this->ordered_items[$index]]->get_type() == 'dir' OR |
@@ -1846,14 +1846,14 @@ discard block |
||
1846 | 1846 | $this->current = isset($this->ordered_items[$index]) ? $this->ordered_items[$index] : null; |
1847 | 1847 | $this->index = $index; |
1848 | 1848 | if ($this->debug > 2) { |
1849 | - error_log('$index ' . $index); |
|
1849 | + error_log('$index '.$index); |
|
1850 | 1850 | } |
1851 | 1851 | if ($this->debug > 2) { |
1852 | - error_log('New LP - In learnpath::first() - No last item seen. New last = ' . $this->last . '(' . $this->ordered_items[$index] . ')', 0); |
|
1852 | + error_log('New LP - In learnpath::first() - No last item seen. New last = '.$this->last.'('.$this->ordered_items[$index].')', 0); |
|
1853 | 1853 | } |
1854 | 1854 | } |
1855 | 1855 | if ($this->debug > 2) { |
1856 | - error_log('New LP - In learnpath::first() - First item is ' . $this->get_current_item_id()); |
|
1856 | + error_log('New LP - In learnpath::first() - First item is '.$this->get_current_item_id()); |
|
1857 | 1857 | } |
1858 | 1858 | } |
1859 | 1859 | |
@@ -1866,7 +1866,7 @@ discard block |
||
1866 | 1866 | public function get_js_info($item_id = '') |
1867 | 1867 | { |
1868 | 1868 | if ($this->debug > 0) { |
1869 | - error_log('New LP - In learnpath::get_js_info(' . $item_id . ')', 0); |
|
1869 | + error_log('New LP - In learnpath::get_js_info('.$item_id.')', 0); |
|
1870 | 1870 | } |
1871 | 1871 | |
1872 | 1872 | $info = ''; |
@@ -1876,17 +1876,17 @@ discard block |
||
1876 | 1876 | //if item is defined, return values from DB |
1877 | 1877 | $oItem = $this->items[$item_id]; |
1878 | 1878 | $info .= '<script language="javascript">'; |
1879 | - $info .= "top.set_score(" . $oItem->get_score() . ");\n"; |
|
1880 | - $info .= "top.set_max(" . $oItem->get_max() . ");\n"; |
|
1881 | - $info .= "top.set_min(" . $oItem->get_min() . ");\n"; |
|
1882 | - $info .= "top.set_lesson_status('" . $oItem->get_status() . "');"; |
|
1883 | - $info .= "top.set_session_time('" . $oItem->get_scorm_time('js') . "');"; |
|
1884 | - $info .= "top.set_suspend_data('" . $oItem->get_suspend_data() . "');"; |
|
1885 | - $info .= "top.set_saved_lesson_status('" . $oItem->get_status() . "');"; |
|
1879 | + $info .= "top.set_score(".$oItem->get_score().");\n"; |
|
1880 | + $info .= "top.set_max(".$oItem->get_max().");\n"; |
|
1881 | + $info .= "top.set_min(".$oItem->get_min().");\n"; |
|
1882 | + $info .= "top.set_lesson_status('".$oItem->get_status()."');"; |
|
1883 | + $info .= "top.set_session_time('".$oItem->get_scorm_time('js')."');"; |
|
1884 | + $info .= "top.set_suspend_data('".$oItem->get_suspend_data()."');"; |
|
1885 | + $info .= "top.set_saved_lesson_status('".$oItem->get_status()."');"; |
|
1886 | 1886 | $info .= "top.set_flag_synchronized();"; |
1887 | 1887 | $info .= '</script>'; |
1888 | 1888 | if ($this->debug > 2) { |
1889 | - error_log('New LP - in learnpath::get_js_info(' . $item_id . ') - returning: ' . $info, 0); |
|
1889 | + error_log('New LP - in learnpath::get_js_info('.$item_id.') - returning: '.$info, 0); |
|
1890 | 1890 | } |
1891 | 1891 | return $info; |
1892 | 1892 | |
@@ -1894,17 +1894,17 @@ discard block |
||
1894 | 1894 | |
1895 | 1895 | // If item_id is empty, just update to default SCORM data. |
1896 | 1896 | $info .= '<script language="javascript">'; |
1897 | - $info .= "top.set_score(" . learnpathItem :: get_score() . ");\n"; |
|
1898 | - $info .= "top.set_max(" . learnpathItem :: get_max() . ");\n"; |
|
1899 | - $info .= "top.set_min(" . learnpathItem :: get_min() . ");\n"; |
|
1900 | - $info .= "top.set_lesson_status('" . learnpathItem :: get_status() . "');"; |
|
1901 | - $info .= "top.set_session_time('" . learnpathItem :: getScormTimeFromParameter('js') . "');"; |
|
1902 | - $info .= "top.set_suspend_data('" . learnpathItem :: get_suspend_data() . "');"; |
|
1903 | - $info .= "top.set_saved_lesson_status('" . learnpathItem :: get_status() . "');"; |
|
1897 | + $info .= "top.set_score(".learnpathItem :: get_score().");\n"; |
|
1898 | + $info .= "top.set_max(".learnpathItem :: get_max().");\n"; |
|
1899 | + $info .= "top.set_min(".learnpathItem :: get_min().");\n"; |
|
1900 | + $info .= "top.set_lesson_status('".learnpathItem :: get_status()."');"; |
|
1901 | + $info .= "top.set_session_time('".learnpathItem :: getScormTimeFromParameter('js')."');"; |
|
1902 | + $info .= "top.set_suspend_data('".learnpathItem :: get_suspend_data()."');"; |
|
1903 | + $info .= "top.set_saved_lesson_status('".learnpathItem :: get_status()."');"; |
|
1904 | 1904 | $info .= "top.set_flag_synchronized();"; |
1905 | 1905 | $info .= '</script>'; |
1906 | 1906 | if ($this->debug > 2) { |
1907 | - error_log('New LP - in learnpath::get_js_info(' . $item_id . ') - returning: ' . $info, 0); |
|
1907 | + error_log('New LP - in learnpath::get_js_info('.$item_id.') - returning: '.$info, 0); |
|
1908 | 1908 | } |
1909 | 1909 | return $info; |
1910 | 1910 | } |
@@ -1958,12 +1958,12 @@ discard block |
||
1958 | 1958 | * Gets the navigation bar for the learnpath display screen |
1959 | 1959 | * @return string The HTML string to use as a navigation bar |
1960 | 1960 | */ |
1961 | - public function get_navigation_bar($idBar = null, $display=null) { |
|
1961 | + public function get_navigation_bar($idBar = null, $display = null) { |
|
1962 | 1962 | if ($this->debug > 0) { |
1963 | 1963 | error_log('New LP - In learnpath::get_navigation_bar()', 0); |
1964 | 1964 | } |
1965 | - if(empty($idBar)){ |
|
1966 | - $idBar='control-top'; |
|
1965 | + if (empty($idBar)) { |
|
1966 | + $idBar = 'control-top'; |
|
1967 | 1967 | } |
1968 | 1968 | /* if(empty($display)){ |
1969 | 1969 | $display='display:block'; |
@@ -1976,16 +1976,16 @@ discard block |
||
1976 | 1976 | $navbar = ' |
1977 | 1977 | <span id="'.$idBar.'" class="buttons"> |
1978 | 1978 | <a class="icon-toolbar" href="lp_controller.php?action=stats&'.api_get_cidreq(true).'&lp_id='.$lp_id.'" onclick="window.parent.API.save_asset();return true;" target="content_name" title="stats" id="stats_link"> |
1979 | - <span class="fa fa-info"></span><span class="sr-only">' . get_lang('Reporting') . '</span> |
|
1979 | + <span class="fa fa-info"></span><span class="sr-only">' . get_lang('Reporting').'</span> |
|
1980 | 1980 | </a> |
1981 | - <a class="icon-toolbar" id="scorm-previous" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'previous\');return false;" title="previous"> |
|
1982 | - <span class="fa fa-chevron-left"></span><span class="sr-only">' . get_lang('ScormPrevious') . '</span> |
|
1981 | + <a class="icon-toolbar" id="scorm-previous" href="#" onclick="switch_item(' . $mycurrentitemid.',\'previous\');return false;" title="previous"> |
|
1982 | + <span class="fa fa-chevron-left"></span><span class="sr-only">' . get_lang('ScormPrevious').'</span> |
|
1983 | 1983 | </a> |
1984 | - <a class="icon-toolbar" id="scorm-next" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'next\');return false;" title="next"> |
|
1985 | - <span class="fa fa-chevron-right"></span><span class="sr-only">' . get_lang('ScormNext') . '</span> |
|
1984 | + <a class="icon-toolbar" id="scorm-next" href="#" onclick="switch_item(' . $mycurrentitemid.',\'next\');return false;" title="next"> |
|
1985 | + <span class="fa fa-chevron-right"></span><span class="sr-only">' . get_lang('ScormNext').'</span> |
|
1986 | 1986 | </a> |
1987 | 1987 | <a class="icon-toolbar" id="view-embedded" href="lp_controller.php?action=mode&mode=embedded" target="_top" title="embedded mode"> |
1988 | - <span class="fa fa-columns"></span><span class="sr-only">' . get_lang('ScormExitFullScreen') . '</span> |
|
1988 | + <span class="fa fa-columns"></span><span class="sr-only">' . get_lang('ScormExitFullScreen').'</span> |
|
1989 | 1989 | </a> |
1990 | 1990 | </span>'; |
1991 | 1991 | |
@@ -1993,13 +1993,13 @@ discard block |
||
1993 | 1993 | $navbar = ' |
1994 | 1994 | <span id="'.$idBar.'" class="buttons text-right"> |
1995 | 1995 | <a class="icon-toolbar" href="lp_controller.php?action=stats&'.api_get_cidreq(true).'&lp_id='.$lp_id.'" onclick="window.parent.API.save_asset();return true;" target="content_name" title="stats" id="stats_link"> |
1996 | - <span class="fa fa-info"></span><span class="sr-only">' . get_lang('Reporting') . '</span> |
|
1996 | + <span class="fa fa-info"></span><span class="sr-only">' . get_lang('Reporting').'</span> |
|
1997 | 1997 | </a> |
1998 | - <a class="icon-toolbar" id="scorm-previous" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'previous\');return false;" title="previous"> |
|
1999 | - <span class="fa fa-chevron-left"></span><span class="sr-only">' . get_lang('ScormPrevious') . '</span> |
|
1998 | + <a class="icon-toolbar" id="scorm-previous" href="#" onclick="switch_item(' . $mycurrentitemid.',\'previous\');return false;" title="previous"> |
|
1999 | + <span class="fa fa-chevron-left"></span><span class="sr-only">' . get_lang('ScormPrevious').'</span> |
|
2000 | 2000 | </a> |
2001 | - <a class="icon-toolbar" id="scorm-next" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'next\');return false;" title="next"> |
|
2002 | - <span class="fa fa-chevron-right"></span><span class="sr-only">' . get_lang('ScormNext') . '</span> |
|
2001 | + <a class="icon-toolbar" id="scorm-next" href="#" onclick="switch_item(' . $mycurrentitemid.',\'next\');return false;" title="next"> |
|
2002 | + <span class="fa fa-chevron-right"></span><span class="sr-only">' . get_lang('ScormNext').'</span> |
|
2003 | 2003 | </a> |
2004 | 2004 | </span>'; |
2005 | 2005 | } |
@@ -2020,11 +2020,11 @@ discard block |
||
2020 | 2020 | $index = $this->index; |
2021 | 2021 | $index++; |
2022 | 2022 | if ($this->debug > 2) { |
2023 | - error_log('New LP - Now looking at ordered_items[' . ($index) . '] - type is ' . $this->items[$this->ordered_items[$index]]->type, 0); |
|
2023 | + error_log('New LP - Now looking at ordered_items['.($index).'] - type is '.$this->items[$this->ordered_items[$index]]->type, 0); |
|
2024 | 2024 | } |
2025 | 2025 | while (!empty ($this->ordered_items[$index]) AND ($this->items[$this->ordered_items[$index]]->get_type() == 'dir' || $this->items[$this->ordered_items[$index]]->get_type() == 'dokeos_chapter') AND $index < $this->max_ordered_items) { |
2026 | 2026 | $index++; |
2027 | - if ($index == $this->max_ordered_items){ |
|
2027 | + if ($index == $this->max_ordered_items) { |
|
2028 | 2028 | if ($this->items[$this->ordered_items[$index]]->get_type() == 'dir' || $this->items[$this->ordered_items[$index]]->get_type() == 'dokeos_chapter') { |
2029 | 2029 | return $this->index; |
2030 | 2030 | } else { |
@@ -2036,7 +2036,7 @@ discard block |
||
2036 | 2036 | return $this->index; |
2037 | 2037 | } |
2038 | 2038 | if ($this->debug > 2) { |
2039 | - error_log('New LP - index is now ' . $index, 0); |
|
2039 | + error_log('New LP - index is now '.$index, 0); |
|
2040 | 2040 | } |
2041 | 2041 | return $index; |
2042 | 2042 | } |
@@ -2054,7 +2054,7 @@ discard block |
||
2054 | 2054 | if (!empty ($new_index)) { |
2055 | 2055 | if (isset ($this->ordered_items[$new_index])) { |
2056 | 2056 | if ($this->debug > 2) { |
2057 | - error_log('New LP - In learnpath::get_next_index() - Returning ' . $this->ordered_items[$new_index], 0); |
|
2057 | + error_log('New LP - In learnpath::get_next_index() - Returning '.$this->ordered_items[$new_index], 0); |
|
2058 | 2058 | } |
2059 | 2059 | return $this->ordered_items[$new_index]; |
2060 | 2060 | } |
@@ -2096,7 +2096,7 @@ discard block |
||
2096 | 2096 | } |
2097 | 2097 | |
2098 | 2098 | // Filename without its extension. |
2099 | - $file_base_name = str_replace('.' . $extension, '', $filename); |
|
2099 | + $file_base_name = str_replace('.'.$extension, '', $filename); |
|
2100 | 2100 | |
2101 | 2101 | $zipFile = new PclZip($file_path); |
2102 | 2102 | // Check the zip content (real size and file extension). |
@@ -2120,7 +2120,7 @@ discard block |
||
2120 | 2120 | break; // Exit the foreach loop. |
2121 | 2121 | } elseif ( |
2122 | 2122 | preg_match('/aicc\//i', $thisContent['filename']) || |
2123 | - in_array(strtolower(pathinfo($thisContent['filename'], PATHINFO_EXTENSION)), array( 'crs','au','des','cst')) |
|
2123 | + in_array(strtolower(pathinfo($thisContent['filename'], PATHINFO_EXTENSION)), array('crs', 'au', 'des', 'cst')) |
|
2124 | 2124 | ) { |
2125 | 2125 | $ext = strtolower(pathinfo($thisContent['filename'], PATHINFO_EXTENSION)); |
2126 | 2126 | switch ($ext) { |
@@ -2162,7 +2162,7 @@ discard block |
||
2162 | 2162 | error_log('New LP - In learnpath::get_previous_index()', 0); |
2163 | 2163 | } |
2164 | 2164 | $index = $this->index; |
2165 | - if (isset ($this->ordered_items[$index -1])) { |
|
2165 | + if (isset ($this->ordered_items[$index - 1])) { |
|
2166 | 2166 | $index--; |
2167 | 2167 | while (isset($this->ordered_items[$index]) && ($this->items[$this->ordered_items[$index]]->get_type() == 'dir' || $this->items[$this->ordered_items[$index]]->get_type() == 'dokeos_chapter')) { |
2168 | 2168 | $index--; |
@@ -2172,7 +2172,7 @@ discard block |
||
2172 | 2172 | } |
2173 | 2173 | } else { |
2174 | 2174 | if ($this->debug > 2) { |
2175 | - error_log('New LP - get_previous_index() - there was no previous index available, reusing ' . $index, 0); |
|
2175 | + error_log('New LP - get_previous_index() - there was no previous index available, reusing '.$index, 0); |
|
2176 | 2176 | } |
2177 | 2177 | // There is no previous item. |
2178 | 2178 | } |
@@ -2215,8 +2215,8 @@ discard block |
||
2215 | 2215 | { |
2216 | 2216 | $course_id = api_get_course_int_id(); |
2217 | 2217 | $_course = api_get_course_info(); |
2218 | - $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
|
2219 | - $tbl_lp_item_view = Database :: get_course_table(TABLE_LP_ITEM_VIEW); |
|
2218 | + $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
|
2219 | + $tbl_lp_item_view = Database :: get_course_table(TABLE_LP_ITEM_VIEW); |
|
2220 | 2220 | |
2221 | 2221 | // Getting all the information about the item. |
2222 | 2222 | $sql = "SELECT * FROM ".$tbl_lp_item." as lp |
@@ -2227,7 +2227,7 @@ discard block |
||
2227 | 2227 | lp.c_id = $course_id AND |
2228 | 2228 | lp_view.c_id = $course_id"; |
2229 | 2229 | $result = Database::query($sql); |
2230 | - $row = Database::fetch_assoc($result); |
|
2230 | + $row = Database::fetch_assoc($result); |
|
2231 | 2231 | $output = ''; |
2232 | 2232 | |
2233 | 2233 | if (!empty ($row['audio'])) { |
@@ -2235,8 +2235,8 @@ discard block |
||
2235 | 2235 | $list = $_SESSION['oLP']->get_toc(); |
2236 | 2236 | $type_quiz = false; |
2237 | 2237 | |
2238 | - foreach($list as $toc) { |
|
2239 | - if ($toc['id'] == $_SESSION['oLP']->current && ($toc['type']=='quiz') ) { |
|
2238 | + foreach ($list as $toc) { |
|
2239 | + if ($toc['id'] == $_SESSION['oLP']->current && ($toc['type'] == 'quiz')) { |
|
2240 | 2240 | $type_quiz = true; |
2241 | 2241 | } |
2242 | 2242 | } |
@@ -2299,7 +2299,7 @@ discard block |
||
2299 | 2299 | $courseCode = null, |
2300 | 2300 | $sessionId = null |
2301 | 2301 | ) { |
2302 | - $lp_id = (int)$lp_id; |
|
2302 | + $lp_id = (int) $lp_id; |
|
2303 | 2303 | $courseInfo = api_get_course_info($courseCode); |
2304 | 2304 | $sessionId = intval($sessionId); |
2305 | 2305 | |
@@ -2465,10 +2465,10 @@ discard block |
||
2465 | 2465 | */ |
2466 | 2466 | public static function get_progress_bar($percentage = -1, $text_add = '') |
2467 | 2467 | { |
2468 | - $text = $percentage . $text_add; |
|
2468 | + $text = $percentage.$text_add; |
|
2469 | 2469 | $output = '<div class="progress"> |
2470 | - <div id="progress_bar_value" class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="' .$percentage. '" aria-valuemin="0" aria-valuemax="100" style="width: '.$text.';"> |
|
2471 | - '. $text .' |
|
2470 | + <div id="progress_bar_value" class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="' .$percentage.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$text.';"> |
|
2471 | + '. $text.' |
|
2472 | 2472 | </div> |
2473 | 2473 | </div>'; |
2474 | 2474 | |
@@ -2504,16 +2504,16 @@ discard block |
||
2504 | 2504 | } |
2505 | 2505 | $total_items = $this->get_total_items_count_without_chapters(); |
2506 | 2506 | if ($this->debug > 2) { |
2507 | - error_log('New LP - Total items available in this learnpath: ' . $total_items, 0); |
|
2507 | + error_log('New LP - Total items available in this learnpath: '.$total_items, 0); |
|
2508 | 2508 | } |
2509 | 2509 | $completeItems = $this->get_complete_items_count(); |
2510 | 2510 | if ($this->debug > 2) { |
2511 | - error_log('New LP - Items completed so far: ' . $completeItems, 0); |
|
2511 | + error_log('New LP - Items completed so far: '.$completeItems, 0); |
|
2512 | 2512 | } |
2513 | 2513 | if ($add != 0) { |
2514 | 2514 | $completeItems += $add; |
2515 | 2515 | if ($this->debug > 2) { |
2516 | - error_log('New LP - Items completed so far (+modifier): ' . $completeItems, 0); |
|
2516 | + error_log('New LP - Items completed so far (+modifier): '.$completeItems, 0); |
|
2517 | 2517 | } |
2518 | 2518 | } |
2519 | 2519 | $text = ''; |
@@ -2531,7 +2531,7 @@ discard block |
||
2531 | 2531 | $text = '%'; |
2532 | 2532 | } elseif ($mode == 'abs') { |
2533 | 2533 | $percentage = $completeItems; |
2534 | - $text = '/' . $total_items; |
|
2534 | + $text = '/'.$total_items; |
|
2535 | 2535 | } |
2536 | 2536 | |
2537 | 2537 | return array( |
@@ -2727,7 +2727,7 @@ discard block |
||
2727 | 2727 | // and replace them, one by one, by the internal IDs (chamilo db) |
2728 | 2728 | // TODO: Modify the '*' replacement to replace the multiplier in front of it |
2729 | 2729 | // by a space as well. |
2730 | - $find = array ( |
|
2730 | + $find = array( |
|
2731 | 2731 | '&', |
2732 | 2732 | '|', |
2733 | 2733 | '~', |
@@ -2739,7 +2739,7 @@ discard block |
||
2739 | 2739 | '(', |
2740 | 2740 | ')' |
2741 | 2741 | ); |
2742 | - $replace = array ( |
|
2742 | + $replace = array( |
|
2743 | 2743 | ' ', |
2744 | 2744 | ' ', |
2745 | 2745 | ' ', |
@@ -2756,7 +2756,7 @@ discard block |
||
2756 | 2756 | foreach ($ids as $id) { |
2757 | 2757 | $id = trim($id); |
2758 | 2758 | if (isset ($this->refs_list[$id])) { |
2759 | - $prereq = preg_replace('/[^a-zA-Z_0-9](' . $id . ')[^a-zA-Z_0-9]/', 'ITEM_' . $this->refs_list[$id], $prereq); |
|
2759 | + $prereq = preg_replace('/[^a-zA-Z_0-9]('.$id.')[^a-zA-Z_0-9]/', 'ITEM_'.$this->refs_list[$id], $prereq); |
|
2760 | 2760 | } |
2761 | 2761 | } |
2762 | 2762 | |
@@ -2864,9 +2864,9 @@ discard block |
||
2864 | 2864 | if ($this->debug > 0) { |
2865 | 2865 | error_log('New LP - In learnpath::get_items_status_list()', 0); |
2866 | 2866 | } |
2867 | - $list = array (); |
|
2867 | + $list = array(); |
|
2868 | 2868 | foreach ($this->ordered_items as $item_id) { |
2869 | - $list[] = array ( |
|
2869 | + $list[] = array( |
|
2870 | 2870 | $item_id => $this->items[$item_id]->get_status() |
2871 | 2871 | ); |
2872 | 2872 | } |
@@ -2920,7 +2920,7 @@ discard block |
||
2920 | 2920 | $res = Database::query($sql); |
2921 | 2921 | $num = Database :: num_rows($res); |
2922 | 2922 | if ($num > 0) { |
2923 | - $list[] = array ( |
|
2923 | + $list[] = array( |
|
2924 | 2924 | 'order_id' => api_htmlentities(get_lang('Order'), ENT_QUOTES), |
2925 | 2925 | 'id' => api_htmlentities(get_lang('InteractionID'), ENT_QUOTES), |
2926 | 2926 | 'type' => api_htmlentities(get_lang('Type'), ENT_QUOTES), |
@@ -2931,7 +2931,7 @@ discard block |
||
2931 | 2931 | 'latency' => api_htmlentities(get_lang('LatencyTimeSpent'), ENT_QUOTES) |
2932 | 2932 | ); |
2933 | 2933 | while ($row = Database :: fetch_array($res)) { |
2934 | - $list[] = array ( |
|
2934 | + $list[] = array( |
|
2935 | 2935 | 'order_id' => ($row['order_id'] + 1), |
2936 | 2936 | 'id' => urldecode($row['interaction_id']), //urldecode because they often have %2F or stuff like that |
2937 | 2937 | 'type' => $row['interaction_type'], |
@@ -2999,7 +2999,7 @@ discard block |
||
2999 | 2999 | 'status' => api_htmlentities(get_lang('ObjectiveStatus'), ENT_QUOTES) |
3000 | 3000 | ); |
3001 | 3001 | while ($row = Database :: fetch_array($res)) { |
3002 | - $list[] = array ( |
|
3002 | + $list[] = array( |
|
3003 | 3003 | 'order_id' => ($row['order_id'] + 1), |
3004 | 3004 | 'objective_id' => urldecode($row['objective_id']), // urldecode() because they often have %2F or stuff like that. |
3005 | 3005 | 'score_raw' => $row['score_raw'], |
@@ -3026,10 +3026,10 @@ discard block |
||
3026 | 3026 | $toc = array(); |
3027 | 3027 | foreach ($this->ordered_items as $item_id) { |
3028 | 3028 | if ($this->debug > 2) { |
3029 | - error_log('learnpath::get_toc(): getting info for item ' . $item_id, 0); |
|
3029 | + error_log('learnpath::get_toc(): getting info for item '.$item_id, 0); |
|
3030 | 3030 | } |
3031 | 3031 | // TODO: Change this link generation and use new function instead. |
3032 | - $toc[] = array ( |
|
3032 | + $toc[] = array( |
|
3033 | 3033 | 'id' => $item_id, |
3034 | 3034 | 'title' => $this->items[$item_id]->get_title(), |
3035 | 3035 | 'status' => $this->items[$item_id]->get_status(), |
@@ -3040,7 +3040,7 @@ discard block |
||
3040 | 3040 | ); |
3041 | 3041 | } |
3042 | 3042 | if ($this->debug > 2) { |
3043 | - error_log('New LP - In learnpath::get_toc() - TOC array: ' . print_r($toc, true), 0); |
|
3043 | + error_log('New LP - In learnpath::get_toc() - TOC array: '.print_r($toc, true), 0); |
|
3044 | 3044 | } |
3045 | 3045 | return $toc; |
3046 | 3046 | } |
@@ -3057,10 +3057,10 @@ discard block |
||
3057 | 3057 | } |
3058 | 3058 | $toc = $varname.' = new Array();'; |
3059 | 3059 | foreach ($this->ordered_items as $item_id) { |
3060 | - $toc.= $varname."['i$item_id'] = '".$this->items[$item_id]->get_type()."';"; |
|
3060 | + $toc .= $varname."['i$item_id'] = '".$this->items[$item_id]->get_type()."';"; |
|
3061 | 3061 | } |
3062 | 3062 | if ($this->debug > 2) { |
3063 | - error_log('New LP - In learnpath::get_items_details_as_js() - TOC array: ' . print_r($toc, true), 0); |
|
3063 | + error_log('New LP - In learnpath::get_items_details_as_js() - TOC array: '.print_r($toc, true), 0); |
|
3064 | 3064 | } |
3065 | 3065 | return $toc; |
3066 | 3066 | } |
@@ -3084,7 +3084,7 @@ discard block |
||
3084 | 3084 | } |
3085 | 3085 | } |
3086 | 3086 | if ($this->debug > 2) { |
3087 | - error_log('New LP - In learnpath::get_type() - Returning ' . ($res ? $res : 'false'), 0); |
|
3087 | + error_log('New LP - In learnpath::get_type() - Returning '.($res ? $res : 'false'), 0); |
|
3088 | 3088 | } |
3089 | 3089 | return $res; |
3090 | 3090 | } |
@@ -3100,7 +3100,7 @@ discard block |
||
3100 | 3100 | $tbl_lp = Database :: get_course_table(TABLE_LP_MAIN); |
3101 | 3101 | $lp_id = intval($lp_id); |
3102 | 3102 | $sql = "SELECT lp_type FROM $tbl_lp |
3103 | - WHERE c_id = $course_id AND id = '" . $lp_id . "'"; |
|
3103 | + WHERE c_id = $course_id AND id = '".$lp_id."'"; |
|
3104 | 3104 | $res = Database::query($sql); |
3105 | 3105 | if ($res === false) { |
3106 | 3106 | return null; |
@@ -3213,7 +3213,7 @@ discard block |
||
3213 | 3213 | $dirTypes = self::getChapterTypes(); |
3214 | 3214 | |
3215 | 3215 | if (in_array($item['type'], $dirTypes)) { |
3216 | - $scorm_color_background ='scorm_item_section '; |
|
3216 | + $scorm_color_background = 'scorm_item_section '; |
|
3217 | 3217 | $style_item = ''; |
3218 | 3218 | } |
3219 | 3219 | if ($item['id'] == $this->current) { |
@@ -3222,7 +3222,7 @@ discard block |
||
3222 | 3222 | $scorm_color_background = 'scorm_item_normal '.$scorm_color_background.' '; |
3223 | 3223 | } |
3224 | 3224 | |
3225 | - $html .= '<div id="toc_' . $item['id'] . '" class="' . $scorm_color_background . ' '.$class_name[$item['status']].' ">'; |
|
3225 | + $html .= '<div id="toc_'.$item['id'].'" class="'.$scorm_color_background.' '.$class_name[$item['status']].' ">'; |
|
3226 | 3226 | |
3227 | 3227 | // Learning path title |
3228 | 3228 | $title = $item['title']; |
@@ -3252,7 +3252,7 @@ discard block |
||
3252 | 3252 | $html .= stripslashes($title); |
3253 | 3253 | } else { |
3254 | 3254 | $this->get_link('http', $item['id'], $toc_list); |
3255 | - $html .= '<a class="items-list" href="#" onclick="switch_item(' .$mycurrentitemid . ',' .$item['id'] . ');' .'return false;" >' . stripslashes($title) . '</a>'; |
|
3255 | + $html .= '<a class="items-list" href="#" onclick="switch_item('.$mycurrentitemid.','.$item['id'].');'.'return false;" >'.stripslashes($title).'</a>'; |
|
3256 | 3256 | } |
3257 | 3257 | $html .= "</div>"; |
3258 | 3258 | |
@@ -3286,12 +3286,12 @@ discard block |
||
3286 | 3286 | if ($this->get_lp_session_id() == api_get_session_id()) { |
3287 | 3287 | $html .= '<div id="actions_lp" class="actions_lp"><hr>'; |
3288 | 3288 | $html .= '<div class="btn-group">'; |
3289 | - $html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?" . api_get_cidreq()."&gradebook=$gradebook&action=build&lp_id=" . $this->lp_id . "&isStudentView=false' target='_parent'>" . |
|
3290 | - Display::returnFontAwesomeIcon('street-view') . get_lang('Overview') . "</a>"; |
|
3291 | - $html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?" . api_get_cidreq()."&action=add_item&type=step&lp_id=" . $this->lp_id . "&isStudentView=false' target='_parent'>" . |
|
3292 | - Display::returnFontAwesomeIcon('pencil') . get_lang('Edit') . "</a>"; |
|
3293 | - $html .= '<a class="btn btn-sm btn-default" href="lp_controller.php?'.api_get_cidreq()."&gradebook=$gradebook&action=edit&lp_id=" . $this->lp_id.'&isStudentView=false">' . |
|
3294 | - Display::returnFontAwesomeIcon('cog') . get_lang('Settings').'</a>'; |
|
3289 | + $html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?".api_get_cidreq()."&gradebook=$gradebook&action=build&lp_id=".$this->lp_id."&isStudentView=false' target='_parent'>". |
|
3290 | + Display::returnFontAwesomeIcon('street-view').get_lang('Overview')."</a>"; |
|
3291 | + $html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?".api_get_cidreq()."&action=add_item&type=step&lp_id=".$this->lp_id."&isStudentView=false' target='_parent'>". |
|
3292 | + Display::returnFontAwesomeIcon('pencil').get_lang('Edit')."</a>"; |
|
3293 | + $html .= '<a class="btn btn-sm btn-default" href="lp_controller.php?'.api_get_cidreq()."&gradebook=$gradebook&action=edit&lp_id=".$this->lp_id.'&isStudentView=false">'. |
|
3294 | + Display::returnFontAwesomeIcon('cog').get_lang('Settings').'</a>'; |
|
3295 | 3295 | $html .= '</div>'; |
3296 | 3296 | $html .= '</div>'; |
3297 | 3297 | } |
@@ -3342,11 +3342,11 @@ discard block |
||
3342 | 3342 | $course_id = $this->get_course_int_id(); |
3343 | 3343 | |
3344 | 3344 | if ($this->debug > 0) { |
3345 | - error_log('New LP - In learnpath::get_link(' . $type . ',' . $item_id . ')', 0); |
|
3345 | + error_log('New LP - In learnpath::get_link('.$type.','.$item_id.')', 0); |
|
3346 | 3346 | } |
3347 | 3347 | if (empty($item_id)) { |
3348 | 3348 | if ($this->debug > 2) { |
3349 | - error_log('New LP - In learnpath::get_link() - no item id given in learnpath::get_link(), using current: ' . $this->get_current_item_id(), 0); |
|
3349 | + error_log('New LP - In learnpath::get_link() - no item id given in learnpath::get_link(), using current: '.$this->get_current_item_id(), 0); |
|
3350 | 3350 | } |
3351 | 3351 | $item_id = $this->get_current_item_id(); |
3352 | 3352 | } |
@@ -3378,7 +3378,7 @@ discard block |
||
3378 | 3378 | ON (li.lp_id = l.id AND l.c_id = $course_id AND li.c_id = $course_id ) |
3379 | 3379 | WHERE li.id = $item_id "; |
3380 | 3380 | if ($this->debug > 2) { |
3381 | - error_log('New LP - In learnpath::get_link() - selecting item ' . $sql, 0); |
|
3381 | + error_log('New LP - In learnpath::get_link() - selecting item '.$sql, 0); |
|
3382 | 3382 | } |
3383 | 3383 | $res = Database::query($sql); |
3384 | 3384 | if (Database :: num_rows($res) > 0) { |
@@ -3392,9 +3392,9 @@ discard block |
||
3392 | 3392 | if (empty($lp_item_params) && strpos($lp_item_path, '?') !== false) { |
3393 | 3393 | list($lp_item_path, $lp_item_params) = explode('?', $lp_item_path); |
3394 | 3394 | } |
3395 | - $sys_course_path = api_get_path(SYS_COURSE_PATH) . api_get_course_path(); |
|
3395 | + $sys_course_path = api_get_path(SYS_COURSE_PATH).api_get_course_path(); |
|
3396 | 3396 | if ($type == 'http') { |
3397 | - $course_path = api_get_path(WEB_COURSE_PATH) . api_get_course_path(); //web path |
|
3397 | + $course_path = api_get_path(WEB_COURSE_PATH).api_get_course_path(); //web path |
|
3398 | 3398 | } else { |
3399 | 3399 | $course_path = $sys_course_path; //system path |
3400 | 3400 | } |
@@ -3405,8 +3405,8 @@ discard block |
||
3405 | 3405 | } |
3406 | 3406 | |
3407 | 3407 | if ($this->debug > 2) { |
3408 | - error_log('New LP - In learnpath::get_link() - $lp_type ' . $lp_type, 0); |
|
3409 | - error_log('New LP - In learnpath::get_link() - $lp_item_type ' . $lp_item_type, 0); |
|
3408 | + error_log('New LP - In learnpath::get_link() - $lp_type '.$lp_type, 0); |
|
3409 | + error_log('New LP - In learnpath::get_link() - $lp_item_type '.$lp_item_type, 0); |
|
3410 | 3410 | } |
3411 | 3411 | |
3412 | 3412 | // Now go through the specific cases to get the end of the path |
@@ -3425,7 +3425,7 @@ discard block |
||
3425 | 3425 | ); |
3426 | 3426 | |
3427 | 3427 | if ($this->debug > 0) { |
3428 | - error_log('rl_get_resource_link_for_learnpath - file: ' . $file, 0); |
|
3428 | + error_log('rl_get_resource_link_for_learnpath - file: '.$file, 0); |
|
3429 | 3429 | } |
3430 | 3430 | |
3431 | 3431 | if ($lp_item_type == 'link') { |
@@ -3445,7 +3445,7 @@ discard block |
||
3445 | 3445 | $linkProtocol = substr($file, 0, 5); |
3446 | 3446 | if ($linkProtocol === 'http:') { |
3447 | 3447 | //this is the special intervention case |
3448 | - $file = api_get_path(WEB_CODE_PATH).'newscorm/embed.php?type=nonhttps&source=' . urlencode($file); |
|
3448 | + $file = api_get_path(WEB_CODE_PATH).'newscorm/embed.php?type=nonhttps&source='.urlencode($file); |
|
3449 | 3449 | } |
3450 | 3450 | } |
3451 | 3451 | } |
@@ -3485,8 +3485,8 @@ discard block |
||
3485 | 3485 | $sql = "SELECT count(*) FROM $lp_item_view_table |
3486 | 3486 | WHERE |
3487 | 3487 | c_id = $course_id AND |
3488 | - lp_item_id='" . $lp_item_id . "' AND |
|
3489 | - lp_view_id ='" . $lp_view_id . "' AND |
|
3488 | + lp_item_id='".$lp_item_id."' AND |
|
3489 | + lp_view_id ='" . $lp_view_id."' AND |
|
3490 | 3490 | status='completed'"; |
3491 | 3491 | $result = Database::query($sql); |
3492 | 3492 | $row_count = Database :: fetch_row($result); |
@@ -3495,7 +3495,7 @@ discard block |
||
3495 | 3495 | if ($prevent_reinit === 1 && $count_item_view > 0) { |
3496 | 3496 | $not_multiple_attempt = 1; |
3497 | 3497 | } |
3498 | - $file .= '¬_multiple_attempt=' . $not_multiple_attempt; |
|
3498 | + $file .= '¬_multiple_attempt='.$not_multiple_attempt; |
|
3499 | 3499 | } |
3500 | 3500 | |
3501 | 3501 | $tmp_array = explode('/', $file); |
@@ -3508,7 +3508,7 @@ discard block |
||
3508 | 3508 | break; |
3509 | 3509 | case 2 : |
3510 | 3510 | if ($this->debug > 2) { |
3511 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - Item type: ' . $lp_item_type, 0); |
|
3511 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - Item type: '.$lp_item_type, 0); |
|
3512 | 3512 | } |
3513 | 3513 | |
3514 | 3514 | if ($lp_item_type != 'dir') { |
@@ -3522,19 +3522,19 @@ discard block |
||
3522 | 3522 | //if ($this->prerequisites_match($item_id)) { |
3523 | 3523 | if (preg_match('#^[a-zA-Z]{2,5}://#', $lp_item_path) != 0) { |
3524 | 3524 | if ($this->debug > 2) { |
3525 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - Found match for protocol in ' . $lp_item_path, 0); |
|
3525 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - Found match for protocol in '.$lp_item_path, 0); |
|
3526 | 3526 | } |
3527 | 3527 | // Distant url, return as is. |
3528 | 3528 | $file = $lp_item_path; |
3529 | 3529 | } else { |
3530 | 3530 | if ($this->debug > 2) { |
3531 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - No starting protocol in ' . $lp_item_path, 0); |
|
3531 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - No starting protocol in '.$lp_item_path, 0); |
|
3532 | 3532 | } |
3533 | 3533 | // Prevent getting untranslatable urls. |
3534 | 3534 | $lp_item_path = preg_replace('/%2F/', '/', $lp_item_path); |
3535 | 3535 | $lp_item_path = preg_replace('/%3A/', ':', $lp_item_path); |
3536 | 3536 | // Prepare the path. |
3537 | - $file = $course_path . '/scorm/' . $lp_path . '/' . $lp_item_path; |
|
3537 | + $file = $course_path.'/scorm/'.$lp_path.'/'.$lp_item_path; |
|
3538 | 3538 | // TODO: Fix this for urls with protocol header. |
3539 | 3539 | $file = str_replace('//', '/', $file); |
3540 | 3540 | $file = str_replace(':/', '://', $file); |
@@ -3542,11 +3542,11 @@ discard block |
||
3542 | 3542 | $lp_path = substr($lp_path, 0, -1); |
3543 | 3543 | } |
3544 | 3544 | |
3545 | - if (!is_file(realpath($sys_course_path . '/scorm/' . $lp_path . '/' . $lp_item_path))) { |
|
3545 | + if (!is_file(realpath($sys_course_path.'/scorm/'.$lp_path.'/'.$lp_item_path))) { |
|
3546 | 3546 | // if file not found. |
3547 | 3547 | $decoded = html_entity_decode($lp_item_path); |
3548 | 3548 | list ($decoded) = explode('?', $decoded); |
3549 | - if (!is_file(realpath($sys_course_path . '/scorm/' . $lp_path . '/' . $decoded))) { |
|
3549 | + if (!is_file(realpath($sys_course_path.'/scorm/'.$lp_path.'/'.$decoded))) { |
|
3550 | 3550 | require_once 'resourcelinker.inc.php'; |
3551 | 3551 | $file = rl_get_resource_link_for_learnpath( |
3552 | 3552 | $course_id, |
@@ -3566,14 +3566,14 @@ discard block |
||
3566 | 3566 | } |
3567 | 3567 | } |
3568 | 3568 | } else { |
3569 | - $file = $course_path . '/scorm/' . $lp_path . '/' . $decoded; |
|
3569 | + $file = $course_path.'/scorm/'.$lp_path.'/'.$decoded; |
|
3570 | 3570 | } |
3571 | 3571 | } |
3572 | 3572 | } |
3573 | 3573 | |
3574 | 3574 | // We want to use parameters if they were defined in the imsmanifest |
3575 | 3575 | if (strpos($file, 'blank.php') === false) { |
3576 | - $file .= (strstr($file, '?') === false ? '?' : '') . $lp_item_params; |
|
3576 | + $file .= (strstr($file, '?') === false ? '?' : '').$lp_item_params; |
|
3577 | 3577 | } |
3578 | 3578 | } else { |
3579 | 3579 | $file = 'lp_content.php?type=dir'; |
@@ -3581,12 +3581,12 @@ discard block |
||
3581 | 3581 | break; |
3582 | 3582 | case 3 : |
3583 | 3583 | if ($this->debug > 2) { |
3584 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - Item type: ' . $lp_item_type, 0); |
|
3584 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - Item type: '.$lp_item_type, 0); |
|
3585 | 3585 | } |
3586 | 3586 | // Formatting AICC HACP append URL. |
3587 | - $aicc_append = '?aicc_sid=' . urlencode(session_id()) . '&aicc_url=' . urlencode(api_get_path(WEB_CODE_PATH) . 'newscorm/aicc_hacp.php') . '&'; |
|
3587 | + $aicc_append = '?aicc_sid='.urlencode(session_id()).'&aicc_url='.urlencode(api_get_path(WEB_CODE_PATH).'newscorm/aicc_hacp.php').'&'; |
|
3588 | 3588 | if (!empty($lp_item_params)) { |
3589 | - $aicc_append .= $lp_item_params . '&'; |
|
3589 | + $aicc_append .= $lp_item_params.'&'; |
|
3590 | 3590 | } |
3591 | 3591 | if ($lp_item_type != 'dir') { |
3592 | 3592 | // Quite complex here: |
@@ -3598,7 +3598,7 @@ discard block |
||
3598 | 3598 | |
3599 | 3599 | if (preg_match('#^[a-zA-Z]{2,5}://#', $lp_item_path) != 0) { |
3600 | 3600 | if ($this->debug > 2) { |
3601 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - Found match for protocol in ' . $lp_item_path, 0); |
|
3601 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - Found match for protocol in '.$lp_item_path, 0); |
|
3602 | 3602 | } |
3603 | 3603 | // Distant url, return as is. |
3604 | 3604 | $file = $lp_item_path; |
@@ -3611,19 +3611,19 @@ discard block |
||
3611 | 3611 | if (stripos($file, '<servername>') !== false) { |
3612 | 3612 | //$file = str_replace('<servername>',$course_path.'/scorm/'.$lp_path.'/',$lp_item_path); |
3613 | 3613 | $web_course_path = str_replace('https://', '', str_replace('http://', '', $course_path)); |
3614 | - $file = str_replace('<servername>', $web_course_path . '/scorm/' . $lp_path, $lp_item_path); |
|
3614 | + $file = str_replace('<servername>', $web_course_path.'/scorm/'.$lp_path, $lp_item_path); |
|
3615 | 3615 | } |
3616 | 3616 | // |
3617 | 3617 | $file .= $aicc_append; |
3618 | 3618 | } else { |
3619 | 3619 | if ($this->debug > 2) { |
3620 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - No starting protocol in ' . $lp_item_path, 0); |
|
3620 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - No starting protocol in '.$lp_item_path, 0); |
|
3621 | 3621 | } |
3622 | 3622 | // Prevent getting untranslatable urls. |
3623 | 3623 | $lp_item_path = preg_replace('/%2F/', '/', $lp_item_path); |
3624 | 3624 | $lp_item_path = preg_replace('/%3A/', ':', $lp_item_path); |
3625 | 3625 | // Prepare the path - lp_path might be unusable because it includes the "aicc" subdir name. |
3626 | - $file = $course_path . '/scorm/' . $lp_path . '/' . $lp_item_path; |
|
3626 | + $file = $course_path.'/scorm/'.$lp_path.'/'.$lp_item_path; |
|
3627 | 3627 | // TODO: Fix this for urls with protocol header. |
3628 | 3628 | $file = str_replace('//', '/', $file); |
3629 | 3629 | $file = str_replace(':/', '://', $file); |
@@ -3642,7 +3642,7 @@ discard block |
||
3642 | 3642 | $file = !empty($file) ? str_replace('&', '&', $file) : ''; |
3643 | 3643 | } |
3644 | 3644 | if ($this->debug > 2) { |
3645 | - error_log('New LP - In learnpath::get_link() - returning "' . $file . '" from get_link', 0); |
|
3645 | + error_log('New LP - In learnpath::get_link() - returning "'.$file.'" from get_link', 0); |
|
3646 | 3646 | } |
3647 | 3647 | return $file; |
3648 | 3648 | } |
@@ -3660,7 +3660,7 @@ discard block |
||
3660 | 3660 | $search = ''; |
3661 | 3661 | // Use $attempt_num to enable multi-views management (disabled so far). |
3662 | 3662 | if ($attempt_num != 0 AND intval(strval($attempt_num)) == $attempt_num) { |
3663 | - $search = 'AND view_count = ' . $attempt_num; |
|
3663 | + $search = 'AND view_count = '.$attempt_num; |
|
3664 | 3664 | } |
3665 | 3665 | // When missing $attempt_num, search for a unique lp_view record for this lp and user. |
3666 | 3666 | $lp_view_table = Database :: get_course_table(TABLE_LP_VIEW); |
@@ -3670,9 +3670,9 @@ discard block |
||
3670 | 3670 | |
3671 | 3671 | $sql = "SELECT id, view_count FROM $lp_view_table |
3672 | 3672 | WHERE |
3673 | - c_id = " . $course_id . " AND |
|
3674 | - lp_id = " . $this->get_id() . " AND |
|
3675 | - user_id = " . $this->get_user_id() . " AND |
|
3673 | + c_id = ".$course_id." AND |
|
3674 | + lp_id = " . $this->get_id()." AND |
|
3675 | + user_id = " . $this->get_user_id()." AND |
|
3676 | 3676 | session_id = $sessionId |
3677 | 3677 | $search |
3678 | 3678 | ORDER BY view_count DESC"; |
@@ -3683,7 +3683,7 @@ discard block |
||
3683 | 3683 | } else if (!api_is_invitee()) { |
3684 | 3684 | // There is no database record, create one. |
3685 | 3685 | $sql = "INSERT INTO $lp_view_table (c_id, lp_id,user_id, view_count, session_id) VALUES |
3686 | - ($course_id, " . $this->get_id() . "," . $this->get_user_id() . ", 1, $sessionId)"; |
|
3686 | + ($course_id, ".$this->get_id().",".$this->get_user_id().", 1, $sessionId)"; |
|
3687 | 3687 | Database::query($sql); |
3688 | 3688 | $id = Database :: insert_id(); |
3689 | 3689 | $this->lp_view_id = $id; |
@@ -3783,15 +3783,15 @@ discard block |
||
3783 | 3783 | { |
3784 | 3784 | $course_id = api_get_course_int_id(); |
3785 | 3785 | if ($this->debug > 0) { |
3786 | - error_log('New LP - In learnpath::move_item(' . $id . ',' . $direction . ')', 0); |
|
3786 | + error_log('New LP - In learnpath::move_item('.$id.','.$direction.')', 0); |
|
3787 | 3787 | } |
3788 | 3788 | if (empty($id) || empty($direction)) { |
3789 | 3789 | return false; |
3790 | 3790 | } |
3791 | 3791 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
3792 | 3792 | $sql_sel = "SELECT * |
3793 | - FROM " . $tbl_lp_item . " |
|
3794 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
3793 | + FROM " . $tbl_lp_item." |
|
3794 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
3795 | 3795 | $res_sel = Database::query($sql_sel); |
3796 | 3796 | // Check if elem exists. |
3797 | 3797 | if (Database :: num_rows($res_sel) < 1) { |
@@ -3816,7 +3816,7 @@ discard block |
||
3816 | 3816 | WHERE c_id = ".$course_id." AND id = $previous"; |
3817 | 3817 | |
3818 | 3818 | if ($this->debug > 2) { |
3819 | - error_log('Selecting previous: ' . $sql_sel2, 0); |
|
3819 | + error_log('Selecting previous: '.$sql_sel2, 0); |
|
3820 | 3820 | } |
3821 | 3821 | $res_sel2 = Database::query($sql_sel2); |
3822 | 3822 | if (Database :: num_rows($res_sel2) < 1) { |
@@ -3869,7 +3869,7 @@ discard block |
||
3869 | 3869 | } |
3870 | 3870 | Database::query($sql_upd2); |
3871 | 3871 | } |
3872 | - $display = $display -1; |
|
3872 | + $display = $display - 1; |
|
3873 | 3873 | } |
3874 | 3874 | break; |
3875 | 3875 | case 'down': |
@@ -3880,7 +3880,7 @@ discard block |
||
3880 | 3880 | } else { |
3881 | 3881 | $sql_sel2 = "SELECT * FROM $tbl_lp_item WHERE c_id = ".$course_id." AND id = $next"; |
3882 | 3882 | if ($this->debug > 2) { |
3883 | - error_log('Selecting next: ' . $sql_sel2, 0); |
|
3883 | + error_log('Selecting next: '.$sql_sel2, 0); |
|
3884 | 3884 | } |
3885 | 3885 | $res_sel2 = Database::query($sql_sel2); |
3886 | 3886 | if (Database :: num_rows($res_sel2) < 1) { |
@@ -3918,7 +3918,7 @@ discard block |
||
3918 | 3918 | WHERE c_id = ".$course_id." AND id = $next_next"; |
3919 | 3919 | Database::query($sql_upd2); |
3920 | 3920 | } |
3921 | - $display = $display +1; |
|
3921 | + $display = $display + 1; |
|
3922 | 3922 | } |
3923 | 3923 | break; |
3924 | 3924 | default : |
@@ -3941,8 +3941,8 @@ discard block |
||
3941 | 3941 | $res = Database::query($sql); |
3942 | 3942 | if ($res === false) |
3943 | 3943 | return false; |
3944 | - $lps = array (); |
|
3945 | - $lp_order = array (); |
|
3944 | + $lps = array(); |
|
3945 | + $lp_order = array(); |
|
3946 | 3946 | $num = Database :: num_rows($res); |
3947 | 3947 | // First check the order is correct, globally (might be wrong because |
3948 | 3948 | // of versions < 1.8.4) |
@@ -3952,7 +3952,7 @@ discard block |
||
3952 | 3952 | if ($row['display_order'] != $i) { // If we find a gap in the order, we need to fix it. |
3953 | 3953 | $need_fix = true; |
3954 | 3954 | $sql_u = "UPDATE $lp_table SET display_order = $i |
3955 | - WHERE c_id = ".$course_id." AND id = " . $row['id']; |
|
3955 | + WHERE c_id = ".$course_id." AND id = ".$row['id']; |
|
3956 | 3956 | Database::query($sql_u); |
3957 | 3957 | } |
3958 | 3958 | $row['display_order'] = $i; |
@@ -3965,10 +3965,10 @@ discard block |
||
3965 | 3965 | $order = $lps[$lp_id]['display_order']; |
3966 | 3966 | if ($order > 1) { // If it's the first element, no need to move up. |
3967 | 3967 | $sql_u1 = "UPDATE $lp_table SET display_order = $order |
3968 | - WHERE c_id = ".$course_id." AND id = " . $lp_order[$order - 1]; |
|
3968 | + WHERE c_id = ".$course_id." AND id = ".$lp_order[$order - 1]; |
|
3969 | 3969 | Database::query($sql_u1); |
3970 | - $sql_u2 = "UPDATE $lp_table SET display_order = " . ($order - 1) . " |
|
3971 | - WHERE c_id = ".$course_id." AND id = " . $lp_id; |
|
3970 | + $sql_u2 = "UPDATE $lp_table SET display_order = ".($order - 1)." |
|
3971 | + WHERE c_id = ".$course_id." AND id = ".$lp_id; |
|
3972 | 3972 | Database::query($sql_u2); |
3973 | 3973 | } |
3974 | 3974 | } |
@@ -3989,8 +3989,8 @@ discard block |
||
3989 | 3989 | if ($res === false) { |
3990 | 3990 | return false; |
3991 | 3991 | } |
3992 | - $lps = array (); |
|
3993 | - $lp_order = array (); |
|
3992 | + $lps = array(); |
|
3993 | + $lp_order = array(); |
|
3994 | 3994 | $num = Database :: num_rows($res); |
3995 | 3995 | $max = 0; |
3996 | 3996 | // First check the order is correct, globally (might be wrong because |
@@ -4002,7 +4002,7 @@ discard block |
||
4002 | 4002 | if ($row['display_order'] != $i) { // If we find a gap in the order, we need to fix it. |
4003 | 4003 | $need_fix = true; |
4004 | 4004 | $sql_u = "UPDATE $lp_table SET display_order = $i |
4005 | - WHERE c_id = ".$course_id." AND id = " . $row['id']; |
|
4005 | + WHERE c_id = ".$course_id." AND id = ".$row['id']; |
|
4006 | 4006 | Database::query($sql_u); |
4007 | 4007 | } |
4008 | 4008 | $row['display_order'] = $i; |
@@ -4015,10 +4015,10 @@ discard block |
||
4015 | 4015 | $order = $lps[$lp_id]['display_order']; |
4016 | 4016 | if ($order < $max) { // If it's the first element, no need to move up. |
4017 | 4017 | $sql_u1 = "UPDATE $lp_table SET display_order = $order |
4018 | - WHERE c_id = ".$course_id." AND id = " . $lp_order[$order + 1]; |
|
4018 | + WHERE c_id = ".$course_id." AND id = ".$lp_order[$order + 1]; |
|
4019 | 4019 | Database::query($sql_u1); |
4020 | - $sql_u2 = "UPDATE $lp_table SET display_order = " . ($order + 1) . " |
|
4021 | - WHERE c_id = ".$course_id." AND id = " . $lp_id; |
|
4020 | + $sql_u2 = "UPDATE $lp_table SET display_order = ".($order + 1)." |
|
4021 | + WHERE c_id = ".$course_id." AND id = ".$lp_id; |
|
4022 | 4022 | Database::query($sql_u2); |
4023 | 4023 | } |
4024 | 4024 | } |
@@ -4038,15 +4038,15 @@ discard block |
||
4038 | 4038 | $this->autocomplete_parents($this->last); |
4039 | 4039 | $new_index = $this->get_next_index(); |
4040 | 4040 | if ($this->debug > 2) { |
4041 | - error_log('New LP - New index: ' . $new_index, 0); |
|
4041 | + error_log('New LP - New index: '.$new_index, 0); |
|
4042 | 4042 | } |
4043 | 4043 | $this->index = $new_index; |
4044 | 4044 | if ($this->debug > 2) { |
4045 | - error_log('New LP - Now having orderedlist[' . $new_index . '] = ' . $this->ordered_items[$new_index], 0); |
|
4045 | + error_log('New LP - Now having orderedlist['.$new_index.'] = '.$this->ordered_items[$new_index], 0); |
|
4046 | 4046 | } |
4047 | 4047 | $this->current = $this->ordered_items[$new_index]; |
4048 | 4048 | if ($this->debug > 2) { |
4049 | - error_log('New LP - new item id is ' . $this->current . '-' . $this->get_current_item_id(), 0); |
|
4049 | + error_log('New LP - new item id is '.$this->current.'-'.$this->get_current_item_id(), 0); |
|
4050 | 4050 | } |
4051 | 4051 | } |
4052 | 4052 | |
@@ -4110,7 +4110,7 @@ discard block |
||
4110 | 4110 | // Clean spaces. |
4111 | 4111 | $prereq_string = str_replace(' ', '', $prereq_string); |
4112 | 4112 | if ($debug > 0) { |
4113 | - error_log('Found prereq_string: ' . $prereq_string, 0); |
|
4113 | + error_log('Found prereq_string: '.$prereq_string, 0); |
|
4114 | 4114 | } |
4115 | 4115 | // Now send to the parse_prereq() function that will check this component's prerequisites. |
4116 | 4116 | $result = $currentItem->parse_prereq( |
@@ -4126,12 +4126,12 @@ discard block |
||
4126 | 4126 | } else { |
4127 | 4127 | $result = true; |
4128 | 4128 | if ($debug > 1) { |
4129 | - error_log('$this->items[' . $itemId . '] was not an object', 0); |
|
4129 | + error_log('$this->items['.$itemId.'] was not an object', 0); |
|
4130 | 4130 | } |
4131 | 4131 | } |
4132 | 4132 | |
4133 | 4133 | if ($debug > 1) { |
4134 | - error_log('End of prerequisites_match(). Error message is now ' . $this->error, 0); |
|
4134 | + error_log('End of prerequisites_match(). Error message is now '.$this->error, 0); |
|
4135 | 4135 | } |
4136 | 4136 | return $result; |
4137 | 4137 | } |
@@ -4197,12 +4197,12 @@ discard block |
||
4197 | 4197 | $row = Database :: fetch_array($result); |
4198 | 4198 | $name = domesticate($row['name']); |
4199 | 4199 | if ($set_visibility == 'i') { |
4200 | - $s = $name . " " . get_lang('LearnpathNotPublished'); |
|
4200 | + $s = $name." ".get_lang('LearnpathNotPublished'); |
|
4201 | 4201 | $dialogBox = $s; |
4202 | 4202 | $v = 0; |
4203 | 4203 | } |
4204 | 4204 | if ($set_visibility == 'v') { |
4205 | - $s = $name . " " . get_lang('LearnpathPublished'); |
|
4205 | + $s = $name." ".get_lang('LearnpathPublished'); |
|
4206 | 4206 | $dialogBox = $s; |
4207 | 4207 | $v = 1; |
4208 | 4208 | } |
@@ -4285,9 +4285,9 @@ discard block |
||
4285 | 4285 | $course_id = api_get_course_int_id(); |
4286 | 4286 | $lp_view_table = Database :: get_course_table(TABLE_LP_VIEW); |
4287 | 4287 | $sql = "INSERT INTO $lp_view_table (c_id, lp_id, user_id, view_count, session_id) |
4288 | - VALUES ($course_id, " . $this->lp_id . "," . $this->get_user_id() . "," . ($this->attempt + 1) . ", $session_id)"; |
|
4288 | + VALUES ($course_id, ".$this->lp_id.",".$this->get_user_id().",".($this->attempt + 1).", $session_id)"; |
|
4289 | 4289 | if ($this->debug > 2) { |
4290 | - error_log('New LP - Inserting new lp_view for restart: ' . $sql, 0); |
|
4290 | + error_log('New LP - Inserting new lp_view for restart: '.$sql, 0); |
|
4291 | 4291 | } |
4292 | 4292 | $res = Database::query($sql); |
4293 | 4293 | $view_id = Database::insert_id(); |
@@ -4325,10 +4325,10 @@ discard block |
||
4325 | 4325 | // TODO: Do a better check on the index pointing to the right item (it is supposed to be working |
4326 | 4326 | // on $ordered_items[] but not sure it's always safe to use with $items[]). |
4327 | 4327 | if ($this->debug > 2) { |
4328 | - error_log('New LP - save_current() saving item ' . $this->current, 0); |
|
4328 | + error_log('New LP - save_current() saving item '.$this->current, 0); |
|
4329 | 4329 | } |
4330 | 4330 | if ($this->debug > 2) { |
4331 | - error_log('' . print_r($this->items, true), 0); |
|
4331 | + error_log(''.print_r($this->items, true), 0); |
|
4332 | 4332 | } |
4333 | 4333 | if (isset($this->items[$this->current]) && |
4334 | 4334 | is_object($this->items[$this->current]) |
@@ -4352,7 +4352,7 @@ discard block |
||
4352 | 4352 | { |
4353 | 4353 | $debug = $this->debug; |
4354 | 4354 | if ($debug) { |
4355 | - error_log('In learnpath::save_item(' . $item_id . ',' . intval($from_outside). ')', 0); |
|
4355 | + error_log('In learnpath::save_item('.$item_id.','.intval($from_outside).')', 0); |
|
4356 | 4356 | } |
4357 | 4357 | // TODO: Do a better check on the index pointing to the right item (it is supposed to be working |
4358 | 4358 | // on $ordered_items[] but not sure it's always safe to use with $items[]). |
@@ -4375,7 +4375,7 @@ discard block |
||
4375 | 4375 | |
4376 | 4376 | if ($debug) { |
4377 | 4377 | error_log('update_queue before:'); |
4378 | - error_log(print_r($this->update_queue,1)); |
|
4378 | + error_log(print_r($this->update_queue, 1)); |
|
4379 | 4379 | } |
4380 | 4380 | $this->autocomplete_parents($item_id); |
4381 | 4381 | |
@@ -4383,9 +4383,9 @@ discard block |
||
4383 | 4383 | $this->update_queue[$item_id] = $status; |
4384 | 4384 | |
4385 | 4385 | if ($debug) { |
4386 | - error_log('get_status(): ' . $status); |
|
4386 | + error_log('get_status(): '.$status); |
|
4387 | 4387 | error_log('update_queue after:'); |
4388 | - error_log(print_r($this->update_queue,1)); |
|
4388 | + error_log(print_r($this->update_queue, 1)); |
|
4389 | 4389 | } |
4390 | 4390 | return $res; |
4391 | 4391 | } |
@@ -4406,17 +4406,17 @@ discard block |
||
4406 | 4406 | |
4407 | 4407 | if (isset($this->current) && !api_is_invitee()) { |
4408 | 4408 | if ($this->debug > 2) { |
4409 | - error_log('New LP - Saving current item (' . $this->current . ') for later review', 0); |
|
4409 | + error_log('New LP - Saving current item ('.$this->current.') for later review', 0); |
|
4410 | 4410 | } |
4411 | 4411 | $sql = "UPDATE $table SET |
4412 | - last_item = " . intval($this->get_current_item_id()). " |
|
4412 | + last_item = ".intval($this->get_current_item_id())." |
|
4413 | 4413 | WHERE |
4414 | 4414 | c_id = $course_id AND |
4415 | - lp_id = " . $this->get_id() . " AND |
|
4415 | + lp_id = ".$this->get_id()." AND |
|
4416 | 4416 | user_id = " . $this->get_user_id()." ".$session_condition; |
4417 | 4417 | |
4418 | 4418 | if ($this->debug > 2) { |
4419 | - error_log('New LP - Saving last item seen : ' . $sql, 0); |
|
4419 | + error_log('New LP - Saving last item seen : '.$sql, 0); |
|
4420 | 4420 | } |
4421 | 4421 | Database::query($sql); |
4422 | 4422 | } |
@@ -4430,7 +4430,7 @@ discard block |
||
4430 | 4430 | progress = $progress |
4431 | 4431 | WHERE |
4432 | 4432 | c_id = ".$course_id." AND |
4433 | - lp_id = " . $this->get_id() . " AND |
|
4433 | + lp_id = " . $this->get_id()." AND |
|
4434 | 4434 | user_id = " . $this->get_user_id()." ".$session_condition; |
4435 | 4435 | // Ignore errors as some tables might not have the progress field just yet. |
4436 | 4436 | Database::query($sql); |
@@ -4446,7 +4446,7 @@ discard block |
||
4446 | 4446 | public function set_current_item($item_id = null) |
4447 | 4447 | { |
4448 | 4448 | if ($this->debug > 0) { |
4449 | - error_log('New LP - In learnpath::set_current_item(' . $item_id . ')', 0); |
|
4449 | + error_log('New LP - In learnpath::set_current_item('.$item_id.')', 0); |
|
4450 | 4450 | } |
4451 | 4451 | if (empty ($item_id)) { |
4452 | 4452 | if ($this->debug > 2) { |
@@ -4455,7 +4455,7 @@ discard block |
||
4455 | 4455 | // Do nothing. |
4456 | 4456 | } else { |
4457 | 4457 | if ($this->debug > 2) { |
4458 | - error_log('New LP - New current item given is ' . $item_id . '...', 0); |
|
4458 | + error_log('New LP - New current item given is '.$item_id.'...', 0); |
|
4459 | 4459 | } |
4460 | 4460 | if (is_numeric($item_id)) { |
4461 | 4461 | $item_id = intval($item_id); |
@@ -4470,10 +4470,10 @@ discard block |
||
4470 | 4470 | } |
4471 | 4471 | } |
4472 | 4472 | if ($this->debug > 2) { |
4473 | - error_log('New LP - set_current_item(' . $item_id . ') done. Index is now : ' . $this->index, 0); |
|
4473 | + error_log('New LP - set_current_item('.$item_id.') done. Index is now : '.$this->index, 0); |
|
4474 | 4474 | } |
4475 | 4475 | } else { |
4476 | - error_log('New LP - set_current_item(' . $item_id . ') failed. Not a numeric value: ', 0); |
|
4476 | + error_log('New LP - set_current_item('.$item_id.') failed. Not a numeric value: ', 0); |
|
4477 | 4477 | } |
4478 | 4478 | } |
4479 | 4479 | } |
@@ -4498,7 +4498,7 @@ discard block |
||
4498 | 4498 | $lp = $this->get_id(); |
4499 | 4499 | if ($lp != 0) { |
4500 | 4500 | $tbl_lp = Database :: get_course_table(TABLE_LP_MAIN); |
4501 | - $sql = "UPDATE $tbl_lp SET default_encoding = '$enc' WHERE c_id = ".$course_id." AND id = " . $lp; |
|
4501 | + $sql = "UPDATE $tbl_lp SET default_encoding = '$enc' WHERE c_id = ".$course_id." AND id = ".$lp; |
|
4502 | 4502 | $res = Database::query($sql); |
4503 | 4503 | return $res; |
4504 | 4504 | } |
@@ -4522,7 +4522,7 @@ discard block |
||
4522 | 4522 | |
4523 | 4523 | if ($lp != 0) { |
4524 | 4524 | $tbl_lp = Database :: get_course_table(TABLE_LP_MAIN); |
4525 | - $sql = "UPDATE $tbl_lp SET js_lib = '$lib' WHERE c_id = ".$course_id." AND id = " . $lp; |
|
4525 | + $sql = "UPDATE $tbl_lp SET js_lib = '$lib' WHERE c_id = ".$course_id." AND id = ".$lp; |
|
4526 | 4526 | $res = Database::query($sql); |
4527 | 4527 | return $res; |
4528 | 4528 | } else { |
@@ -4547,10 +4547,10 @@ discard block |
||
4547 | 4547 | $course_id = api_get_course_int_id(); |
4548 | 4548 | $lp_id = $this->get_id(); |
4549 | 4549 | $sql = "UPDATE $lp_table SET |
4550 | - content_maker = '" . Database::escape_string($this->maker) . "' |
|
4550 | + content_maker = '".Database::escape_string($this->maker)."' |
|
4551 | 4551 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4552 | 4552 | if ($this->debug > 2) { |
4553 | - error_log('New LP - lp updated with new content_maker : ' . $this->maker, 0); |
|
4553 | + error_log('New LP - lp updated with new content_maker : '.$this->maker, 0); |
|
4554 | 4554 | } |
4555 | 4555 | Database::query($sql); |
4556 | 4556 | return true; |
@@ -4574,10 +4574,10 @@ discard block |
||
4574 | 4574 | $lp_id = $this->get_id(); |
4575 | 4575 | $course_id = $this->course_info['real_id']; |
4576 | 4576 | $sql = "UPDATE $lp_table SET |
4577 | - name = '" . Database::escape_string($this->name). "' |
|
4577 | + name = '".Database::escape_string($this->name)."' |
|
4578 | 4578 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4579 | 4579 | if ($this->debug > 2) { |
4580 | - error_log('New LP - lp updated with new name : ' . $this->name, 0); |
|
4580 | + error_log('New LP - lp updated with new name : '.$this->name, 0); |
|
4581 | 4581 | } |
4582 | 4582 | $result = Database::query($sql); |
4583 | 4583 | // If the lp is visible on the homepage, change his name there. |
@@ -4585,7 +4585,7 @@ discard block |
||
4585 | 4585 | $session_id = api_get_session_id(); |
4586 | 4586 | $session_condition = api_get_session_condition($session_id); |
4587 | 4587 | $tbl_tool = Database :: get_course_table(TABLE_TOOL_LIST); |
4588 | - $link = 'newscorm/lp_controller.php?action=view&lp_id=' . $lp_id.'&id_session='.$session_id; |
|
4588 | + $link = 'newscorm/lp_controller.php?action=view&lp_id='.$lp_id.'&id_session='.$session_id; |
|
4589 | 4589 | $sql = "UPDATE $tbl_tool SET name = '$this->name' |
4590 | 4590 | WHERE |
4591 | 4591 | c_id = $course_id AND |
@@ -4663,10 +4663,10 @@ discard block |
||
4663 | 4663 | |
4664 | 4664 | // Save it to search engine. |
4665 | 4665 | foreach ($missing_terms as $term) { |
4666 | - $doc->add_term($prefix . $term, 1); |
|
4666 | + $doc->add_term($prefix.$term, 1); |
|
4667 | 4667 | } |
4668 | 4668 | foreach ($deprecated_terms as $term) { |
4669 | - $doc->remove_term($prefix . $term); |
|
4669 | + $doc->remove_term($prefix.$term); |
|
4670 | 4670 | } |
4671 | 4671 | $di->getDb()->replace_document((int) $se_ref['search_did'], $doc); |
4672 | 4672 | $di->getDb()->flush(); |
@@ -4691,10 +4691,10 @@ discard block |
||
4691 | 4691 | $this->theme = $name; |
4692 | 4692 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4693 | 4693 | $lp_id = $this->get_id(); |
4694 | - $sql = "UPDATE $lp_table SET theme = '" . Database::escape_string($this->theme). "' |
|
4694 | + $sql = "UPDATE $lp_table SET theme = '".Database::escape_string($this->theme)."' |
|
4695 | 4695 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4696 | 4696 | if ($this->debug > 2) { |
4697 | - error_log('New LP - lp updated with new theme : ' . $this->theme, 0); |
|
4697 | + error_log('New LP - lp updated with new theme : '.$this->theme, 0); |
|
4698 | 4698 | } |
4699 | 4699 | Database::query($sql); |
4700 | 4700 | |
@@ -4717,10 +4717,10 @@ discard block |
||
4717 | 4717 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4718 | 4718 | $lp_id = $this->get_id(); |
4719 | 4719 | $sql = "UPDATE $lp_table SET |
4720 | - preview_image = '" . Database::escape_string($this->preview_image). "' |
|
4720 | + preview_image = '".Database::escape_string($this->preview_image)."' |
|
4721 | 4721 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4722 | 4722 | if ($this->debug > 2) { |
4723 | - error_log('New LP - lp updated with new preview image : ' . $this->preview_image, 0); |
|
4723 | + error_log('New LP - lp updated with new preview image : '.$this->preview_image, 0); |
|
4724 | 4724 | } |
4725 | 4725 | Database::query($sql); |
4726 | 4726 | return true; |
@@ -4740,10 +4740,10 @@ discard block |
||
4740 | 4740 | $this->author = $name; |
4741 | 4741 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4742 | 4742 | $lp_id = $this->get_id(); |
4743 | - $sql = "UPDATE $lp_table SET author = '" . Database::escape_string($name). "' |
|
4743 | + $sql = "UPDATE $lp_table SET author = '".Database::escape_string($name)."' |
|
4744 | 4744 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4745 | 4745 | if ($this->debug > 2) { |
4746 | - error_log('New LP - lp updated with new preview author : ' . $this->author, 0); |
|
4746 | + error_log('New LP - lp updated with new preview author : '.$this->author, 0); |
|
4747 | 4747 | } |
4748 | 4748 | Database::query($sql); |
4749 | 4749 | |
@@ -4761,15 +4761,15 @@ discard block |
||
4761 | 4761 | if ($this->debug > 0) { |
4762 | 4762 | error_log('New LP - In learnpath::set_hide_toc_frame()', 0); |
4763 | 4763 | } |
4764 | - if (intval($hide) == $hide){ |
|
4764 | + if (intval($hide) == $hide) { |
|
4765 | 4765 | $this->hide_toc_frame = $hide; |
4766 | 4766 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4767 | 4767 | $lp_id = $this->get_id(); |
4768 | 4768 | $sql = "UPDATE $lp_table SET |
4769 | - hide_toc_frame = '" . $this->hide_toc_frame . "' |
|
4769 | + hide_toc_frame = '".$this->hide_toc_frame."' |
|
4770 | 4770 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4771 | 4771 | if ($this->debug > 2) { |
4772 | - error_log('New LP - lp updated with new preview hide_toc_frame : ' . $this->author, 0); |
|
4772 | + error_log('New LP - lp updated with new preview hide_toc_frame : '.$this->author, 0); |
|
4773 | 4773 | } |
4774 | 4774 | Database::query($sql); |
4775 | 4775 | |
@@ -4796,7 +4796,7 @@ discard block |
||
4796 | 4796 | $sql = "UPDATE $lp_table SET prerequisite = '".$this->prerequisite."' |
4797 | 4797 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4798 | 4798 | if ($this->debug > 2) { |
4799 | - error_log('New LP - lp updated with new preview requisite : ' . $this->requisite, 0); |
|
4799 | + error_log('New LP - lp updated with new preview requisite : '.$this->requisite, 0); |
|
4800 | 4800 | } |
4801 | 4801 | Database::query($sql); |
4802 | 4802 | return true; |
@@ -4820,10 +4820,10 @@ discard block |
||
4820 | 4820 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4821 | 4821 | $lp_id = $this->get_id(); |
4822 | 4822 | $sql = "UPDATE $lp_table SET |
4823 | - content_local = '" . Database::escape_string($name) . "' |
|
4823 | + content_local = '".Database::escape_string($name)."' |
|
4824 | 4824 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4825 | 4825 | if ($this->debug > 2) { |
4826 | - error_log('New LP - lp updated with new proximity : ' . $this->proximity, 0); |
|
4826 | + error_log('New LP - lp updated with new proximity : '.$this->proximity, 0); |
|
4827 | 4827 | } |
4828 | 4828 | Database::query($sql); |
4829 | 4829 | return true; |
@@ -4857,11 +4857,11 @@ discard block |
||
4857 | 4857 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4858 | 4858 | $lp_id = $this->get_id(); |
4859 | 4859 | $sql = "UPDATE $lp_table SET |
4860 | - use_max_score = '" . $this->use_max_score . "' |
|
4860 | + use_max_score = '".$this->use_max_score."' |
|
4861 | 4861 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4862 | 4862 | |
4863 | 4863 | if ($this->debug > 2) { |
4864 | - error_log('New LP - lp updated with new use_max_score : ' . $this->use_max_score, 0); |
|
4864 | + error_log('New LP - lp updated with new use_max_score : '.$this->use_max_score, 0); |
|
4865 | 4865 | } |
4866 | 4866 | Database::query($sql); |
4867 | 4867 | |
@@ -4888,10 +4888,10 @@ discard block |
||
4888 | 4888 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4889 | 4889 | $lp_id = $this->get_id(); |
4890 | 4890 | $sql = "UPDATE $lp_table SET |
4891 | - expired_on = '" . Database::escape_string($this->expired_on) . "' |
|
4891 | + expired_on = '".Database::escape_string($this->expired_on)."' |
|
4892 | 4892 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4893 | 4893 | if ($this->debug > 2) { |
4894 | - error_log('New LP - lp updated with new expired_on : ' . $this->expired_on, 0); |
|
4894 | + error_log('New LP - lp updated with new expired_on : '.$this->expired_on, 0); |
|
4895 | 4895 | } |
4896 | 4896 | Database::query($sql); |
4897 | 4897 | |
@@ -4917,10 +4917,10 @@ discard block |
||
4917 | 4917 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4918 | 4918 | $lp_id = $this->get_id(); |
4919 | 4919 | $sql = "UPDATE $lp_table SET |
4920 | - publicated_on = '" . Database::escape_string($this->publicated_on) . "' |
|
4920 | + publicated_on = '".Database::escape_string($this->publicated_on)."' |
|
4921 | 4921 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4922 | 4922 | if ($this->debug > 2) { |
4923 | - error_log('New LP - lp updated with new publicated_on : ' . $this->publicated_on, 0); |
|
4923 | + error_log('New LP - lp updated with new publicated_on : '.$this->publicated_on, 0); |
|
4924 | 4924 | } |
4925 | 4925 | Database::query($sql); |
4926 | 4926 | |
@@ -4940,10 +4940,10 @@ discard block |
||
4940 | 4940 | $this->modified_on = api_get_utc_datetime(); |
4941 | 4941 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4942 | 4942 | $lp_id = $this->get_id(); |
4943 | - $sql = "UPDATE $lp_table SET modified_on = '" . $this->modified_on . "' |
|
4943 | + $sql = "UPDATE $lp_table SET modified_on = '".$this->modified_on."' |
|
4944 | 4944 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4945 | 4945 | if ($this->debug > 2) { |
4946 | - error_log('New LP - lp updated with new expired_on : ' . $this->modified_on, 0); |
|
4946 | + error_log('New LP - lp updated with new expired_on : '.$this->modified_on, 0); |
|
4947 | 4947 | } |
4948 | 4948 | Database::query($sql); |
4949 | 4949 | return true; |
@@ -5014,13 +5014,13 @@ discard block |
||
5014 | 5014 | |
5015 | 5015 | if ($this->last != 0 && $this->last != $this->current && is_object($this->items[$this->last])) { |
5016 | 5016 | if ($this->debug > 2) { |
5017 | - error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' is object', 0); |
|
5017 | + error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' is object', 0); |
|
5018 | 5018 | } |
5019 | 5019 | switch ($this->get_type()) { |
5020 | 5020 | case '3' : |
5021 | 5021 | if ($this->items[$this->last]->get_type() != 'au') { |
5022 | 5022 | if ($this->debug > 2) { |
5023 | - error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' in lp_type 3 is <> au', 0); |
|
5023 | + error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' in lp_type 3 is <> au', 0); |
|
5024 | 5024 | } |
5025 | 5025 | $this->items[$this->last]->close(); |
5026 | 5026 | //$this->autocomplete_parents($this->last); |
@@ -5033,7 +5033,7 @@ discard block |
||
5033 | 5033 | case '2' : |
5034 | 5034 | if ($this->items[$this->last]->get_type() != 'sco') { |
5035 | 5035 | if ($this->debug > 2) { |
5036 | - error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' in lp_type 2 is <> sco', 0); |
|
5036 | + error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' in lp_type 2 is <> sco', 0); |
|
5037 | 5037 | } |
5038 | 5038 | $this->items[$this->last]->close(); |
5039 | 5039 | //$this->autocomplete_parents($this->last); |
@@ -5047,7 +5047,7 @@ discard block |
||
5047 | 5047 | case '1' : |
5048 | 5048 | default : |
5049 | 5049 | if ($this->debug > 2) { |
5050 | - error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' in lp_type 1 is asset', 0); |
|
5050 | + error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' in lp_type 1 is asset', 0); |
|
5051 | 5051 | } |
5052 | 5052 | $this->items[$this->last]->close(); |
5053 | 5053 | break; |
@@ -5073,7 +5073,7 @@ discard block |
||
5073 | 5073 | } |
5074 | 5074 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
5075 | 5075 | $sql = "SELECT * FROM $lp_table |
5076 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5076 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5077 | 5077 | $res = Database::query($sql); |
5078 | 5078 | if (Database :: num_rows($res) > 0) { |
5079 | 5079 | $row = Database :: fetch_array($res); |
@@ -5094,14 +5094,14 @@ discard block |
||
5094 | 5094 | break; |
5095 | 5095 | } |
5096 | 5096 | $sql = "UPDATE $lp_table SET default_view_mod = '$view_mode' |
5097 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5097 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5098 | 5098 | Database::query($sql); |
5099 | 5099 | $this->mode = $view_mode; |
5100 | 5100 | |
5101 | 5101 | return $view_mode; |
5102 | 5102 | } else { |
5103 | 5103 | if ($this->debug > 2) { |
5104 | - error_log('New LP - Problem in update_default_view() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
5104 | + error_log('New LP - Problem in update_default_view() - could not find LP '.$this->get_id().' in DB', 0); |
|
5105 | 5105 | } |
5106 | 5106 | } |
5107 | 5107 | return -1; |
@@ -5119,7 +5119,7 @@ discard block |
||
5119 | 5119 | } |
5120 | 5120 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
5121 | 5121 | $sql = "SELECT * FROM $lp_table |
5122 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5122 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5123 | 5123 | $res = Database::query($sql); |
5124 | 5124 | if (Database :: num_rows($res) > 0) { |
5125 | 5125 | $row = Database :: fetch_array($res); |
@@ -5132,14 +5132,14 @@ discard block |
||
5132 | 5132 | $force_return = true; |
5133 | 5133 | } |
5134 | 5134 | $sql = "UPDATE $lp_table SET force_commit = $force |
5135 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5135 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5136 | 5136 | Database::query($sql); |
5137 | 5137 | $this->force_commit = $force_return; |
5138 | 5138 | |
5139 | 5139 | return $force_return; |
5140 | 5140 | } else { |
5141 | 5141 | if ($this->debug > 2) { |
5142 | - error_log('New LP - Problem in update_default_scorm_commit() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
5142 | + error_log('New LP - Problem in update_default_scorm_commit() - could not find LP '.$this->get_id().' in DB', 0); |
|
5143 | 5143 | } |
5144 | 5144 | } |
5145 | 5145 | return -1; |
@@ -5168,7 +5168,7 @@ discard block |
||
5168 | 5168 | if ($row['display_order'] != $i) { // If we find a gap in the order, we need to fix it. |
5169 | 5169 | $need_fix = true; |
5170 | 5170 | $sql = "UPDATE $lp_table SET display_order = $i |
5171 | - WHERE c_id = ".$course_id." AND id = " . $row['id']; |
|
5171 | + WHERE c_id = ".$course_id." AND id = ".$row['id']; |
|
5172 | 5172 | Database::query($sql); |
5173 | 5173 | } |
5174 | 5174 | $i++; |
@@ -5189,7 +5189,7 @@ discard block |
||
5189 | 5189 | } |
5190 | 5190 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
5191 | 5191 | $sql = "SELECT * FROM $lp_table |
5192 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5192 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5193 | 5193 | $res = Database::query($sql); |
5194 | 5194 | if (Database :: num_rows($res) > 0) { |
5195 | 5195 | $row = Database :: fetch_array($res); |
@@ -5200,13 +5200,13 @@ discard block |
||
5200 | 5200 | $force = 1; |
5201 | 5201 | } |
5202 | 5202 | $sql = "UPDATE $lp_table SET prevent_reinit = $force |
5203 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5203 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5204 | 5204 | Database::query($sql); |
5205 | 5205 | $this->prevent_reinit = $force; |
5206 | 5206 | return $force; |
5207 | 5207 | } else { |
5208 | 5208 | if ($this->debug > 2) { |
5209 | - error_log('New LP - Problem in update_reinit() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
5209 | + error_log('New LP - Problem in update_reinit() - could not find LP '.$this->get_id().' in DB', 0); |
|
5210 | 5210 | } |
5211 | 5211 | } |
5212 | 5212 | return -1; |
@@ -5222,11 +5222,11 @@ discard block |
||
5222 | 5222 | { |
5223 | 5223 | //Set default value for seriousgame_mode |
5224 | 5224 | if (!isset($this->seriousgame_mode)) { |
5225 | - $this->seriousgame_mode=0; |
|
5225 | + $this->seriousgame_mode = 0; |
|
5226 | 5226 | } |
5227 | 5227 | // Set default value for prevent_reinit |
5228 | 5228 | if (!isset($this->prevent_reinit)) { |
5229 | - $this->prevent_reinit =1; |
|
5229 | + $this->prevent_reinit = 1; |
|
5230 | 5230 | } |
5231 | 5231 | if ($this->seriousgame_mode == 1 && $this->prevent_reinit == 1) { |
5232 | 5232 | return 'seriousgame'; |
@@ -5274,7 +5274,7 @@ discard block |
||
5274 | 5274 | $sql = "UPDATE $lp_table SET |
5275 | 5275 | prevent_reinit = $prevent_reinit , |
5276 | 5276 | seriousgame_mode = $sg_mode |
5277 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5277 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5278 | 5278 | $res = Database::query($sql); |
5279 | 5279 | if ($res) { |
5280 | 5280 | return true; |
@@ -5326,7 +5326,7 @@ discard block |
||
5326 | 5326 | error_log('New LP - In learnpath::set_seriousgame_mode()', 0); |
5327 | 5327 | } |
5328 | 5328 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
5329 | - $sql = "SELECT * FROM $lp_table WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5329 | + $sql = "SELECT * FROM $lp_table WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5330 | 5330 | $res = Database::query($sql); |
5331 | 5331 | if (Database :: num_rows($res) > 0) { |
5332 | 5332 | $row = Database :: fetch_array($res); |
@@ -5337,13 +5337,13 @@ discard block |
||
5337 | 5337 | $force = 1; |
5338 | 5338 | } |
5339 | 5339 | $sql = "UPDATE $lp_table SET seriousgame_mode = $force |
5340 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5340 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5341 | 5341 | Database::query($sql); |
5342 | 5342 | $this->seriousgame_mode = $force; |
5343 | 5343 | return $force; |
5344 | 5344 | } else { |
5345 | 5345 | if ($this->debug > 2) { |
5346 | - error_log('New LP - Problem in set_seriousgame_mode() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
5346 | + error_log('New LP - Problem in set_seriousgame_mode() - could not find LP '.$this->get_id().' in DB', 0); |
|
5347 | 5347 | } |
5348 | 5348 | } |
5349 | 5349 | return -1; |
@@ -5361,7 +5361,7 @@ discard block |
||
5361 | 5361 | } |
5362 | 5362 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
5363 | 5363 | $sql = "SELECT * FROM $lp_table |
5364 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5364 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5365 | 5365 | $res = Database::query($sql); |
5366 | 5366 | if (Database :: num_rows($res) > 0) { |
5367 | 5367 | $row = Database :: fetch_array($res); |
@@ -5372,13 +5372,13 @@ discard block |
||
5372 | 5372 | $force = 1; |
5373 | 5373 | } |
5374 | 5374 | $sql = "UPDATE $lp_table SET debug = $force |
5375 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5375 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5376 | 5376 | $res = Database::query($sql); |
5377 | 5377 | $this->scorm_debug = $force; |
5378 | 5378 | return $force; |
5379 | 5379 | } else { |
5380 | 5380 | if ($this->debug > 2) { |
5381 | - error_log('New LP - Problem in update_scorm_debug() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
5381 | + error_log('New LP - Problem in update_scorm_debug() - could not find LP '.$this->get_id().' in DB', 0); |
|
5382 | 5382 | } |
5383 | 5383 | } |
5384 | 5384 | return -1; |
@@ -5407,7 +5407,7 @@ discard block |
||
5407 | 5407 | * @param int $depth |
5408 | 5408 | * @param array $tmp |
5409 | 5409 | */ |
5410 | - public function create_tree_array($array, $parent = 0, $depth = -1, $tmp = array ()) |
|
5410 | + public function create_tree_array($array, $parent = 0, $depth = -1, $tmp = array()) |
|
5411 | 5411 | { |
5412 | 5412 | if ($this->debug > 1) { |
5413 | 5413 | error_log('New LP - In learnpath::create_tree_array())', 0); |
@@ -5493,7 +5493,7 @@ discard block |
||
5493 | 5493 | |
5494 | 5494 | // we need to start a form when we want to update all the mp3 files |
5495 | 5495 | if ($update_audio == 'true') { |
5496 | - $return .= '<form action="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&updateaudio=' . Security :: remove_XSS($_GET['updateaudio']) .'&action=' . Security :: remove_XSS($_GET['action']) . '&lp_id=' . $_SESSION['oLP']->lp_id . '" method="post" enctype="multipart/form-data" name="updatemp3" id="updatemp3">'; |
|
5496 | + $return .= '<form action="'.api_get_self().'?cidReq='.Security :: remove_XSS($_GET['cidReq']).'&updateaudio='.Security :: remove_XSS($_GET['updateaudio']).'&action='.Security :: remove_XSS($_GET['action']).'&lp_id='.$_SESSION['oLP']->lp_id.'" method="post" enctype="multipart/form-data" name="updatemp3" id="updatemp3">'; |
|
5497 | 5497 | } |
5498 | 5498 | $return .= '<div id="message"></div>'; |
5499 | 5499 | if (count($this->items) == 0) { |
@@ -5501,14 +5501,14 @@ discard block |
||
5501 | 5501 | } else { |
5502 | 5502 | $return_audio = '<table class="data_table">'; |
5503 | 5503 | $return_audio .= '<tr>'; |
5504 | - $return_audio .= '<th width="40%">' . get_lang('Title') . '</th>'; |
|
5505 | - $return_audio .= '<th>' . get_lang('Audio') . '</th>'; |
|
5504 | + $return_audio .= '<th width="40%">'.get_lang('Title').'</th>'; |
|
5505 | + $return_audio .= '<th>'.get_lang('Audio').'</th>'; |
|
5506 | 5506 | $return_audio .= '</tr>'; |
5507 | 5507 | |
5508 | 5508 | if ($update_audio != 'true') { |
5509 | 5509 | $return .= '<div class="col-md-12">'; |
5510 | 5510 | $return .= self::return_new_tree($update_audio); |
5511 | - $return .='</div>'; |
|
5511 | + $return .= '</div>'; |
|
5512 | 5512 | $return .= Display::div(Display::url(get_lang('Save'), '#', array('id'=>'listSubmit', 'class'=>'btn btn-primary')), array('style'=>'float:left; margin-top:15px;width:100%')); |
5513 | 5513 | } else { |
5514 | 5514 | $return_audio .= self::return_new_tree($update_audio); |
@@ -5518,7 +5518,7 @@ discard block |
||
5518 | 5518 | // We need to close the form when we are updating the mp3 files. |
5519 | 5519 | if ($update_audio == 'true') { |
5520 | 5520 | $return .= '<div class="footer-audio">'; |
5521 | - $return .= Display::button('save_audio','<em class="fa fa-file-audio-o"></em> '. get_lang('SaveAudioAndOrganization'),array('class'=>'btn btn-primary','type'=>'submit')); |
|
5521 | + $return .= Display::button('save_audio', '<em class="fa fa-file-audio-o"></em> '.get_lang('SaveAudioAndOrganization'), array('class'=>'btn btn-primary', 'type'=>'submit')); |
|
5522 | 5522 | $return .= '</div>'; |
5523 | 5523 | //$return .= '<div><button class="btn btn-primary" type="submit" name="save_audio" id="save_audio">' . get_lang('SaveAudioAndOrganization') . '</button></div>'; // TODO: What kind of language variable is this? |
5524 | 5524 | } |
@@ -5539,7 +5539,7 @@ discard block |
||
5539 | 5539 | public function return_new_tree($update_audio = 'false', $drop_element_here = false) |
5540 | 5540 | { |
5541 | 5541 | $return = ''; |
5542 | - $is_allowed_to_edit = api_is_allowed_to_edit(null,true); |
|
5542 | + $is_allowed_to_edit = api_is_allowed_to_edit(null, true); |
|
5543 | 5543 | |
5544 | 5544 | $course_id = api_get_course_int_id(); |
5545 | 5545 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
@@ -5587,7 +5587,7 @@ discard block |
||
5587 | 5587 | |
5588 | 5588 | // Link for the documents |
5589 | 5589 | if ($arrLP[$i]['item_type'] == 'document') { |
5590 | - $url = api_get_self() . '?'.api_get_cidreq().'&action=view_item&mode=preview_document&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id; |
|
5590 | + $url = api_get_self().'?'.api_get_cidreq().'&action=view_item&mode=preview_document&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id; |
|
5591 | 5591 | $title_cut = Display::url( |
5592 | 5592 | $title_cut, |
5593 | 5593 | $url, |
@@ -5603,14 +5603,14 @@ discard block |
||
5603 | 5603 | } else { |
5604 | 5604 | $oddClass = 'row_even'; |
5605 | 5605 | } |
5606 | - $return_audio .= '<tr id ="lp_item_'.$arrLP[$i]['id'] .'" class="' . $oddClass . '">'; |
|
5606 | + $return_audio .= '<tr id ="lp_item_'.$arrLP[$i]['id'].'" class="'.$oddClass.'">'; |
|
5607 | 5607 | |
5608 | 5608 | $icon_name = str_replace(' ', '', $arrLP[$i]['item_type']); |
5609 | 5609 | |
5610 | - if (file_exists('../img/lp_' . $icon_name . '.png')) { |
|
5610 | + if (file_exists('../img/lp_'.$icon_name.'.png')) { |
|
5611 | 5611 | $icon = Display::return_icon('lp_'.$icon_name.'.png'); |
5612 | 5612 | } else { |
5613 | - if (file_exists('../img/lp_' . $icon_name . '.gif')) { |
|
5613 | + if (file_exists('../img/lp_'.$icon_name.'.gif')) { |
|
5614 | 5614 | $icon = Display::return_icon('lp_'.$icon_name.'.gif'); |
5615 | 5615 | } else { |
5616 | 5616 | $icon = Display::return_icon('folder_document.gif'); |
@@ -5618,7 +5618,7 @@ discard block |
||
5618 | 5618 | } |
5619 | 5619 | |
5620 | 5620 | // The audio column. |
5621 | - $return_audio .= '<td align="left" style="padding-left:10px;">'; |
|
5621 | + $return_audio .= '<td align="left" style="padding-left:10px;">'; |
|
5622 | 5622 | $audio = ''; |
5623 | 5623 | |
5624 | 5624 | if (!$update_audio || $update_audio <> 'true') { |
@@ -5629,10 +5629,10 @@ discard block |
||
5629 | 5629 | } else { |
5630 | 5630 | $types = self::getChapterTypes(); |
5631 | 5631 | if (!in_array($arrLP[$i]['item_type'], $types)) { |
5632 | - $audio .= '<input type="file" name="mp3file' . $arrLP[$i]['id'] . '" id="mp3file" />'; |
|
5632 | + $audio .= '<input type="file" name="mp3file'.$arrLP[$i]['id'].'" id="mp3file" />'; |
|
5633 | 5633 | if (!empty ($arrLP[$i]['audio'])) { |
5634 | 5634 | $audio .= '<br />'.Security::remove_XSS($arrLP[$i]['audio']).'<br /> |
5635 | - <input type="checkbox" name="removemp3' . $arrLP[$i]['id'] . '" id="checkbox' . $arrLP[$i]['id'] . '" />' . get_lang('RemoveAudio'); |
|
5635 | + <input type="checkbox" name="removemp3' . $arrLP[$i]['id'].'" id="checkbox'.$arrLP[$i]['id'].'" />'.get_lang('RemoveAudio'); |
|
5636 | 5636 | } |
5637 | 5637 | } |
5638 | 5638 | } |
@@ -5656,7 +5656,7 @@ discard block |
||
5656 | 5656 | // No edit for this item types |
5657 | 5657 | if (!in_array($arrLP[$i]['item_type'], array('sco', 'asset'))) { |
5658 | 5658 | if (!in_array($arrLP[$i]['item_type'], array('dokeos_chapter', 'dokeos_module'))) { |
5659 | - $edit_icon .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=edit_item&view=build&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '&path_item=' . $arrLP[$i]['path'] . '" class="btn btn-default">'; |
|
5659 | + $edit_icon .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=edit_item&view=build&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id.'&path_item='.$arrLP[$i]['path'].'" class="btn btn-default">'; |
|
5660 | 5660 | $edit_icon .= Display::return_icon('edit.png', get_lang('LearnpathEditModule'), array(), ICON_SIZE_TINY); |
5661 | 5661 | $edit_icon .= '</a>'; |
5662 | 5662 | |
@@ -5669,7 +5669,7 @@ discard block |
||
5669 | 5669 | $this->lp_session_id |
5670 | 5670 | ) |
5671 | 5671 | ) { |
5672 | - $forumIconUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
5672 | + $forumIconUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
5673 | 5673 | 'action' => 'dissociate_forum', |
5674 | 5674 | 'id' => $arrLP[$i]['id'], |
5675 | 5675 | 'lp_id' => $this->lp_id |
@@ -5680,7 +5680,7 @@ discard block |
||
5680 | 5680 | ['class' => 'btn btn-default lp-btn-dissociate-forum'] |
5681 | 5681 | ); |
5682 | 5682 | } else { |
5683 | - $forumIconUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
5683 | + $forumIconUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
5684 | 5684 | 'action' => 'create_forum', |
5685 | 5685 | 'id' => $arrLP[$i]['id'], |
5686 | 5686 | 'lp_id' => $this->lp_id |
@@ -5693,17 +5693,17 @@ discard block |
||
5693 | 5693 | } |
5694 | 5694 | } |
5695 | 5695 | } else { |
5696 | - $edit_icon .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=edit_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '&path_item=' . $arrLP[$i]['path'] . '" class="btn btn-default">'; |
|
5696 | + $edit_icon .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=edit_item&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id.'&path_item='.$arrLP[$i]['path'].'" class="btn btn-default">'; |
|
5697 | 5697 | $edit_icon .= Display::return_icon('edit.png', get_lang('LearnpathEditModule'), array(), ICON_SIZE_TINY); |
5698 | 5698 | $edit_icon .= '</a>'; |
5699 | 5699 | } |
5700 | 5700 | } |
5701 | 5701 | |
5702 | - $delete_icon .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&action=delete_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '" onclick="return confirmation(\'' . addslashes($title) . '\');" class="btn btn-default">'; |
|
5702 | + $delete_icon .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&action=delete_item&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id.'" onclick="return confirmation(\''.addslashes($title).'\');" class="btn btn-default">'; |
|
5703 | 5703 | $delete_icon .= Display::return_icon('delete.png', get_lang('LearnpathDeleteModule'), array(), ICON_SIZE_TINY); |
5704 | 5704 | $delete_icon .= '</a>'; |
5705 | 5705 | |
5706 | - $url = api_get_self() . '?'.api_get_cidreq().'&view=build&id='.$arrLP[$i]['id'] .'&lp_id='.$this->lp_id; |
|
5706 | + $url = api_get_self().'?'.api_get_cidreq().'&view=build&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id; |
|
5707 | 5707 | |
5708 | 5708 | if (!in_array($arrLP[$i]['item_type'], array('dokeos_chapter', 'dokeos_module', 'dir'))) { |
5709 | 5709 | $prerequisities_icon = Display::url(Display::return_icon('accept.png', get_lang('LearnpathPrerequisites'), array(), ICON_SIZE_TINY), $url.'&action=edit_item_prereq', ['class' => 'btn btn-default']); |
@@ -5712,8 +5712,8 @@ discard block |
||
5712 | 5712 | } |
5713 | 5713 | } |
5714 | 5714 | if ($update_audio != 'true') { |
5715 | - $row = $move_icon . ' ' . $icon . |
|
5716 | - Display::span($title_cut) . |
|
5715 | + $row = $move_icon.' '.$icon. |
|
5716 | + Display::span($title_cut). |
|
5717 | 5717 | Display::tag( |
5718 | 5718 | 'div', |
5719 | 5719 | "<div class=\"btn-group btn-group-xs\">$audio $edit_icon $forumIcon $prerequisities_icon $move_item_icon $audio_icon $delete_icon</div>", |
@@ -5734,8 +5734,8 @@ discard block |
||
5734 | 5734 | $parent_arrays = array(); |
5735 | 5735 | if ($arrLP[$i]['depth'] > 1) { |
5736 | 5736 | //Getting list of parents |
5737 | - for($j = 0; $j < $arrLP[$i]['depth']; $j++) { |
|
5738 | - foreach($arrLP as $item) { |
|
5737 | + for ($j = 0; $j < $arrLP[$i]['depth']; $j++) { |
|
5738 | + foreach ($arrLP as $item) { |
|
5739 | 5739 | if ($item['id'] == $parent_id) { |
5740 | 5740 | if ($item['parent_item_id'] == 0) { |
5741 | 5741 | $parent_id = $item['id']; |
@@ -5757,8 +5757,8 @@ discard block |
||
5757 | 5757 | $parent_arrays = array_reverse($parent_arrays); |
5758 | 5758 | $val = '$elements'; |
5759 | 5759 | $x = 0; |
5760 | - foreach($parent_arrays as $item) { |
|
5761 | - if ($x != count($parent_arrays) -1) { |
|
5760 | + foreach ($parent_arrays as $item) { |
|
5761 | + if ($x != count($parent_arrays) - 1) { |
|
5762 | 5762 | $val .= '["'.$item.'"]["children"]'; |
5763 | 5763 | } else { |
5764 | 5764 | $val .= '["'.$item.'"]["children"]'; |
@@ -5821,7 +5821,7 @@ discard block |
||
5821 | 5821 | if (isset($_REQUEST['id']) && $key == $_REQUEST['id']) { |
5822 | 5822 | $active = 'active'; |
5823 | 5823 | } |
5824 | - $return .= Display::tag('li', Display::div($item['data'], array('class'=>"item_data $active")).$sub_list, array('id'=>$key, 'class'=>'record li_container')); |
|
5824 | + $return .= Display::tag('li', Display::div($item['data'], array('class'=>"item_data $active")).$sub_list, array('id'=>$key, 'class'=>'record li_container')); |
|
5825 | 5825 | } else { |
5826 | 5826 | //sections |
5827 | 5827 | if (isset($item['children'])) { |
@@ -5844,17 +5844,17 @@ discard block |
||
5844 | 5844 | { |
5845 | 5845 | $gradebook = isset($_GET['gradebook']) ? Security :: remove_XSS($_GET['gradebook']) : null; |
5846 | 5846 | $return = '<div class="actions">'; |
5847 | - $return .= '<a href="lp_controller.php?'.api_get_cidreq().'&gradebook=' . $gradebook . '&action=view&lp_id=' . $_SESSION['oLP']->lp_id . '&isStudentView=true">' . Display :: return_icon('preview_view.png', get_lang('Display'),'',ICON_SIZE_MEDIUM).'</a> '; |
|
5848 | - $return .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=admin_view&lp_id=' . $_SESSION['oLP']->lp_id . '&updateaudio=true">' . Display :: return_icon('upload_audio.png', get_lang('UpdateAllAudioFragments'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
5849 | - $return .= '<a href="lp_controller.php?'.api_get_cidreq().'&action=edit&lp_id=' . $_SESSION['oLP']->lp_id . '">' . Display :: return_icon('settings.png', get_lang('CourseSettings'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
5847 | + $return .= '<a href="lp_controller.php?'.api_get_cidreq().'&gradebook='.$gradebook.'&action=view&lp_id='.$_SESSION['oLP']->lp_id.'&isStudentView=true">'.Display :: return_icon('preview_view.png', get_lang('Display'), '', ICON_SIZE_MEDIUM).'</a> '; |
|
5848 | + $return .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=admin_view&lp_id='.$_SESSION['oLP']->lp_id.'&updateaudio=true">'.Display :: return_icon('upload_audio.png', get_lang('UpdateAllAudioFragments'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
5849 | + $return .= '<a href="lp_controller.php?'.api_get_cidreq().'&action=edit&lp_id='.$_SESSION['oLP']->lp_id.'">'.Display :: return_icon('settings.png', get_lang('CourseSettings'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
5850 | 5850 | $buttons = array( |
5851 | 5851 | array( |
5852 | 5852 | 'title' => get_lang('SetPrerequisiteForEachItem'), |
5853 | - 'href' => 'lp_controller.php?'.api_get_cidreq().'&action=set_previous_step_as_prerequisite&lp_id=' . $_SESSION['oLP']->lp_id, |
|
5853 | + 'href' => 'lp_controller.php?'.api_get_cidreq().'&action=set_previous_step_as_prerequisite&lp_id='.$_SESSION['oLP']->lp_id, |
|
5854 | 5854 | ), |
5855 | 5855 | array( |
5856 | 5856 | 'title' => get_lang('ClearAllPrerequisites'), |
5857 | - 'href' => 'lp_controller.php?'.api_get_cidreq().'&action=clear_prerequisites&lp_id=' . $_SESSION['oLP']->lp_id, |
|
5857 | + 'href' => 'lp_controller.php?'.api_get_cidreq().'&action=clear_prerequisites&lp_id='.$_SESSION['oLP']->lp_id, |
|
5858 | 5858 | ), |
5859 | 5859 | ); |
5860 | 5860 | $return .= Display::group_button(get_lang('PrerequisitesOptions'), $buttons); |
@@ -5877,7 +5877,7 @@ discard block |
||
5877 | 5877 | { |
5878 | 5878 | // Creating learning_path folder |
5879 | 5879 | $dir = '/learning_path'; |
5880 | - $filepath = api_get_path(SYS_COURSE_PATH).$course['path'] . '/document'; |
|
5880 | + $filepath = api_get_path(SYS_COURSE_PATH).$course['path'].'/document'; |
|
5881 | 5881 | $creatorId = empty($creatorId) ? api_get_user_id() : $creatorId; |
5882 | 5882 | |
5883 | 5883 | $folder = false; |
@@ -5924,9 +5924,9 @@ discard block |
||
5924 | 5924 | // Creating LP folder |
5925 | 5925 | if ($folder) { |
5926 | 5926 | //Limits title size |
5927 | - $title = api_substr(api_replace_dangerous_char($lp_name), 0 , 80); |
|
5927 | + $title = api_substr(api_replace_dangerous_char($lp_name), 0, 80); |
|
5928 | 5928 | $dir = $dir.$title; |
5929 | - $filepath = api_get_path(SYS_COURSE_PATH) . $course['path'] . '/document'; |
|
5929 | + $filepath = api_get_path(SYS_COURSE_PATH).$course['path'].'/document'; |
|
5930 | 5930 | if (!is_dir($filepath.'/'.$dir)) { |
5931 | 5931 | $folderData = create_unexisting_directory( |
5932 | 5932 | $course, |
@@ -5946,7 +5946,7 @@ discard block |
||
5946 | 5946 | } |
5947 | 5947 | $dir = $dir.'/'; |
5948 | 5948 | if ($folder) { |
5949 | - $filepath = api_get_path(SYS_COURSE_PATH) . $course['path'] . '/document'.$dir; |
|
5949 | + $filepath = api_get_path(SYS_COURSE_PATH).$course['path'].'/document'.$dir; |
|
5950 | 5950 | } |
5951 | 5951 | } |
5952 | 5952 | $array = array( |
@@ -5988,12 +5988,12 @@ discard block |
||
5988 | 5988 | $dir = substr($dir, 1); |
5989 | 5989 | } |
5990 | 5990 | if (!empty($dir[0]) && $dir[0] != '/') { |
5991 | - $dir = '/' . $dir; |
|
5991 | + $dir = '/'.$dir; |
|
5992 | 5992 | } |
5993 | 5993 | if (isset($dir[strlen($dir) - 1]) && $dir[strlen($dir) - 1] != '/') { |
5994 | 5994 | $dir .= '/'; |
5995 | 5995 | } |
5996 | - $filepath = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document' . $dir; |
|
5996 | + $filepath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'.$dir; |
|
5997 | 5997 | |
5998 | 5998 | if (empty($_POST['dir']) && empty($_GET['dir'])) { |
5999 | 5999 | //Generates folder |
@@ -6003,7 +6003,7 @@ discard block |
||
6003 | 6003 | } |
6004 | 6004 | |
6005 | 6005 | if (!is_dir($filepath)) { |
6006 | - $filepath = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document/'; |
|
6006 | + $filepath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document/'; |
|
6007 | 6007 | $dir = '/'; |
6008 | 6008 | } |
6009 | 6009 | |
@@ -6023,10 +6023,10 @@ discard block |
||
6023 | 6023 | $tmp_filename = $filename; |
6024 | 6024 | |
6025 | 6025 | $i = 0; |
6026 | - while (file_exists($filepath . $tmp_filename . '.'.$extension)) |
|
6027 | - $tmp_filename = $filename . '_' . ++ $i; |
|
6026 | + while (file_exists($filepath.$tmp_filename.'.'.$extension)) |
|
6027 | + $tmp_filename = $filename.'_'.++ $i; |
|
6028 | 6028 | |
6029 | - $filename = $tmp_filename . '.'.$extension; |
|
6029 | + $filename = $tmp_filename.'.'.$extension; |
|
6030 | 6030 | if ($extension == 'html') { |
6031 | 6031 | $content = stripslashes($content); |
6032 | 6032 | $content = str_replace( |
@@ -6061,12 +6061,12 @@ discard block |
||
6061 | 6061 | ); |
6062 | 6062 | } |
6063 | 6063 | |
6064 | - if (!file_exists($filepath . $filename)) { |
|
6065 | - if ($fp = @ fopen($filepath . $filename, 'w')) { |
|
6064 | + if (!file_exists($filepath.$filename)) { |
|
6065 | + if ($fp = @ fopen($filepath.$filename, 'w')) { |
|
6066 | 6066 | fputs($fp, $content); |
6067 | 6067 | fclose($fp); |
6068 | 6068 | |
6069 | - $file_size = filesize($filepath . $filename); |
|
6069 | + $file_size = filesize($filepath.$filename); |
|
6070 | 6070 | $save_file_path = $dir.$filename; |
6071 | 6071 | |
6072 | 6072 | $document_id = add_document( |
@@ -6104,12 +6104,12 @@ discard block |
||
6104 | 6104 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
6105 | 6105 | $ct = ''; |
6106 | 6106 | if ($new_comment) |
6107 | - $ct .= ", comment='" . Database::escape_string($new_comment). "'"; |
|
6107 | + $ct .= ", comment='".Database::escape_string($new_comment)."'"; |
|
6108 | 6108 | if ($new_title) |
6109 | - $ct .= ", title='" . Database::escape_string(htmlspecialchars($new_title, ENT_QUOTES, $charset))."' "; |
|
6109 | + $ct .= ", title='".Database::escape_string(htmlspecialchars($new_title, ENT_QUOTES, $charset))."' "; |
|
6110 | 6110 | |
6111 | - $sql = "UPDATE " . $tbl_doc ." SET " . substr($ct, 1)." |
|
6112 | - WHERE c_id = ".$course_id." AND id = " . $document_id; |
|
6111 | + $sql = "UPDATE ".$tbl_doc." SET ".substr($ct, 1)." |
|
6112 | + WHERE c_id = ".$course_id." AND id = ".$document_id; |
|
6113 | 6113 | Database::query($sql); |
6114 | 6114 | } |
6115 | 6115 | } |
@@ -6137,42 +6137,42 @@ discard block |
||
6137 | 6137 | $dir = substr($dir, 1); |
6138 | 6138 | |
6139 | 6139 | if ($dir[0] != '/') |
6140 | - $dir = '/' . $dir; |
|
6140 | + $dir = '/'.$dir; |
|
6141 | 6141 | |
6142 | 6142 | if ($dir[strlen($dir) - 1] != '/') |
6143 | 6143 | $dir .= '/'; |
6144 | 6144 | |
6145 | - $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document' . $dir; |
|
6145 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir; |
|
6146 | 6146 | |
6147 | 6147 | if (!is_dir($filepath)) { |
6148 | - $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document/'; |
|
6148 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
6149 | 6149 | $dir = '/'; |
6150 | 6150 | } |
6151 | 6151 | |
6152 | 6152 | $table_doc = Database :: get_course_table(TABLE_DOCUMENT); |
6153 | 6153 | if (isset($_POST['path']) && !empty($_POST['path'])) { |
6154 | 6154 | $document_id = intval($_POST['path']); |
6155 | - $sql = "SELECT path FROM " . $table_doc . " |
|
6156 | - WHERE c_id = $course_id AND id = " . $document_id; |
|
6155 | + $sql = "SELECT path FROM ".$table_doc." |
|
6156 | + WHERE c_id = $course_id AND id = ".$document_id; |
|
6157 | 6157 | $res = Database::query($sql); |
6158 | 6158 | $row = Database :: fetch_array($res); |
6159 | 6159 | $content = stripslashes($_POST['content_lp']); |
6160 | - $file = $filepath . $row['path']; |
|
6160 | + $file = $filepath.$row['path']; |
|
6161 | 6161 | |
6162 | 6162 | if ($fp = @ fopen($file, 'w')) { |
6163 | - $content = str_replace(api_get_path(WEB_COURSE_PATH), $_configuration['url_append'] . '/courses/', $content); |
|
6163 | + $content = str_replace(api_get_path(WEB_COURSE_PATH), $_configuration['url_append'].'/courses/', $content); |
|
6164 | 6164 | |
6165 | 6165 | // Change the path of mp3 to absolute. |
6166 | 6166 | // The first regexp deals with :// urls. |
6167 | - $content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1" . api_get_path(REL_COURSE_PATH) . $_course['path'] . '/document/', $content); |
|
6167 | + $content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/', $content); |
|
6168 | 6168 | // The second regexp deals with audio/ urls. |
6169 | - $content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1" . api_get_path(REL_COURSE_PATH) . $_course['path'] . '/document/$2/', $content); |
|
6169 | + $content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/$2/', $content); |
|
6170 | 6170 | fputs($fp, $content); |
6171 | 6171 | fclose($fp); |
6172 | 6172 | |
6173 | - $sql = "UPDATE " . $table_doc ." SET |
|
6173 | + $sql = "UPDATE ".$table_doc." SET |
|
6174 | 6174 | title='".Database::escape_string($_POST['title'])."' |
6175 | - WHERE c_id = ".$course_id." AND id = " . $document_id; |
|
6175 | + WHERE c_id = ".$course_id." AND id = ".$document_id; |
|
6176 | 6176 | Database::query($sql); |
6177 | 6177 | } |
6178 | 6178 | } |
@@ -6190,10 +6190,10 @@ discard block |
||
6190 | 6190 | $return = ''; |
6191 | 6191 | if (is_numeric($item_id)) { |
6192 | 6192 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
6193 | - $sql = "SELECT lp.* FROM " . $tbl_lp_item . " as lp |
|
6194 | - WHERE c_id = ".$course_id." AND lp.id = " . intval($item_id); |
|
6193 | + $sql = "SELECT lp.* FROM ".$tbl_lp_item." as lp |
|
6194 | + WHERE c_id = ".$course_id." AND lp.id = ".intval($item_id); |
|
6195 | 6195 | $result = Database::query($sql); |
6196 | - while ($row = Database :: fetch_array($result,'ASSOC')) { |
|
6196 | + while ($row = Database :: fetch_array($result, 'ASSOC')) { |
|
6197 | 6197 | $_SESSION['parent_item_id'] = ($row['item_type'] == 'dokeos_chapter' || $row['item_type'] == 'dokeos_module' || $row['item_type'] == 'dir') ? $item_id : 0; |
6198 | 6198 | |
6199 | 6199 | // Prevents wrong parent selection for document, see Bug#1251. |
@@ -6220,8 +6220,8 @@ discard block |
||
6220 | 6220 | break; |
6221 | 6221 | case TOOL_DOCUMENT: |
6222 | 6222 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
6223 | - $sql_doc = "SELECT path FROM " . $tbl_doc . " |
|
6224 | - WHERE c_id = ".$course_id." AND id = " . intval($row['path']); |
|
6223 | + $sql_doc = "SELECT path FROM ".$tbl_doc." |
|
6224 | + WHERE c_id = ".$course_id." AND id = ".intval($row['path']); |
|
6225 | 6225 | $result = Database::query($sql_doc); |
6226 | 6226 | $path_file = Database::result($result, 0, 0); |
6227 | 6227 | $path_parts = pathinfo($path_file); |
@@ -6260,7 +6260,7 @@ discard block |
||
6260 | 6260 | if (is_numeric($item_id)) { |
6261 | 6261 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
6262 | 6262 | $sql = "SELECT * FROM $tbl_lp_item |
6263 | - WHERE c_id = ".$course_id." AND id = " . intval($item_id); |
|
6263 | + WHERE c_id = ".$course_id." AND id = ".intval($item_id); |
|
6264 | 6264 | $res = Database::query($sql); |
6265 | 6265 | $row = Database::fetch_array($res); |
6266 | 6266 | |
@@ -6271,21 +6271,21 @@ discard block |
||
6271 | 6271 | case 'sco' : |
6272 | 6272 | if (isset ($_GET['view']) && $_GET['view'] == 'build') { |
6273 | 6273 | $return .= $this->display_manipulate($item_id, $row['item_type']); |
6274 | - $return .= $this->display_item_form($row['item_type'], get_lang('EditCurrentChapter') . ' :', 'edit', $item_id, $row); |
|
6274 | + $return .= $this->display_item_form($row['item_type'], get_lang('EditCurrentChapter').' :', 'edit', $item_id, $row); |
|
6275 | 6275 | } else { |
6276 | - $return .= $this->display_item_small_form($row['item_type'], get_lang('EditCurrentChapter') . ' :', $row); |
|
6276 | + $return .= $this->display_item_small_form($row['item_type'], get_lang('EditCurrentChapter').' :', $row); |
|
6277 | 6277 | } |
6278 | 6278 | break; |
6279 | 6279 | case TOOL_DOCUMENT : |
6280 | 6280 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
6281 | 6281 | $sql = "SELECT lp.*, doc.path as dir |
6282 | - FROM " . $tbl_lp_item . " as lp |
|
6283 | - LEFT JOIN " . $tbl_doc . " as doc |
|
6282 | + FROM " . $tbl_lp_item." as lp |
|
6283 | + LEFT JOIN " . $tbl_doc." as doc |
|
6284 | 6284 | ON doc.id = lp.path |
6285 | 6285 | WHERE |
6286 | 6286 | lp.c_id = $course_id AND |
6287 | 6287 | doc.c_id = $course_id AND |
6288 | - lp.id = " . intval($item_id); |
|
6288 | + lp.id = ".intval($item_id); |
|
6289 | 6289 | $res_step = Database::query($sql); |
6290 | 6290 | $row_step = Database :: fetch_array($res_step); |
6291 | 6291 | $return .= $this->display_manipulate($item_id, $row['item_type']); |
@@ -6295,8 +6295,8 @@ discard block |
||
6295 | 6295 | $link_id = (string) $row['path']; |
6296 | 6296 | if (ctype_digit($link_id)) { |
6297 | 6297 | $tbl_link = Database :: get_course_table(TABLE_LINK); |
6298 | - $sql_select = 'SELECT url FROM ' . $tbl_link . ' |
|
6299 | - WHERE c_id = '.$course_id.' AND id = ' . intval($link_id); |
|
6298 | + $sql_select = 'SELECT url FROM '.$tbl_link.' |
|
6299 | + WHERE c_id = '.$course_id.' AND id = '.intval($link_id); |
|
6300 | 6300 | $res_link = Database::query($sql_select); |
6301 | 6301 | $row_link = Database :: fetch_array($res_link); |
6302 | 6302 | if (is_array($row_link)) { |
@@ -6309,9 +6309,9 @@ discard block |
||
6309 | 6309 | case 'dokeos_module' : |
6310 | 6310 | if (isset ($_GET['view']) && $_GET['view'] == 'build') { |
6311 | 6311 | $return .= $this->display_manipulate($item_id, $row['item_type']); |
6312 | - $return .= $this->display_item_form($row['item_type'], get_lang('EditCurrentModule') . ' :', 'edit', $item_id, $row); |
|
6312 | + $return .= $this->display_item_form($row['item_type'], get_lang('EditCurrentModule').' :', 'edit', $item_id, $row); |
|
6313 | 6313 | } else { |
6314 | - $return .= $this->display_item_small_form($row['item_type'], get_lang('EditCurrentModule') . ' :', $row); |
|
6314 | + $return .= $this->display_item_small_form($row['item_type'], get_lang('EditCurrentModule').' :', $row); |
|
6315 | 6315 | } |
6316 | 6316 | break; |
6317 | 6317 | case TOOL_QUIZ : |
@@ -6366,7 +6366,7 @@ discard block |
||
6366 | 6366 | |
6367 | 6367 | $headers = array( |
6368 | 6368 | Display::return_icon('folder_document.png', get_lang('Documents'), array(), ICON_SIZE_BIG), |
6369 | - Display::return_icon('quiz.png', get_lang('Quiz'), array(), ICON_SIZE_BIG), |
|
6369 | + Display::return_icon('quiz.png', get_lang('Quiz'), array(), ICON_SIZE_BIG), |
|
6370 | 6370 | Display::return_icon('links.png', get_lang('Links'), array(), ICON_SIZE_BIG), |
6371 | 6371 | Display::return_icon('works.png', get_lang('Works'), array(), ICON_SIZE_BIG), |
6372 | 6372 | Display::return_icon('forum.png', get_lang('Forums'), array(), ICON_SIZE_BIG), |
@@ -6406,16 +6406,16 @@ discard block |
||
6406 | 6406 | $course_id = api_get_course_int_id(); |
6407 | 6407 | $return = ''; |
6408 | 6408 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
6409 | - $sql_doc = "SELECT * FROM " . $tbl_doc . " |
|
6410 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
6409 | + $sql_doc = "SELECT * FROM ".$tbl_doc." |
|
6410 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
6411 | 6411 | $res_doc = Database::query($sql_doc); |
6412 | 6412 | $row_doc = Database :: fetch_array($res_doc); |
6413 | 6413 | |
6414 | 6414 | // TODO: Add a path filter. |
6415 | 6415 | if ($iframe) { |
6416 | - $return .= '<iframe id="learnpath_preview_frame" frameborder="0" height="400" width="100%" scrolling="auto" src="' . api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/document' . str_replace('%2F', '/', urlencode($row_doc['path'])) . '?' . api_get_cidreq() . '"></iframe>'; |
|
6416 | + $return .= '<iframe id="learnpath_preview_frame" frameborder="0" height="400" width="100%" scrolling="auto" src="'.api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.str_replace('%2F', '/', urlencode($row_doc['path'])).'?'.api_get_cidreq().'"></iframe>'; |
|
6417 | 6417 | } else { |
6418 | - $return .= file_get_contents(api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document' . $row_doc['path']); |
|
6418 | + $return .= file_get_contents(api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$row_doc['path']); |
|
6419 | 6419 | } |
6420 | 6420 | |
6421 | 6421 | return $return; |
@@ -6439,8 +6439,8 @@ discard block |
||
6439 | 6439 | $item_description = $extra_info['description']; |
6440 | 6440 | } elseif (is_numeric($extra_info)) { |
6441 | 6441 | $sql = "SELECT title, description |
6442 | - FROM " . $tbl_quiz . " |
|
6443 | - WHERE c_id = ".$course_id." AND id = " . $extra_info; |
|
6442 | + FROM " . $tbl_quiz." |
|
6443 | + WHERE c_id = ".$course_id." AND id = ".$extra_info; |
|
6444 | 6444 | |
6445 | 6445 | $result = Database::query($sql); |
6446 | 6446 | $row = Database::fetch_array($result); |
@@ -6450,21 +6450,21 @@ discard block |
||
6450 | 6450 | $item_title = ''; |
6451 | 6451 | $item_description = ''; |
6452 | 6452 | } |
6453 | - $item_title = Security::remove_XSS($item_title); |
|
6454 | - $item_description = Security::remove_XSS($item_description); |
|
6453 | + $item_title = Security::remove_XSS($item_title); |
|
6454 | + $item_description = Security::remove_XSS($item_description); |
|
6455 | 6455 | |
6456 | 6456 | if ($id != 0 && is_array($extra_info)) |
6457 | 6457 | $parent = $extra_info['parent_item_id']; |
6458 | 6458 | else |
6459 | 6459 | $parent = 0; |
6460 | 6460 | |
6461 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
6462 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
6461 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
6462 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
6463 | 6463 | |
6464 | 6464 | $result = Database::query($sql); |
6465 | - $arrLP = array (); |
|
6465 | + $arrLP = array(); |
|
6466 | 6466 | while ($row = Database :: fetch_array($result)) { |
6467 | - $arrLP[] = array ( |
|
6467 | + $arrLP[] = array( |
|
6468 | 6468 | 'id' => $row['id'], |
6469 | 6469 | 'item_type' => $row['item_type'], |
6470 | 6470 | 'title' => $row['title'], |
@@ -6486,7 +6486,7 @@ discard block |
||
6486 | 6486 | $arrLP = isset($this->arrMenu) ? $this->arrMenu : null; |
6487 | 6487 | unset ($this->arrMenu); |
6488 | 6488 | |
6489 | - $form = new FormValidator('quiz_form', 'POST', api_get_self() . '?' .$_SERVER['QUERY_STRING']); |
|
6489 | + $form = new FormValidator('quiz_form', 'POST', api_get_self().'?'.$_SERVER['QUERY_STRING']); |
|
6490 | 6490 | $defaults = []; |
6491 | 6491 | |
6492 | 6492 | if ($action == 'add') { |
@@ -6498,7 +6498,7 @@ discard block |
||
6498 | 6498 | } |
6499 | 6499 | |
6500 | 6500 | if (isset ($_GET['edit']) && $_GET['edit'] == 'true') { |
6501 | - $legend .= Display :: return_warning_message(get_lang('Warning') . ' ! ' . get_lang('WarningEditingDocument')); |
|
6501 | + $legend .= Display :: return_warning_message(get_lang('Warning').' ! '.get_lang('WarningEditingDocument')); |
|
6502 | 6502 | } |
6503 | 6503 | |
6504 | 6504 | $form->addHeader($legend); |
@@ -6517,7 +6517,7 @@ discard block |
||
6517 | 6517 | ); |
6518 | 6518 | $selectParent->addOption($this->name, 0); |
6519 | 6519 | |
6520 | - $arrHide = array ( |
|
6520 | + $arrHide = array( |
|
6521 | 6521 | $id |
6522 | 6522 | ); |
6523 | 6523 | for ($i = 0; $i < count($arrLP); $i++) { |
@@ -6534,7 +6534,7 @@ discard block |
||
6534 | 6534 | $selectParent->addOption( |
6535 | 6535 | $arrLP[$i]['title'], |
6536 | 6536 | $arrLP[$i]['id'], |
6537 | - ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px'] |
|
6537 | + ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px'] |
|
6538 | 6538 | ); |
6539 | 6539 | |
6540 | 6540 | if ($parent == $arrLP[$i]['id']) { |
@@ -6551,7 +6551,7 @@ discard block |
||
6551 | 6551 | ) { |
6552 | 6552 | $selectParent->addOption( |
6553 | 6553 | $arrLP[$i]['title'], |
6554 | - $arrLP[$i]['id'], ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px'] |
|
6554 | + $arrLP[$i]['id'], ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px'] |
|
6555 | 6555 | ); |
6556 | 6556 | |
6557 | 6557 | if ($parent == $arrLP[$i]['id']) { |
@@ -6569,7 +6569,7 @@ discard block |
||
6569 | 6569 | |
6570 | 6570 | for ($i = 0; $i < count($arrLP); $i++) { |
6571 | 6571 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
6572 | - $selectPrevious->addOption(get_lang('After') . ' "' . $arrLP[$i]['title'] . '"', $arrLP[$i]['id']); |
|
6572 | + $selectPrevious->addOption(get_lang('After').' "'.$arrLP[$i]['title'].'"', $arrLP[$i]['id']); |
|
6573 | 6573 | |
6574 | 6574 | if (is_array($extra_info)) { |
6575 | 6575 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
@@ -6591,7 +6591,7 @@ discard block |
||
6591 | 6591 | } |
6592 | 6592 | } |
6593 | 6593 | } |
6594 | - $arrHide = array (); |
|
6594 | + $arrHide = array(); |
|
6595 | 6595 | for ($i = 0; $i < count($arrLP); $i++) { |
6596 | 6596 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
6597 | 6597 | if (is_array($extra_info)) { |
@@ -6656,7 +6656,7 @@ discard block |
||
6656 | 6656 | |
6657 | 6657 | $form->setDefaults($defaults); |
6658 | 6658 | |
6659 | - return '<div class="sectioncomment">' . $form->returnForm() . '</div>'; |
|
6659 | + return '<div class="sectioncomment">'.$form->returnForm().'</div>'; |
|
6660 | 6660 | } |
6661 | 6661 | |
6662 | 6662 | /** |
@@ -6678,11 +6678,11 @@ discard block |
||
6678 | 6678 | } elseif (is_numeric($extra_info)) { |
6679 | 6679 | $TBL_DOCUMENT = Database :: get_course_table(TABLE_DOCUMENT); |
6680 | 6680 | |
6681 | - $sql = "SELECT * FROM " . $TBL_DOCUMENT . " |
|
6681 | + $sql = "SELECT * FROM ".$TBL_DOCUMENT." |
|
6682 | 6682 | WHERE |
6683 | 6683 | c_id = ".$course_id." AND |
6684 | - path LIKE '" . $uploadPath . "/%/%htm%' AND |
|
6685 | - id = " . (int) $extra_info . " |
|
6684 | + path LIKE '" . $uploadPath."/%/%htm%' AND |
|
6685 | + id = " . (int) $extra_info." |
|
6686 | 6686 | ORDER BY id ASC"; |
6687 | 6687 | |
6688 | 6688 | $res_hot = Database::query($sql); |
@@ -6706,11 +6706,11 @@ discard block |
||
6706 | 6706 | } |
6707 | 6707 | |
6708 | 6708 | $sql = "SELECT * FROM $tbl_lp_item |
6709 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
6709 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
6710 | 6710 | $result = Database::query($sql); |
6711 | - $arrLP = array (); |
|
6711 | + $arrLP = array(); |
|
6712 | 6712 | while ($row = Database :: fetch_array($result)) { |
6713 | - $arrLP[] = array ( |
|
6713 | + $arrLP[] = array( |
|
6714 | 6714 | 'id' => $row['id'], |
6715 | 6715 | 'item_type' => $row['item_type'], |
6716 | 6716 | 'title' => $row['title'], |
@@ -6735,7 +6735,7 @@ discard block |
||
6735 | 6735 | else |
6736 | 6736 | $legend .= get_lang('EditCurrentExecice'); |
6737 | 6737 | if (isset ($_GET['edit']) && $_GET['edit'] == 'true') { |
6738 | - $legend .= Display :: return_warning_message(get_lang('Warning') . ' ! ' . get_lang('WarningEditingDocument')); |
|
6738 | + $legend .= Display :: return_warning_message(get_lang('Warning').' ! '.get_lang('WarningEditingDocument')); |
|
6739 | 6739 | } |
6740 | 6740 | $legend .= '</legend>'; |
6741 | 6741 | |
@@ -6743,11 +6743,11 @@ discard block |
||
6743 | 6743 | $return .= $legend; |
6744 | 6744 | $return .= '<table cellpadding="0" cellspacing="0" class="lp_form">'; |
6745 | 6745 | $return .= '<tr>'; |
6746 | - $return .= '<td class="label"><label for="idParent">' . get_lang('Parent') . ' :</label></td>'; |
|
6746 | + $return .= '<td class="label"><label for="idParent">'.get_lang('Parent').' :</label></td>'; |
|
6747 | 6747 | $return .= '<td class="input">'; |
6748 | 6748 | $return .= '<select id="idParent" name="parent" onChange="javascript: load_cbo(this.value);" size="1">'; |
6749 | - $return .= '<option class="top" value="0">' . $this->name . '</option>'; |
|
6750 | - $arrHide = array ( |
|
6749 | + $return .= '<option class="top" value="0">'.$this->name.'</option>'; |
|
6750 | + $arrHide = array( |
|
6751 | 6751 | $id |
6752 | 6752 | ); |
6753 | 6753 | |
@@ -6755,13 +6755,13 @@ discard block |
||
6755 | 6755 | for ($i = 0; $i < count($arrLP); $i++) { |
6756 | 6756 | if ($action != 'add') { |
6757 | 6757 | if (($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir') && !in_array($arrLP[$i]['id'], $arrHide) && !in_array($arrLP[$i]['parent_item_id'], $arrHide)) { |
6758 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
6758 | + $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
6759 | 6759 | } else { |
6760 | 6760 | $arrHide[] = $arrLP[$i]['id']; |
6761 | 6761 | } |
6762 | 6762 | } else { |
6763 | 6763 | if ($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir') |
6764 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
6764 | + $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
6765 | 6765 | } |
6766 | 6766 | } |
6767 | 6767 | |
@@ -6772,10 +6772,10 @@ discard block |
||
6772 | 6772 | $return .= '</td>'; |
6773 | 6773 | $return .= '</tr>'; |
6774 | 6774 | $return .= '<tr>'; |
6775 | - $return .= '<td class="label"><label for="previous">' . get_lang('Position') . ' :</label></td>'; |
|
6775 | + $return .= '<td class="label"><label for="previous">'.get_lang('Position').' :</label></td>'; |
|
6776 | 6776 | $return .= '<td class="input">'; |
6777 | 6777 | $return .= '<select id="previous" name="previous" size="1">'; |
6778 | - $return .= '<option class="top" value="0">' . get_lang('FirstPosition') . '</option>'; |
|
6778 | + $return .= '<option class="top" value="0">'.get_lang('FirstPosition').'</option>'; |
|
6779 | 6779 | |
6780 | 6780 | for ($i = 0; $i < count($arrLP); $i++) { |
6781 | 6781 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
@@ -6785,7 +6785,7 @@ discard block |
||
6785 | 6785 | else |
6786 | 6786 | $selected = ''; |
6787 | 6787 | |
6788 | - $return .= '<option ' . $selected . 'value="' . $arrLP[$i]['id'] . '">' . get_lang('After') . ' "' . $arrLP[$i]['title'] . '"</option>'; |
|
6788 | + $return .= '<option '.$selected.'value="'.$arrLP[$i]['id'].'">'.get_lang('After').' "'.$arrLP[$i]['title'].'"</option>'; |
|
6789 | 6789 | } |
6790 | 6790 | } |
6791 | 6791 | |
@@ -6795,8 +6795,8 @@ discard block |
||
6795 | 6795 | |
6796 | 6796 | if ($action != 'move') { |
6797 | 6797 | $return .= '<tr>'; |
6798 | - $return .= '<td class="label"><label for="idTitle">' . get_lang('Title') . ' :</label></td>'; |
|
6799 | - $return .= '<td class="input"><input id="idTitle" name="title" type="text" value="' . $item_title . '" /></td>'; |
|
6798 | + $return .= '<td class="label"><label for="idTitle">'.get_lang('Title').' :</label></td>'; |
|
6799 | + $return .= '<td class="input"><input id="idTitle" name="title" type="text" value="'.$item_title.'" /></td>'; |
|
6800 | 6800 | $return .= '</tr>'; |
6801 | 6801 | $id_prerequisite = 0; |
6802 | 6802 | if (is_array($arrLP) && count($arrLP) > 0) { |
@@ -6807,7 +6807,7 @@ discard block |
||
6807 | 6807 | } |
6808 | 6808 | } |
6809 | 6809 | |
6810 | - $arrHide = array (); |
|
6810 | + $arrHide = array(); |
|
6811 | 6811 | for ($i = 0; $i < count($arrLP); $i++) { |
6812 | 6812 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
6813 | 6813 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
@@ -6821,22 +6821,22 @@ discard block |
||
6821 | 6821 | } |
6822 | 6822 | |
6823 | 6823 | $return .= '<tr>'; |
6824 | - $return .= '<td> </td><td><button class="save" name="submit_button" action="edit" type="submit">' . get_lang('SaveHotpotatoes') . '</button></td>'; |
|
6824 | + $return .= '<td> </td><td><button class="save" name="submit_button" action="edit" type="submit">'.get_lang('SaveHotpotatoes').'</button></td>'; |
|
6825 | 6825 | $return .= '</tr>'; |
6826 | 6826 | $return .= '</table>'; |
6827 | 6827 | |
6828 | 6828 | if ($action == 'move') { |
6829 | - $return .= '<input name="title" type="hidden" value="' . $item_title . '" />'; |
|
6830 | - $return .= '<input name="description" type="hidden" value="' . $item_description . '" />'; |
|
6829 | + $return .= '<input name="title" type="hidden" value="'.$item_title.'" />'; |
|
6830 | + $return .= '<input name="description" type="hidden" value="'.$item_description.'" />'; |
|
6831 | 6831 | } |
6832 | 6832 | |
6833 | 6833 | if (is_numeric($extra_info)) { |
6834 | - $return .= '<input name="path" type="hidden" value="' . $extra_info . '" />'; |
|
6834 | + $return .= '<input name="path" type="hidden" value="'.$extra_info.'" />'; |
|
6835 | 6835 | } elseif (is_array($extra_info)) { |
6836 | - $return .= '<input name="path" type="hidden" value="' . $extra_info['path'] . '" />'; |
|
6836 | + $return .= '<input name="path" type="hidden" value="'.$extra_info['path'].'" />'; |
|
6837 | 6837 | } |
6838 | - $return .= '<input name="type" type="hidden" value="' . TOOL_HOTPOTATOES . '" />'; |
|
6839 | - $return .= '<input name="post_time" type="hidden" value="' . time() . '" />'; |
|
6838 | + $return .= '<input name="type" type="hidden" value="'.TOOL_HOTPOTATOES.'" />'; |
|
6839 | + $return .= '<input name="post_time" type="hidden" value="'.time().'" />'; |
|
6840 | 6840 | $return .= '</form>'; |
6841 | 6841 | |
6842 | 6842 | return $return; |
@@ -6859,8 +6859,8 @@ discard block |
||
6859 | 6859 | $item_title = stripslashes($extra_info['title']); |
6860 | 6860 | } elseif (is_numeric($extra_info)) { |
6861 | 6861 | $sql = "SELECT forum_title as title, forum_comment as comment |
6862 | - FROM " . $tbl_forum . " |
|
6863 | - WHERE c_id = ".$course_id." AND forum_id = " . $extra_info; |
|
6862 | + FROM " . $tbl_forum." |
|
6863 | + WHERE c_id = ".$course_id." AND forum_id = ".$extra_info; |
|
6864 | 6864 | |
6865 | 6865 | $result = Database::query($sql); |
6866 | 6866 | $row = Database :: fetch_array($result); |
@@ -6878,7 +6878,7 @@ discard block |
||
6878 | 6878 | $parent = 0; |
6879 | 6879 | } |
6880 | 6880 | |
6881 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
6881 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
6882 | 6882 | WHERE |
6883 | 6883 | c_id = ".$course_id." AND |
6884 | 6884 | lp_id = " . $this->lp_id; |
@@ -6886,7 +6886,7 @@ discard block |
||
6886 | 6886 | $arrLP = array(); |
6887 | 6887 | |
6888 | 6888 | while ($row = Database :: fetch_array($result)) { |
6889 | - $arrLP[] = array ( |
|
6889 | + $arrLP[] = array( |
|
6890 | 6890 | 'id' => $row['id'], |
6891 | 6891 | 'item_type' => $row['item_type'], |
6892 | 6892 | 'title' => $row['title'], |
@@ -6915,7 +6915,7 @@ discard block |
||
6915 | 6915 | $legend = get_lang('EditCurrentForum'); |
6916 | 6916 | } |
6917 | 6917 | |
6918 | - $form = new FormValidator('forum_form', 'POST', api_get_self() . '?' .$_SERVER['QUERY_STRING']); |
|
6918 | + $form = new FormValidator('forum_form', 'POST', api_get_self().'?'.$_SERVER['QUERY_STRING']); |
|
6919 | 6919 | $defaults = []; |
6920 | 6920 | |
6921 | 6921 | $form->addHeader($legend); |
@@ -6944,7 +6944,7 @@ discard block |
||
6944 | 6944 | $selectParent->addOption( |
6945 | 6945 | $arrLP[$i]['title'], |
6946 | 6946 | $arrLP[$i]['id'], |
6947 | - ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px'] |
|
6947 | + ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px'] |
|
6948 | 6948 | ); |
6949 | 6949 | |
6950 | 6950 | if ($parent == $arrLP[$i]['id']) { |
@@ -6962,7 +6962,7 @@ discard block |
||
6962 | 6962 | $selectParent->addOption( |
6963 | 6963 | $arrLP[$i]['title'], |
6964 | 6964 | $arrLP[$i]['id'], |
6965 | - ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px'] |
|
6965 | + ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px'] |
|
6966 | 6966 | ); |
6967 | 6967 | |
6968 | 6968 | if ($parent == $arrLP[$i]['id']) { |
@@ -6985,7 +6985,7 @@ discard block |
||
6985 | 6985 | |
6986 | 6986 | for ($i = 0; $i < count($arrLP); $i++) { |
6987 | 6987 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
6988 | - $selectPrevious->addOption(get_lang('After') . ' "' . $arrLP[$i]['title'] . '"', $arrLP[$i]['id']); |
|
6988 | + $selectPrevious->addOption(get_lang('After').' "'.$arrLP[$i]['title'].'"', $arrLP[$i]['id']); |
|
6989 | 6989 | |
6990 | 6990 | if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
6991 | 6991 | $selectPrevious->setSelected($arrLP[$i]['id']); |
@@ -7037,7 +7037,7 @@ discard block |
||
7037 | 7037 | $form->addHidden('post_time', time()); |
7038 | 7038 | $form->setDefaults($defaults); |
7039 | 7039 | |
7040 | - return '<div class="sectioncomment">' . $form->returnForm() . '</div>'; |
|
7040 | + return '<div class="sectioncomment">'.$form->returnForm().'</div>'; |
|
7041 | 7041 | } |
7042 | 7042 | |
7043 | 7043 | /** |
@@ -7060,7 +7060,7 @@ discard block |
||
7060 | 7060 | $item_title = stripslashes($extra_info['title']); |
7061 | 7061 | } elseif (is_numeric($extra_info)) { |
7062 | 7062 | $sql = "SELECT thread_title as title FROM $tbl_forum |
7063 | - WHERE c_id = $course_id AND thread_id = " . $extra_info; |
|
7063 | + WHERE c_id = $course_id AND thread_id = ".$extra_info; |
|
7064 | 7064 | |
7065 | 7065 | $result = Database::query($sql); |
7066 | 7066 | $row = Database :: fetch_array($result); |
@@ -7078,15 +7078,15 @@ discard block |
||
7078 | 7078 | $parent = 0; |
7079 | 7079 | } |
7080 | 7080 | |
7081 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
7082 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
7081 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
7082 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
7083 | 7083 | |
7084 | 7084 | $result = Database::query($sql); |
7085 | 7085 | |
7086 | - $arrLP = array (); |
|
7086 | + $arrLP = array(); |
|
7087 | 7087 | |
7088 | 7088 | while ($row = Database :: fetch_array($result)) { |
7089 | - $arrLP[] = array ( |
|
7089 | + $arrLP[] = array( |
|
7090 | 7090 | 'id' => $row['id'], |
7091 | 7091 | 'item_type' => $row['item_type'], |
7092 | 7092 | 'title' => $row['title'], |
@@ -7107,7 +7107,7 @@ discard block |
||
7107 | 7107 | $arrLP = isset($this->arrMenu) ? $this->arrMenu : null; |
7108 | 7108 | unset ($this->arrMenu); |
7109 | 7109 | |
7110 | - $form = new FormValidator('thread_form', 'POST', api_get_self() . '?' .$_SERVER['QUERY_STRING']); |
|
7110 | + $form = new FormValidator('thread_form', 'POST', api_get_self().'?'.$_SERVER['QUERY_STRING']); |
|
7111 | 7111 | $defaults = []; |
7112 | 7112 | |
7113 | 7113 | if ($action == 'add') { |
@@ -7127,7 +7127,7 @@ discard block |
||
7127 | 7127 | ); |
7128 | 7128 | $selectParent->addOption($this->name, 0); |
7129 | 7129 | |
7130 | - $arrHide = array ( |
|
7130 | + $arrHide = array( |
|
7131 | 7131 | $id |
7132 | 7132 | ); |
7133 | 7133 | |
@@ -7145,7 +7145,7 @@ discard block |
||
7145 | 7145 | $selectParent->addOption( |
7146 | 7146 | $arrLP[$i]['title'], |
7147 | 7147 | $arrLP[$i]['id'], |
7148 | - ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px'] |
|
7148 | + ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px'] |
|
7149 | 7149 | ); |
7150 | 7150 | |
7151 | 7151 | if ($parent == $arrLP[$i]['id']) { |
@@ -7163,7 +7163,7 @@ discard block |
||
7163 | 7163 | $selectParent->addOption( |
7164 | 7164 | $arrLP[$i]['title'], |
7165 | 7165 | $arrLP[$i]['id'], |
7166 | - ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px'] |
|
7166 | + ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px'] |
|
7167 | 7167 | ); |
7168 | 7168 | |
7169 | 7169 | if ($parent == $arrLP[$i]['id']) { |
@@ -7183,7 +7183,7 @@ discard block |
||
7183 | 7183 | for ($i = 0; $i < count($arrLP); $i++) { |
7184 | 7184 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
7185 | 7185 | $selectPrevious->addOption( |
7186 | - get_lang('After') . ' "' . $arrLP[$i]['title'] . '"', |
|
7186 | + get_lang('After').' "'.$arrLP[$i]['title'].'"', |
|
7187 | 7187 | $arrLP[$i]['id'] |
7188 | 7188 | ); |
7189 | 7189 | |
@@ -7281,10 +7281,10 @@ discard block |
||
7281 | 7281 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
7282 | 7282 | |
7283 | 7283 | if ($id != 0 && is_array($extra_info)) { |
7284 | - $item_title = $extra_info['title']; |
|
7285 | - $item_description = $extra_info['description']; |
|
7286 | - $item_path = api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/scorm/' . $this->path . '/' . stripslashes($extra_info['path']); |
|
7287 | - $item_path_fck = '/scorm/' . $this->path . '/' . stripslashes($extra_info['path']); |
|
7284 | + $item_title = $extra_info['title']; |
|
7285 | + $item_description = $extra_info['description']; |
|
7286 | + $item_path = api_get_path(WEB_COURSE_PATH).$_course['path'].'/scorm/'.$this->path.'/'.stripslashes($extra_info['path']); |
|
7287 | + $item_path_fck = '/scorm/'.$this->path.'/'.stripslashes($extra_info['path']); |
|
7288 | 7288 | } else { |
7289 | 7289 | $item_title = ''; |
7290 | 7290 | $item_description = ''; |
@@ -7298,17 +7298,17 @@ discard block |
||
7298 | 7298 | } |
7299 | 7299 | |
7300 | 7300 | $id = intval($id); |
7301 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
7301 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
7302 | 7302 | WHERE |
7303 | 7303 | c_id = ".$course_id." AND |
7304 | - lp_id = " . $this->lp_id . " AND |
|
7304 | + lp_id = " . $this->lp_id." AND |
|
7305 | 7305 | id != $id"; |
7306 | 7306 | |
7307 | 7307 | if ($item_type == 'module') |
7308 | 7308 | $sql .= " AND parent_item_id = 0"; |
7309 | 7309 | |
7310 | 7310 | $result = Database::query($sql); |
7311 | - $arrLP = array (); |
|
7311 | + $arrLP = array(); |
|
7312 | 7312 | |
7313 | 7313 | while ($row = Database :: fetch_array($result)) { |
7314 | 7314 | $arrLP[] = array( |
@@ -7336,9 +7336,9 @@ discard block |
||
7336 | 7336 | |
7337 | 7337 | $gradebook = isset($_GET['gradebook']) ? Security :: remove_XSS($_GET['gradebook']) : null; |
7338 | 7338 | |
7339 | - $url = api_get_self() . '?' .api_get_cidreq().'&gradeboook='.$gradebook.'&action='.$action.'&type='.$item_type.'&lp_id='.$this->lp_id; |
|
7339 | + $url = api_get_self().'?'.api_get_cidreq().'&gradeboook='.$gradebook.'&action='.$action.'&type='.$item_type.'&lp_id='.$this->lp_id; |
|
7340 | 7340 | |
7341 | - $form = new FormValidator('form', 'POST', $url); |
|
7341 | + $form = new FormValidator('form', 'POST', $url); |
|
7342 | 7342 | |
7343 | 7343 | $defaults['title'] = api_html_entity_decode($item_title, ENT_QUOTES, $charset); |
7344 | 7344 | $defaults['description'] = $item_description; |
@@ -7382,7 +7382,7 @@ discard block |
||
7382 | 7382 | $parent_select = $form->addElement('select', 'parent', get_lang('Parent'), '', array('id' => 'idParent', 'onchange' => "javascript: load_cbo(this.value);")); |
7383 | 7383 | |
7384 | 7384 | foreach ($arrHide as $key => $value) { |
7385 | - $parent_select->addOption($value['value'], $key, 'style="padding-left:' . $value['padding'] . 'px;"'); |
|
7385 | + $parent_select->addOption($value['value'], $key, 'style="padding-left:'.$value['padding'].'px;"'); |
|
7386 | 7386 | } |
7387 | 7387 | if (!empty($s_selected_parent)) { |
7388 | 7388 | $parent_select->setSelected($s_selected_parent); |
@@ -7404,16 +7404,16 @@ discard block |
||
7404 | 7404 | $s_selected_position = $arrLP[$i]['id']; |
7405 | 7405 | } |
7406 | 7406 | |
7407 | - $arrHide[$arrLP[$i]['id']]['value'] = get_lang('After') . ' "' . $arrLP[$i]['title'] . '"'; |
|
7407 | + $arrHide[$arrLP[$i]['id']]['value'] = get_lang('After').' "'.$arrLP[$i]['title'].'"'; |
|
7408 | 7408 | } |
7409 | 7409 | } |
7410 | 7410 | |
7411 | 7411 | $position = $form->addElement('select', 'previous', get_lang('Position'), '', array('id' => 'previous')); |
7412 | 7412 | $padding = isset($value['padding']) ? $value['padding'] : 0; |
7413 | - $position->addOption(get_lang('FirstPosition'), 0, 'style="padding-left:' . $padding . 'px;"'); |
|
7413 | + $position->addOption(get_lang('FirstPosition'), 0, 'style="padding-left:'.$padding.'px;"'); |
|
7414 | 7414 | |
7415 | 7415 | foreach ($arrHide as $key => $value) { |
7416 | - $position->addOption($value['value'] . '"', $key, 'style="padding-left:' . $padding . 'px;"'); |
|
7416 | + $position->addOption($value['value'].'"', $key, 'style="padding-left:'.$padding.'px;"'); |
|
7417 | 7417 | } |
7418 | 7418 | |
7419 | 7419 | if (!empty ($s_selected_position)) { |
@@ -7442,23 +7442,23 @@ discard block |
||
7442 | 7442 | //assets can't be modified |
7443 | 7443 | |
7444 | 7444 | //$item_type == 'asset' || |
7445 | - if (( $item_type == 'sco') && ($extension == 'html' || $extension == 'htm')) { |
|
7445 | + if (($item_type == 'sco') && ($extension == 'html' || $extension == 'htm')) { |
|
7446 | 7446 | |
7447 | 7447 | if ($item_type == 'sco') { |
7448 | - $form->addElement('html', '<script type="text/javascript">alert("' . get_lang('WarningWhenEditingScorm') . '")</script>'); |
|
7448 | + $form->addElement('html', '<script type="text/javascript">alert("'.get_lang('WarningWhenEditingScorm').'")</script>'); |
|
7449 | 7449 | } |
7450 | 7450 | $renderer = $form->defaultRenderer(); |
7451 | 7451 | $renderer->setElementTemplate('<br /> {label}<br />{element}', 'content_lp'); |
7452 | 7452 | |
7453 | 7453 | $relative_prefix = ''; |
7454 | 7454 | |
7455 | - $editor_config = array( 'ToolbarSet' => 'LearningPathDocuments', |
|
7455 | + $editor_config = array('ToolbarSet' => 'LearningPathDocuments', |
|
7456 | 7456 | 'Width' => '100%', |
7457 | 7457 | 'Height' => '500', |
7458 | 7458 | 'FullPage' => true, |
7459 | 7459 | 'CreateDocumentDir' => $relative_prefix, |
7460 | - 'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH) . api_get_course_path().'/scorm/', |
|
7461 | - 'BaseHref' => api_get_path(WEB_COURSE_PATH) . api_get_course_path().$item_path_fck |
|
7460 | + 'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/scorm/', |
|
7461 | + 'BaseHref' => api_get_path(WEB_COURSE_PATH).api_get_course_path().$item_path_fck |
|
7462 | 7462 | ); |
7463 | 7463 | |
7464 | 7464 | $form->addElement('html_editor', 'content_lp', '', null, $editor_config); |
@@ -7467,7 +7467,7 @@ discard block |
||
7467 | 7467 | $defaults['content_lp'] = file_get_contents($content_path); |
7468 | 7468 | } |
7469 | 7469 | |
7470 | - $form->addElement('hidden', 'type', 'dokeos_' . $item_type); |
|
7470 | + $form->addElement('hidden', 'type', 'dokeos_'.$item_type); |
|
7471 | 7471 | $form->addElement('hidden', 'post_time', time()); |
7472 | 7472 | $form->setDefaults($defaults); |
7473 | 7473 | return $form->return_form(); |
@@ -7505,8 +7505,8 @@ discard block |
||
7505 | 7505 | // We don't display the document form if it's not an editable document (html or txt file). |
7506 | 7506 | if ($action == "add") { |
7507 | 7507 | if (is_numeric($extra_info)) { |
7508 | - $sql_doc = "SELECT path FROM " . $tbl_doc . " |
|
7509 | - WHERE c_id = ".$course_id." AND id = " . intval($extra_info); |
|
7508 | + $sql_doc = "SELECT path FROM ".$tbl_doc." |
|
7509 | + WHERE c_id = ".$course_id." AND id = ".intval($extra_info); |
|
7510 | 7510 | $result = Database::query($sql_doc); |
7511 | 7511 | $path_file = Database :: result($result, 0, 0); |
7512 | 7512 | $path_parts = pathinfo($path_file); |
@@ -7524,13 +7524,13 @@ discard block |
||
7524 | 7524 | $item_title = stripslashes($path_parts['filename']); |
7525 | 7525 | } |
7526 | 7526 | } elseif (is_numeric($extra_info)) { |
7527 | - $sql_doc = "SELECT path, title FROM " . $tbl_doc . " |
|
7527 | + $sql_doc = "SELECT path, title FROM ".$tbl_doc." |
|
7528 | 7528 | WHERE |
7529 | 7529 | c_id = ".$course_id." AND |
7530 | 7530 | id = " . intval($extra_info); |
7531 | 7531 | |
7532 | 7532 | $result = Database::query($sql_doc); |
7533 | - $row = Database::fetch_array($result); |
|
7533 | + $row = Database::fetch_array($result); |
|
7534 | 7534 | $item_title = $row['title']; |
7535 | 7535 | $item_title = str_replace('_', ' ', $item_title); |
7536 | 7536 | if (empty ($item_title)) { |
@@ -7549,11 +7549,11 @@ discard block |
||
7549 | 7549 | $parent = 0; |
7550 | 7550 | } |
7551 | 7551 | |
7552 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
7553 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
7552 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
7553 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
7554 | 7554 | |
7555 | 7555 | $result = Database::query($sql); |
7556 | - $arrLP = array (); |
|
7556 | + $arrLP = array(); |
|
7557 | 7557 | while ($row = Database :: fetch_array($result)) { |
7558 | 7558 | $arrLP[] = array( |
7559 | 7559 | 'id' => $row['id'], |
@@ -7587,9 +7587,9 @@ discard block |
||
7587 | 7587 | $return .= '</legend>'; |
7588 | 7588 | |
7589 | 7589 | if (isset ($_GET['edit']) && $_GET['edit'] == 'true') { |
7590 | - $return .= Display :: return_warning_message('<strong>' . get_lang('Warning') . ' !</strong><br />' . get_lang('WarningEditingDocument'), false); |
|
7590 | + $return .= Display :: return_warning_message('<strong>'.get_lang('Warning').' !</strong><br />'.get_lang('WarningEditingDocument'), false); |
|
7591 | 7591 | } |
7592 | - $form = new FormValidator('form', 'POST', api_get_self() . '?' .$_SERVER['QUERY_STRING'], '', array('enctype'=> "multipart/form-data")); |
|
7592 | + $form = new FormValidator('form', 'POST', api_get_self().'?'.$_SERVER['QUERY_STRING'], '', array('enctype'=> "multipart/form-data")); |
|
7593 | 7593 | $defaults['title'] = Security :: remove_XSS($item_title); |
7594 | 7594 | if (empty($item_title)) { |
7595 | 7595 | $defaults['title'] = Security::remove_XSS($item_title); |
@@ -7625,15 +7625,15 @@ discard block |
||
7625 | 7625 | } |
7626 | 7626 | |
7627 | 7627 | $parent_select = $form->addSelect('parent', get_lang('Parent'), [], ['id' => 'idParent', 'onchange' => 'javascript: load_cbo(this.value);']); |
7628 | - $my_count=0; |
|
7628 | + $my_count = 0; |
|
7629 | 7629 | foreach ($arrHide as $key => $value) { |
7630 | - if ($my_count!=0) { |
|
7630 | + if ($my_count != 0) { |
|
7631 | 7631 | // The LP name is also the first section and is not in the same charset like the other sections. |
7632 | 7632 | $value['value'] = Security :: remove_XSS($value['value']); |
7633 | - $parent_select->addOption($value['value'], $key, 'style="padding-left:' . $value['padding'] . 'px;"'); |
|
7633 | + $parent_select->addOption($value['value'], $key, 'style="padding-left:'.$value['padding'].'px;"'); |
|
7634 | 7634 | } else { |
7635 | 7635 | $value['value'] = Security :: remove_XSS($value['value']); |
7636 | - $parent_select->addOption($value['value'], $key, 'style="padding-left:' . $value['padding'] . 'px;"'); |
|
7636 | + $parent_select->addOption($value['value'], $key, 'style="padding-left:'.$value['padding'].'px;"'); |
|
7637 | 7637 | } |
7638 | 7638 | $my_count++; |
7639 | 7639 | } |
@@ -7641,7 +7641,7 @@ discard block |
||
7641 | 7641 | if (!empty($id)) { |
7642 | 7642 | $parent_select->setSelected($parent); |
7643 | 7643 | } else { |
7644 | - $parent_item_id = isset($_SESSION['parent_item_id']) ? $_SESSION['parent_item_id'] : 0 ; |
|
7644 | + $parent_item_id = isset($_SESSION['parent_item_id']) ? $_SESSION['parent_item_id'] : 0; |
|
7645 | 7645 | $parent_select->setSelected($parent_item_id); |
7646 | 7646 | } |
7647 | 7647 | |
@@ -7658,7 +7658,7 @@ discard block |
||
7658 | 7658 | if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) |
7659 | 7659 | $s_selected_position = $arrLP[$i]['id']; |
7660 | 7660 | elseif ($action == 'add') $s_selected_position = $arrLP[$i]['id']; |
7661 | - $arrHide[$arrLP[$i]['id']]['value'] = get_lang('After') . ' "' . $arrLP[$i]['title'] . '"'; |
|
7661 | + $arrHide[$arrLP[$i]['id']]['value'] = get_lang('After').' "'.$arrLP[$i]['title'].'"'; |
|
7662 | 7662 | } |
7663 | 7663 | } |
7664 | 7664 | |
@@ -7666,8 +7666,8 @@ discard block |
||
7666 | 7666 | $position->addOption(get_lang('FirstPosition'), 0); |
7667 | 7667 | |
7668 | 7668 | foreach ($arrHide as $key => $value) { |
7669 | - $padding = isset($value['padding']) ? $value['padding']: 20; |
|
7670 | - $position->addOption($value['value'], $key, 'style="padding-left:' . $padding . 'px;"'); |
|
7669 | + $padding = isset($value['padding']) ? $value['padding'] : 20; |
|
7670 | + $position->addOption($value['value'], $key, 'style="padding-left:'.$padding.'px;"'); |
|
7671 | 7671 | } |
7672 | 7672 | $position->setSelected($s_selected_position); |
7673 | 7673 | |
@@ -7737,7 +7737,7 @@ discard block |
||
7737 | 7737 | $relative_path = array_slice($relative_path, 1, $cnt); |
7738 | 7738 | $relative_path = implode('/', $relative_path); |
7739 | 7739 | if (strlen($relative_path) > 0) { |
7740 | - $relative_path = $relative_path . '/'; |
|
7740 | + $relative_path = $relative_path.'/'; |
|
7741 | 7741 | } |
7742 | 7742 | } else { |
7743 | 7743 | $result = $this->generate_lp_folder($_course); |
@@ -7751,8 +7751,8 @@ discard block |
||
7751 | 7751 | 'Height' => '500', |
7752 | 7752 | 'FullPage' => true, |
7753 | 7753 | 'CreateDocumentDir' => $relative_prefix, |
7754 | - 'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH) . api_get_course_path().'/document/', |
|
7755 | - 'BaseHref' => api_get_path(WEB_COURSE_PATH) . api_get_course_path().'/document/'.$relative_path |
|
7754 | + 'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/', |
|
7755 | + 'BaseHref' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/'.$relative_path |
|
7756 | 7756 | ); |
7757 | 7757 | |
7758 | 7758 | if ($_GET['action'] == 'add_item') { |
@@ -7819,8 +7819,8 @@ discard block |
||
7819 | 7819 | $item_url = stripslashes($extra_info['url']); |
7820 | 7820 | } elseif (is_numeric($extra_info)) { |
7821 | 7821 | $extra_info = intval($extra_info); |
7822 | - $sql = "SELECT title, description, url FROM " . $tbl_link . " |
|
7823 | - WHERE c_id = ".$course_id." AND id = " . $extra_info; |
|
7822 | + $sql = "SELECT title, description, url FROM ".$tbl_link." |
|
7823 | + WHERE c_id = ".$course_id." AND id = ".$extra_info; |
|
7824 | 7824 | $result = Database::query($sql); |
7825 | 7825 | $row = Database :: fetch_array($result); |
7826 | 7826 | $item_title = $row['title']; |
@@ -7832,7 +7832,7 @@ discard block |
||
7832 | 7832 | $item_url = ''; |
7833 | 7833 | } |
7834 | 7834 | |
7835 | - $form = new FormValidator('edit_link', 'POST', api_get_self() . '?' .$_SERVER['QUERY_STRING']); |
|
7835 | + $form = new FormValidator('edit_link', 'POST', api_get_self().'?'.$_SERVER['QUERY_STRING']); |
|
7836 | 7836 | $defaults = []; |
7837 | 7837 | |
7838 | 7838 | if ($id != 0 && is_array($extra_info)) { |
@@ -7841,8 +7841,8 @@ discard block |
||
7841 | 7841 | $parent = 0; |
7842 | 7842 | } |
7843 | 7843 | |
7844 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
7845 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
7844 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
7845 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
7846 | 7846 | $result = Database::query($sql); |
7847 | 7847 | $arrLP = array(); |
7848 | 7848 | |
@@ -7910,7 +7910,7 @@ discard block |
||
7910 | 7910 | $selectParent->addOption( |
7911 | 7911 | $arrLP[$i]['title'], |
7912 | 7912 | $arrLP[$i]['id'], |
7913 | - ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px;'] |
|
7913 | + ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px;'] |
|
7914 | 7914 | ); |
7915 | 7915 | |
7916 | 7916 | if ($parent == $arrLP[$i]['id']) { |
@@ -7924,7 +7924,7 @@ discard block |
||
7924 | 7924 | $selectParent->addOption( |
7925 | 7925 | $arrLP[$i]['title'], |
7926 | 7926 | $arrLP[$i]['id'], |
7927 | - ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px'] |
|
7927 | + ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px'] |
|
7928 | 7928 | ); |
7929 | 7929 | |
7930 | 7930 | if ($parent_item_id == $arrLP[$i]['id']) { |
@@ -8011,7 +8011,7 @@ discard block |
||
8011 | 8011 | |
8012 | 8012 | $form->setDefaults($defaults); |
8013 | 8013 | |
8014 | - return '<div class="sectioncomment">' . $form->returnForm() . '</div>'; |
|
8014 | + return '<div class="sectioncomment">'.$form->returnForm().'</div>'; |
|
8015 | 8015 | } |
8016 | 8016 | |
8017 | 8017 | /** |
@@ -8033,8 +8033,8 @@ discard block |
||
8033 | 8033 | } elseif (is_numeric($extra_info)) { |
8034 | 8034 | $extra_info = intval($extra_info); |
8035 | 8035 | $sql = "SELECT title, description |
8036 | - FROM " . $tbl_publication . " |
|
8037 | - WHERE c_id = ".$course_id." AND id = " . $extra_info; |
|
8036 | + FROM " . $tbl_publication." |
|
8037 | + WHERE c_id = ".$course_id." AND id = ".$extra_info; |
|
8038 | 8038 | |
8039 | 8039 | $result = Database::query($sql); |
8040 | 8040 | $row = Database :: fetch_array($result); |
@@ -8050,13 +8050,13 @@ discard block |
||
8050 | 8050 | $parent = 0; |
8051 | 8051 | } |
8052 | 8052 | |
8053 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
8054 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
8053 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
8054 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
8055 | 8055 | |
8056 | 8056 | $result = Database::query($sql); |
8057 | 8057 | $arrLP = array(); |
8058 | 8058 | while ($row = Database :: fetch_array($result)) { |
8059 | - $arrLP[] = array ( |
|
8059 | + $arrLP[] = array( |
|
8060 | 8060 | 'id' => $row['id'], |
8061 | 8061 | 'item_type' => $row['item_type'], |
8062 | 8062 | 'title' => $row['title'], |
@@ -8102,7 +8102,7 @@ discard block |
||
8102 | 8102 | ] |
8103 | 8103 | ); |
8104 | 8104 | |
8105 | - $arrHide = array ( |
|
8105 | + $arrHide = array( |
|
8106 | 8106 | $id |
8107 | 8107 | ); |
8108 | 8108 | |
@@ -8120,7 +8120,7 @@ discard block |
||
8120 | 8120 | $parentSelect->addOption( |
8121 | 8121 | $arrLP[$i]['title'], |
8122 | 8122 | $arrLP[$i]['id'], |
8123 | - ['style' => 'padding-left: ' . (($arrLP[$i]['depth'] * 10) + 20) . 'px;'] |
|
8123 | + ['style' => 'padding-left: '.(($arrLP[$i]['depth'] * 10) + 20).'px;'] |
|
8124 | 8124 | ); |
8125 | 8125 | |
8126 | 8126 | if ($parent == $arrLP[$i]['id']) { |
@@ -8137,7 +8137,7 @@ discard block |
||
8137 | 8137 | $parentSelect->addOption( |
8138 | 8138 | $arrLP[$i]['title'], |
8139 | 8139 | $arrLP[$i]['id'], |
8140 | - ['style' => 'padding-left: ' . (($arrLP[$i]['depth'] * 10) + 20) . 'px;'] |
|
8140 | + ['style' => 'padding-left: '.(($arrLP[$i]['depth'] * 10) + 20).'px;'] |
|
8141 | 8141 | ); |
8142 | 8142 | |
8143 | 8143 | if ($parent == $arrLP[$i]['id']) { |
@@ -8161,7 +8161,7 @@ discard block |
||
8161 | 8161 | for ($i = 0; $i < count($arrLP); $i++) { |
8162 | 8162 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
8163 | 8163 | $previousSelect->addOption( |
8164 | - get_lang('After') . ' "' . $arrLP[$i]['title'] . '"', |
|
8164 | + get_lang('After').' "'.$arrLP[$i]['title'].'"', |
|
8165 | 8165 | $arrLP[$i]['id'] |
8166 | 8166 | ); |
8167 | 8167 | |
@@ -8183,7 +8183,7 @@ discard block |
||
8183 | 8183 | } |
8184 | 8184 | } |
8185 | 8185 | } |
8186 | - $arrHide = array (); |
|
8186 | + $arrHide = array(); |
|
8187 | 8187 | for ($i = 0; $i < count($arrLP); $i++) { |
8188 | 8188 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
8189 | 8189 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
@@ -8275,8 +8275,8 @@ discard block |
||
8275 | 8275 | |
8276 | 8276 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
8277 | 8277 | $item_id = intval($item_id); |
8278 | - $sql = "SELECT * FROM " . $tbl_lp_item . " as lp |
|
8279 | - WHERE lp.c_id = ".$course_id." AND lp.id = " . $item_id; |
|
8278 | + $sql = "SELECT * FROM ".$tbl_lp_item." as lp |
|
8279 | + WHERE lp.c_id = ".$course_id." AND lp.id = ".$item_id; |
|
8280 | 8280 | $result = Database::query($sql); |
8281 | 8281 | $row = Database::fetch_assoc($result); |
8282 | 8282 | |
@@ -8290,16 +8290,16 @@ discard block |
||
8290 | 8290 | $audio_player .= '<script> |
8291 | 8291 | var s1 = new SWFObject("../inc/lib/mediaplayer/player.swf","ply","250","20","9","#FFFFFF"); |
8292 | 8292 | s1.addParam("allowscriptaccess","always"); |
8293 | - s1.addParam("flashvars","file=../../courses/' . $_course['path'] . '/document/audio/' . $row['audio'] . '&autostart=true"); |
|
8293 | + s1.addParam("flashvars","file=../../courses/' . $_course['path'].'/document/audio/'.$row['audio'].'&autostart=true"); |
|
8294 | 8294 | s1.write("container"); |
8295 | 8295 | </script>'; |
8296 | 8296 | } |
8297 | 8297 | |
8298 | - $url = api_get_self().'?cidReq='.Security::remove_XSS($_GET['cidReq']).'&view=build&id='.$item_id .'&lp_id='.$this->lp_id; |
|
8298 | + $url = api_get_self().'?cidReq='.Security::remove_XSS($_GET['cidReq']).'&view=build&id='.$item_id.'&lp_id='.$this->lp_id; |
|
8299 | 8299 | |
8300 | 8300 | $return .= Display::url( |
8301 | 8301 | Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL), |
8302 | - $url.'&action=edit_item&path_item=' . $row['path'] |
|
8302 | + $url.'&action=edit_item&path_item='.$row['path'] |
|
8303 | 8303 | ); |
8304 | 8304 | |
8305 | 8305 | $return .= Display::url( |
@@ -8319,12 +8319,12 @@ discard block |
||
8319 | 8319 | $url.'&action=delete_item' |
8320 | 8320 | ); |
8321 | 8321 | |
8322 | - if ($item_type == TOOL_HOTPOTATOES ) { |
|
8322 | + if ($item_type == TOOL_HOTPOTATOES) { |
|
8323 | 8323 | $document_data = DocumentManager::get_document_data_by_id($row['path'], $course_code); |
8324 | 8324 | $return .= get_lang('File').': '.$document_data['absolute_path_from_document']; |
8325 | 8325 | } |
8326 | 8326 | |
8327 | - if ($item_type == TOOL_DOCUMENT ) { |
|
8327 | + if ($item_type == TOOL_DOCUMENT) { |
|
8328 | 8328 | $document_data = DocumentManager::get_document_data_by_id($row['path'], $course_code); |
8329 | 8329 | $return .= get_lang('File').': '.$document_data['absolute_path_from_document']; |
8330 | 8330 | } |
@@ -8345,13 +8345,13 @@ discard block |
||
8345 | 8345 | public function get_js_dropdown_array() |
8346 | 8346 | { |
8347 | 8347 | $course_id = api_get_course_int_id(); |
8348 | - $return = 'var child_name = new Array();' . "\n"; |
|
8349 | - $return .= 'var child_value = new Array();' . "\n\n"; |
|
8350 | - $return .= 'child_name[0] = new Array();' . "\n"; |
|
8351 | - $return .= 'child_value[0] = new Array();' . "\n\n"; |
|
8348 | + $return = 'var child_name = new Array();'."\n"; |
|
8349 | + $return .= 'var child_value = new Array();'."\n\n"; |
|
8350 | + $return .= 'child_name[0] = new Array();'."\n"; |
|
8351 | + $return .= 'child_value[0] = new Array();'."\n\n"; |
|
8352 | 8352 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
8353 | - $sql_zero = "SELECT * FROM " . $tbl_lp_item . " |
|
8354 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id . " AND parent_item_id = 0 |
|
8353 | + $sql_zero = "SELECT * FROM ".$tbl_lp_item." |
|
8354 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id." AND parent_item_id = 0 |
|
8355 | 8355 | ORDER BY display_order ASC"; |
8356 | 8356 | $res_zero = Database::query($sql_zero); |
8357 | 8357 | $i = 0; |
@@ -8361,28 +8361,28 @@ discard block |
||
8361 | 8361 | $row_zero['title'] = Exercise::get_formated_title_variable($row_zero['title']); |
8362 | 8362 | } |
8363 | 8363 | $js_var = json_encode(get_lang('After').' '.$row_zero['title']); |
8364 | - $return .= 'child_name[0][' . $i . '] = '.$js_var.' ;' . "\n"; |
|
8365 | - $return .= 'child_value[0][' . $i++ . '] = "' . $row_zero['id'] . '";' . "\n"; |
|
8364 | + $return .= 'child_name[0]['.$i.'] = '.$js_var.' ;'."\n"; |
|
8365 | + $return .= 'child_value[0]['.$i++.'] = "'.$row_zero['id'].'";'."\n"; |
|
8366 | 8366 | } |
8367 | 8367 | $return .= "\n"; |
8368 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
8369 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
8368 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
8369 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
8370 | 8370 | $res = Database::query($sql); |
8371 | 8371 | while ($row = Database :: fetch_array($res)) { |
8372 | - $sql_parent = "SELECT * FROM " . $tbl_lp_item . " |
|
8372 | + $sql_parent = "SELECT * FROM ".$tbl_lp_item." |
|
8373 | 8373 | WHERE |
8374 | 8374 | c_id = ".$course_id." AND |
8375 | - parent_item_id = " . $row['id'] . " |
|
8375 | + parent_item_id = " . $row['id']." |
|
8376 | 8376 | ORDER BY display_order ASC"; |
8377 | 8377 | $res_parent = Database::query($sql_parent); |
8378 | 8378 | $i = 0; |
8379 | - $return .= 'child_name[' . $row['id'] . '] = new Array();' . "\n"; |
|
8380 | - $return .= 'child_value[' . $row['id'] . '] = new Array();' . "\n\n"; |
|
8379 | + $return .= 'child_name['.$row['id'].'] = new Array();'."\n"; |
|
8380 | + $return .= 'child_value['.$row['id'].'] = new Array();'."\n\n"; |
|
8381 | 8381 | |
8382 | 8382 | while ($row_parent = Database :: fetch_array($res_parent)) { |
8383 | 8383 | $js_var = json_encode(get_lang('After').' '.$row_parent['title']); |
8384 | - $return .= 'child_name[' . $row['id'] . '][' . $i . '] = '.$js_var.' ;' . "\n"; |
|
8385 | - $return .= 'child_value[' . $row['id'] . '][' . $i++ . '] = "' . $row_parent['id'] . '";' . "\n"; |
|
8384 | + $return .= 'child_name['.$row['id'].']['.$i.'] = '.$js_var.' ;'."\n"; |
|
8385 | + $return .= 'child_value['.$row['id'].']['.$i++.'] = "'.$row_parent['id'].'";'."\n"; |
|
8386 | 8386 | } |
8387 | 8387 | $return .= "\n"; |
8388 | 8388 | } |
@@ -8403,8 +8403,8 @@ discard block |
||
8403 | 8403 | if (is_numeric($item_id)) { |
8404 | 8404 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
8405 | 8405 | |
8406 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
8407 | - WHERE c_id = ".$course_id." AND id = " . $item_id; |
|
8406 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
8407 | + WHERE c_id = ".$course_id." AND id = ".$item_id; |
|
8408 | 8408 | |
8409 | 8409 | $res = Database::query($sql); |
8410 | 8410 | $row = Database :: fetch_array($res); |
@@ -8463,7 +8463,7 @@ discard block |
||
8463 | 8463 | */ |
8464 | 8464 | public function display_item_small_form($item_type, $title = '', $data = array()) |
8465 | 8465 | { |
8466 | - $url = api_get_self() . '?' .api_get_cidreq().'&action=edit_item&lp_id='.$this->lp_id; |
|
8466 | + $url = api_get_self().'?'.api_get_cidreq().'&action=edit_item&lp_id='.$this->lp_id; |
|
8467 | 8467 | $form = new FormValidator('small_form', 'post', $url); |
8468 | 8468 | $form->addElement('header', $title); |
8469 | 8469 | $form->addElement('text', 'title', get_lang('Title')); |
@@ -8489,7 +8489,7 @@ discard block |
||
8489 | 8489 | $item_id = intval($item_id); |
8490 | 8490 | /* Current prerequisite */ |
8491 | 8491 | $sql = "SELECT * FROM $tbl_lp_item |
8492 | - WHERE c_id = $course_id AND id = " . $item_id; |
|
8492 | + WHERE c_id = $course_id AND id = ".$item_id; |
|
8493 | 8493 | $result = Database::query($sql); |
8494 | 8494 | $row = Database::fetch_array($result); |
8495 | 8495 | $prerequisiteId = $row['prerequisite']; |
@@ -8499,20 +8499,20 @@ discard block |
||
8499 | 8499 | $return .= '<form method="POST">'; |
8500 | 8500 | $return .= '<table class="data_table">'; |
8501 | 8501 | $return .= '<tr>'; |
8502 | - $return .= '<th height="24">' . get_lang('LearnpathPrerequisites') . '</th>'; |
|
8503 | - $return .= '<th width="70" >' . get_lang('Minimum') . '</th>'; |
|
8504 | - $return .= '<th width="70">' . get_lang('Maximum') . '</th>'; |
|
8502 | + $return .= '<th height="24">'.get_lang('LearnpathPrerequisites').'</th>'; |
|
8503 | + $return .= '<th width="70" >'.get_lang('Minimum').'</th>'; |
|
8504 | + $return .= '<th width="70">'.get_lang('Maximum').'</th>'; |
|
8505 | 8505 | $return .= '</tr>'; |
8506 | 8506 | |
8507 | 8507 | // Adding the none option to the prerequisites see http://www.chamilo.org/es/node/146 |
8508 | 8508 | $return .= '<tr >'; |
8509 | 8509 | $return .= '<td colspan="3" class="radio">'; |
8510 | 8510 | $return .= '<input checked="checked" id="idNone" name="prerequisites" style="margin-left:0px; margin-right:10px;" type="radio" />'; |
8511 | - $return .= '<label for="idNone">' . get_lang('None') . '</label>'; |
|
8511 | + $return .= '<label for="idNone">'.get_lang('None').'</label>'; |
|
8512 | 8512 | $return .= '</tr>'; |
8513 | 8513 | |
8514 | 8514 | $sql = "SELECT * FROM $tbl_lp_item |
8515 | - WHERE c_id = $course_id AND lp_id = " . $this->lp_id; |
|
8515 | + WHERE c_id = $course_id AND lp_id = ".$this->lp_id; |
|
8516 | 8516 | $result = Database::query($sql); |
8517 | 8517 | $arrLP = array(); |
8518 | 8518 | |
@@ -8555,25 +8555,25 @@ discard block |
||
8555 | 8555 | } |
8556 | 8556 | |
8557 | 8557 | $selectedMaxScoreValue = isset($selectedMaxScore[$item['id']]) ? $selectedMaxScore[$item['id']] : $item['max_score']; |
8558 | - $selectedMinScoreValue = isset($selectedMinScore[$item['id']]) ? $selectedMinScore[$item['id']]: 0; |
|
8558 | + $selectedMinScoreValue = isset($selectedMinScore[$item['id']]) ? $selectedMinScore[$item['id']] : 0; |
|
8559 | 8559 | |
8560 | 8560 | $return .= '<tr>'; |
8561 | - $return .= '<td class="radio"' . (($item['item_type'] != TOOL_QUIZ && $item['item_type'] != TOOL_HOTPOTATOES) ? ' colspan="3"' : '') . '>'; |
|
8562 | - $return .= '<label for="id' . $item['id'] . '">'; |
|
8563 | - $return .= '<input' . (in_array($prerequisiteId, array($item['id'], $item['ref'])) ? ' checked="checked" ' : '') . (($item['item_type'] == 'dokeos_module' || $item['item_type'] == 'dokeos_chapter') ? ' disabled="disabled" ' : ' ') . 'id="id' . $item['id'] . '" name="prerequisites" style="margin-left:' . $item['depth'] * 10 . 'px; margin-right:10px;" type="radio" value="' . $item['id'] . '" />'; |
|
8561 | + $return .= '<td class="radio"'.(($item['item_type'] != TOOL_QUIZ && $item['item_type'] != TOOL_HOTPOTATOES) ? ' colspan="3"' : '').'>'; |
|
8562 | + $return .= '<label for="id'.$item['id'].'">'; |
|
8563 | + $return .= '<input'.(in_array($prerequisiteId, array($item['id'], $item['ref'])) ? ' checked="checked" ' : '').(($item['item_type'] == 'dokeos_module' || $item['item_type'] == 'dokeos_chapter') ? ' disabled="disabled" ' : ' ').'id="id'.$item['id'].'" name="prerequisites" style="margin-left:'.$item['depth'] * 10.'px; margin-right:10px;" type="radio" value="'.$item['id'].'" />'; |
|
8564 | 8564 | $icon_name = str_replace(' ', '', $item['item_type']); |
8565 | 8565 | |
8566 | - if (file_exists('../img/lp_' . $icon_name . '.png')) { |
|
8567 | - $return .= Display::return_icon('lp_' . $icon_name . '.png'); |
|
8566 | + if (file_exists('../img/lp_'.$icon_name.'.png')) { |
|
8567 | + $return .= Display::return_icon('lp_'.$icon_name.'.png'); |
|
8568 | 8568 | } else { |
8569 | - if (file_exists('../img/lp_' . $icon_name . '.gif')) { |
|
8570 | - $return .= Display::return_icon('lp_' . $icon_name . '.gif'); |
|
8569 | + if (file_exists('../img/lp_'.$icon_name.'.gif')) { |
|
8570 | + $return .= Display::return_icon('lp_'.$icon_name.'.gif'); |
|
8571 | 8571 | } else { |
8572 | 8572 | $return .= Display::return_icon('folder_document.gif', '', array('style'=>'margin-right:5px;')); |
8573 | 8573 | } |
8574 | 8574 | } |
8575 | 8575 | |
8576 | - $return .= $item['title'] . '</label>'; |
|
8576 | + $return .= $item['title'].'</label>'; |
|
8577 | 8577 | $return .= '</td>'; |
8578 | 8578 | |
8579 | 8579 | if ($item['item_type'] == TOOL_QUIZ) { |
@@ -8587,19 +8587,19 @@ discard block |
||
8587 | 8587 | $item['max_score'] = $tmp_obj_lp_item->max_score; |
8588 | 8588 | |
8589 | 8589 | $return .= '<td class="exercise">'; |
8590 | - $return .= '<input size="4" maxlength="3" name="min_' . $item['id'] . '" type="number" min="0" step="any" max="'.$item['max_score'].'" value="' . $selectedMinScoreValue. '" />'; |
|
8590 | + $return .= '<input size="4" maxlength="3" name="min_'.$item['id'].'" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMinScoreValue.'" />'; |
|
8591 | 8591 | $return .= '</td>'; |
8592 | 8592 | $return .= '<td class="exercise">'; |
8593 | - $return .= '<input size="4" maxlength="3" name="max_' . $item['id'] . '" type="number" min="0" step="any" max="'.$item['max_score'].'" value="' . $selectedMaxScoreValue . '" />'; |
|
8593 | + $return .= '<input size="4" maxlength="3" name="max_'.$item['id'].'" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMaxScoreValue.'" />'; |
|
8594 | 8594 | $return .= '</td>'; |
8595 | 8595 | } |
8596 | 8596 | |
8597 | 8597 | if ($item['item_type'] == TOOL_HOTPOTATOES) { |
8598 | 8598 | $return .= '<td class="exercise">'; |
8599 | - $return .= '<center><input size="4" maxlength="3" name="min_' . $item['id'] . '" type="number" min="0" step="any" max="'.$item['max_score'].'" value="' . $selectedMinScoreValue . '" /></center>'; |
|
8599 | + $return .= '<center><input size="4" maxlength="3" name="min_'.$item['id'].'" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMinScoreValue.'" /></center>'; |
|
8600 | 8600 | $return .= '</td>'; |
8601 | 8601 | $return .= '<td class="exercise"">'; |
8602 | - $return .= '<center><input size="4" maxlength="3" name="max_' . $item['id'] . '" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMaxScoreValue . '" /></center>'; |
|
8602 | + $return .= '<center><input size="4" maxlength="3" name="max_'.$item['id'].'" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMaxScoreValue.'" /></center>'; |
|
8603 | 8603 | $return .= '</td>'; |
8604 | 8604 | } |
8605 | 8605 | $return .= '</tr>'; |
@@ -8608,7 +8608,7 @@ discard block |
||
8608 | 8608 | $return .= '</tr>'; |
8609 | 8609 | $return .= '</table>'; |
8610 | 8610 | $return .= '<div style="padding-top:3px;">'; |
8611 | - $return .= '<button class="btn btn-primary" name="submit_button" type="submit">' . get_lang('ModifyPrerequisites') . '</button>'; |
|
8611 | + $return .= '<button class="btn btn-primary" name="submit_button" type="submit">'.get_lang('ModifyPrerequisites').'</button>'; |
|
8612 | 8612 | $return .= '</form>'; |
8613 | 8613 | |
8614 | 8614 | return $return; |
@@ -8644,7 +8644,7 @@ discard block |
||
8644 | 8644 | if ($row['id'] == $lp_id) { |
8645 | 8645 | continue; |
8646 | 8646 | } |
8647 | - $return .= '<option value="'.$row['id'].'" '.(($row['id']==$prerequisiteId)?' selected ' : '').'>'.$row['name'].'</option>'; |
|
8647 | + $return .= '<option value="'.$row['id'].'" '.(($row['id'] == $prerequisiteId) ? ' selected ' : '').'>'.$row['name'].'</option>'; |
|
8648 | 8648 | } |
8649 | 8649 | } |
8650 | 8650 | $return .= '</select>'; |
@@ -8704,8 +8704,8 @@ discard block |
||
8704 | 8704 | WHERE c_id = $course_id AND $activeCondition $condition_session |
8705 | 8705 | ORDER BY title ASC"; |
8706 | 8706 | |
8707 | - $sql_hot = "SELECT * FROM $tbl_doc |
|
8708 | - WHERE c_id = $course_id AND path LIKE '" . $uploadPath . "/%/%htm%' $condition_session |
|
8707 | + $sql_hot = "SELECT * FROM $tbl_doc |
|
8708 | + WHERE c_id = $course_id AND path LIKE '".$uploadPath."/%/%htm%' $condition_session |
|
8709 | 8709 | ORDER BY id ASC"; |
8710 | 8710 | |
8711 | 8711 | $res_quiz = Database::query($sql_quiz); |
@@ -8714,8 +8714,8 @@ discard block |
||
8714 | 8714 | $return = '<ul class="lp_resource">'; |
8715 | 8715 | $return .= '<li class="lp_resource_element">'; |
8716 | 8716 | $return .= Display::return_icon('new_test_small.gif'); |
8717 | - $return .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'exercice/exercise_admin.php?'.api_get_cidreq().'&lp_id=' . $this->lp_id . '">' . |
|
8718 | - get_lang('NewExercise') . '</a>'; |
|
8717 | + $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/exercise_admin.php?'.api_get_cidreq().'&lp_id='.$this->lp_id.'">'. |
|
8718 | + get_lang('NewExercise').'</a>'; |
|
8719 | 8719 | $return .= '</li>'; |
8720 | 8720 | |
8721 | 8721 | // Display hotpotatoes |
@@ -8727,8 +8727,8 @@ discard block |
||
8727 | 8727 | $return .= '</a> '; |
8728 | 8728 | |
8729 | 8729 | $return .= Display::return_icon('hotpotatoes_s.png'); |
8730 | - $return .= '<a href="' . api_get_self() . '?' . api_get_cidreq().'&action=add_item&type=' . TOOL_HOTPOTATOES . '&file=' . $row_hot['id'] . '&lp_id=' . $this->lp_id . '">'. |
|
8731 | - ((!empty ($row_hot['comment'])) ? $row_hot['comment'] : Security :: remove_XSS($row_hot['title'])) . '</a>'; |
|
8730 | + $return .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_HOTPOTATOES.'&file='.$row_hot['id'].'&lp_id='.$this->lp_id.'">'. |
|
8731 | + ((!empty ($row_hot['comment'])) ? $row_hot['comment'] : Security :: remove_XSS($row_hot['title'])).'</a>'; |
|
8732 | 8732 | $return .= '</li>'; |
8733 | 8733 | } |
8734 | 8734 | |
@@ -8738,7 +8738,7 @@ discard block |
||
8738 | 8738 | $return .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY); |
8739 | 8739 | $return .= '</a> '; |
8740 | 8740 | $return .= Display::return_icon('quizz_small.gif', '', array(), ICON_SIZE_TINY); |
8741 | - $return .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&action=add_item&type=' . TOOL_QUIZ . '&file=' . $row_quiz['id'] . '&lp_id=' . $this->lp_id . '">' . |
|
8741 | + $return .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_QUIZ.'&file='.$row_quiz['id'].'&lp_id='.$this->lp_id.'">'. |
|
8742 | 8742 | Security :: remove_XSS(cut($row_quiz['title'], 80)). |
8743 | 8743 | '</a>'; |
8744 | 8744 | $return .= '</li>'; |
@@ -8812,7 +8812,7 @@ discard block |
||
8812 | 8812 | foreach ($categorizedLinks as $categoryId => $links) { |
8813 | 8813 | $linkNodes = null; |
8814 | 8814 | foreach ($links as $key => $title) { |
8815 | - if (api_get_item_visibility($course, TOOL_LINK, $key, $session_id) != 2) { |
|
8815 | + if (api_get_item_visibility($course, TOOL_LINK, $key, $session_id) != 2) { |
|
8816 | 8816 | $linkNodes .= |
8817 | 8817 | '<li class="lp_resource_element" data_id="'.$key.'" data_type="'.TOOL_LINK.'" title="'.$title.'" > |
8818 | 8818 | <a class="moved" href="#">'. |
@@ -8850,7 +8850,7 @@ discard block |
||
8850 | 8850 | $return = '<div class="lp_resource" >'; |
8851 | 8851 | $return .= '<div class="lp_resource_element">'; |
8852 | 8852 | $return .= Display::return_icon('works_small.gif', '', array(), ICON_SIZE_TINY); |
8853 | - $return .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=add_item&type=' . TOOL_STUDENTPUBLICATION . '&lp_id=' . $this->lp_id . '">' . get_lang('AddAssignmentPage') . '</a>'; |
|
8853 | + $return .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_STUDENTPUBLICATION.'&lp_id='.$this->lp_id.'">'.get_lang('AddAssignmentPage').'</a>'; |
|
8854 | 8854 | $return .= '</div>'; |
8855 | 8855 | $return .= '</div>'; |
8856 | 8856 | return $return; |
@@ -8873,7 +8873,7 @@ discard block |
||
8873 | 8873 | $return .= Display::return_icon('forum_new_small.gif'); |
8874 | 8874 | $return .= Display::url( |
8875 | 8875 | get_lang('CreateANewForum'), |
8876 | - api_get_path(WEB_CODE_PATH) . 'forum/index.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
8876 | + api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq().'&'.http_build_query([ |
|
8877 | 8877 | 'action' => 'add', |
8878 | 8878 | 'content' => 'forum', |
8879 | 8879 | 'lp_id' => $this->lp_id |
@@ -8901,15 +8901,15 @@ discard block |
||
8901 | 8901 | $return .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY); |
8902 | 8902 | $return .= ' </a>'; |
8903 | 8903 | $return .= Display::return_icon('lp_forum.png', '', array(), ICON_SIZE_TINY); |
8904 | - $return .= '<a style="cursor:hand" onclick="javascript: toggle_forum(' . $forum['forum_id'] . ')" style="vertical-align:middle"> |
|
8905 | - <img src="' . Display::returnIconPath('add.gif').'" id="forum_' . $forum['forum_id'] . '_opener" align="absbottom" /> |
|
8904 | + $return .= '<a style="cursor:hand" onclick="javascript: toggle_forum('.$forum['forum_id'].')" style="vertical-align:middle"> |
|
8905 | + <img src="' . Display::returnIconPath('add.gif').'" id="forum_'.$forum['forum_id'].'_opener" align="absbottom" /> |
|
8906 | 8906 | </a> |
8907 | - <a href="' . api_get_self() . '?'.api_get_cidreq().'&action=add_item&type=' . TOOL_FORUM . '&forum_id=' . $forum['forum_id'] . '&lp_id=' . $this->lp_id . '" style="vertical-align:middle">' . |
|
8908 | - Security :: remove_XSS($forum['forum_title']) . '</a>'; |
|
8907 | + <a href="' . api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_FORUM.'&forum_id='.$forum['forum_id'].'&lp_id='.$this->lp_id.'" style="vertical-align:middle">'. |
|
8908 | + Security :: remove_XSS($forum['forum_title']).'</a>'; |
|
8909 | 8909 | |
8910 | 8910 | $return .= '</li>'; |
8911 | 8911 | |
8912 | - $return .= '<div style="display:none" id="forum_' . $forum['forum_id'] . '_content">'; |
|
8912 | + $return .= '<div style="display:none" id="forum_'.$forum['forum_id'].'_content">'; |
|
8913 | 8913 | $a_threads = get_threads($forum['forum_id']); |
8914 | 8914 | if (is_array($a_threads)) { |
8915 | 8915 | foreach ($a_threads as $thread) { |
@@ -8918,8 +8918,8 @@ discard block |
||
8918 | 8918 | $return .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY); |
8919 | 8919 | $return .= ' </a>'; |
8920 | 8920 | $return .= Display::return_icon('forumthread.png', get_lang('Thread'), array(), ICON_SIZE_TINY); |
8921 | - $return .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type=' . TOOL_THREAD . '&thread_id=' . $thread['thread_id'] . '&lp_id=' . $this->lp_id . '">' . |
|
8922 | - Security :: remove_XSS($thread['thread_title']) . '</a>'; |
|
8921 | + $return .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_THREAD.'&thread_id='.$thread['thread_id'].'&lp_id='.$this->lp_id.'">'. |
|
8922 | + Security :: remove_XSS($thread['thread_title']).'</a>'; |
|
8923 | 8923 | $return .= '</li>'; |
8924 | 8924 | } |
8925 | 8925 | } |
@@ -8990,7 +8990,7 @@ discard block |
||
8990 | 8990 | if (is_dir($current_course_path.'/scorm/'.$this->path) && is_file($current_course_path.'/scorm/'.$this->path.'/imsmanifest.xml')) { |
8991 | 8991 | // Remove the possible . at the end of the path. |
8992 | 8992 | $dest_path_to_lp = substr($this->path, -1) == '.' ? substr($this->path, 0, -1) : $this->path; |
8993 | - $dest_path_to_scorm_folder = str_replace('//','/',$temp_zip_dir.'/scorm/'.$dest_path_to_lp); |
|
8993 | + $dest_path_to_scorm_folder = str_replace('//', '/', $temp_zip_dir.'/scorm/'.$dest_path_to_lp); |
|
8994 | 8994 | mkdir($dest_path_to_scorm_folder, api_get_permissions_for_new_directories(), true); |
8995 | 8995 | $zip_files_dist = copyr($current_course_path.'/scorm/'.$this->path, $dest_path_to_scorm_folder, array('imsmanifest'), $zip_files); |
8996 | 8996 | } |
@@ -9058,7 +9058,7 @@ discard block |
||
9058 | 9058 | if ($item->type == 'sco') { |
9059 | 9059 | $inc_docs = $item->get_resources_from_source( |
9060 | 9060 | null, |
9061 | - api_get_path(SYS_COURSE_PATH) . api_get_course_path() . '/' . 'scorm/' . $this->path . '/' . $item->get_path() |
|
9061 | + api_get_path(SYS_COURSE_PATH).api_get_course_path().'/'.'scorm/'.$this->path.'/'.$item->get_path() |
|
9062 | 9062 | ); |
9063 | 9063 | } else { |
9064 | 9064 | $inc_docs = $item->get_resources_from_source(); |
@@ -9274,7 +9274,7 @@ discard block |
||
9274 | 9274 | $file_path = substr($file_path, strlen($current_dir)); // We get the relative path. |
9275 | 9275 | $zip_files[] = $my_sub_dir.'/'.$file_path; |
9276 | 9276 | $link_updates[$my_file_path][] = array('orig' => $doc_info[0], 'dest' => $file_path); |
9277 | - $my_dep_file->setAttribute('href','document/'.$file_path); |
|
9277 | + $my_dep_file->setAttribute('href', 'document/'.$file_path); |
|
9278 | 9278 | $my_dep->setAttribute('xml:base', ''); |
9279 | 9279 | } |
9280 | 9280 | } |
@@ -9405,7 +9405,7 @@ discard block |
||
9405 | 9405 | //$my_item->appendChild($my_max_score); |
9406 | 9406 | // Give a child element <adlcp:prerequisites> to the <item> element. |
9407 | 9407 | $my_prereqs = $xmldoc->createElement('adlcp:prerequisites', $item->get_prereq_string()); |
9408 | - $my_prereqs->setAttribute('type','aicc_script'); |
|
9408 | + $my_prereqs->setAttribute('type', 'aicc_script'); |
|
9409 | 9409 | $my_item->appendChild($my_prereqs); |
9410 | 9410 | // Give a child element <adlcp:masteryscore> to the <item> element. |
9411 | 9411 | $my_masteryscore = $xmldoc->createElement('adlcp:masteryscore', $item->get_mastery_score()); |
@@ -9458,7 +9458,7 @@ discard block |
||
9458 | 9458 | $my_resource->appendChild($my_file); |
9459 | 9459 | |
9460 | 9460 | // Get included docs. |
9461 | - $inc_docs = $item->get_resources_from_source(null,$tmp_file_path); |
|
9461 | + $inc_docs = $item->get_resources_from_source(null, $tmp_file_path); |
|
9462 | 9462 | // Dependency to other files - not yet supported. |
9463 | 9463 | $i = 1; |
9464 | 9464 | foreach ($inc_docs as $doc_info) { |
@@ -9519,7 +9519,7 @@ discard block |
||
9519 | 9519 | $my_dep_file->setAttribute('href', $file_path); |
9520 | 9520 | $my_dep->setAttribute('xml:base', ''); |
9521 | 9521 | |
9522 | - if (strstr($file_path,$main_path) !== false) { |
|
9522 | + if (strstr($file_path, $main_path) !== false) { |
|
9523 | 9523 | // The calculated real path is really inside the chamilo root path. |
9524 | 9524 | // Reduce file path to what's under the DocumentRoot. |
9525 | 9525 | $file_path = substr($file_path, strlen($root_path)); |
@@ -9537,7 +9537,7 @@ discard block |
||
9537 | 9537 | $file_path = $_SERVER['DOCUMENT_ROOT'].$doc_info[0]; |
9538 | 9538 | $file_path = str_replace('//', '/', $file_path); |
9539 | 9539 | if (file_exists($file_path)) { |
9540 | - $file_path = substr($file_path,strlen($current_dir)); // We get the relative path. |
|
9540 | + $file_path = substr($file_path, strlen($current_dir)); // We get the relative path. |
|
9541 | 9541 | $zip_files[] = $my_sub_dir.'/'.$file_path; |
9542 | 9542 | $link_updates[$my_file_path][] = array('orig' => $doc_info[0], 'dest' => $file_path); |
9543 | 9543 | $my_dep_file->setAttribute('href', 'document/'.$file_path); |
@@ -9766,7 +9766,7 @@ discard block |
||
9766 | 9766 | if (strpos($extra_file, '.') === 0) |
9767 | 9767 | continue; |
9768 | 9768 | else { |
9769 | - $dest_file = $archive_path . $temp_dir_short . '/' . $extra_file; |
|
9769 | + $dest_file = $archive_path.$temp_dir_short.'/'.$extra_file; |
|
9770 | 9770 | $this->create_path($dest_file); |
9771 | 9771 | copy($main_code_path.$extra_file, $dest_file); |
9772 | 9772 | } |
@@ -9819,7 +9819,7 @@ discard block |
||
9819 | 9819 | } |
9820 | 9820 | $file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$file_data['path']; |
9821 | 9821 | if (file_exists($file_path)) { |
9822 | - $files_to_export[] = array('title'=>$item->get_title(),'path'=>$file_path); |
|
9822 | + $files_to_export[] = array('title'=>$item->get_title(), 'path'=>$file_path); |
|
9823 | 9823 | } |
9824 | 9824 | break; |
9825 | 9825 | case 'asset': //commes from a scorm package generated by chamilo |
@@ -9859,12 +9859,12 @@ discard block |
||
9859 | 9859 | |
9860 | 9860 | foreach ($path_bits as $bit) { |
9861 | 9861 | if (!empty ($bit)) { |
9862 | - $new_path = $path_built . $bit; |
|
9862 | + $new_path = $path_built.$bit; |
|
9863 | 9863 | if (is_dir($new_path)) { |
9864 | - $path_built = $new_path . '/'; |
|
9864 | + $path_built = $new_path.'/'; |
|
9865 | 9865 | } else { |
9866 | 9866 | mkdir($new_path, api_get_permissions_for_new_directories()); |
9867 | - $path_built = $new_path . '/'; |
|
9867 | + $path_built = $new_path.'/'; |
|
9868 | 9868 | } |
9869 | 9869 | } |
9870 | 9870 | } |
@@ -9908,9 +9908,9 @@ discard block |
||
9908 | 9908 | |
9909 | 9909 | if ($upload_ok) { |
9910 | 9910 | if ($has_attachment) { |
9911 | - $courseDir = api_get_course_path() . '/upload/learning_path/images'; |
|
9911 | + $courseDir = api_get_course_path().'/upload/learning_path/images'; |
|
9912 | 9912 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
9913 | - $updir = $sys_course_path . $courseDir; |
|
9913 | + $updir = $sys_course_path.$courseDir; |
|
9914 | 9914 | // Try to add an extension to the file if it hasn't one. |
9915 | 9915 | $new_file_name = add_ext_on_mime(stripslashes($image_array['name']), $image_array['type']); |
9916 | 9916 | |
@@ -9965,7 +9965,7 @@ discard block |
||
9965 | 9965 | //Setting my lp_id to autolaunch = 1 |
9966 | 9966 | $attributes['autolaunch'] = 1; |
9967 | 9967 | $where = array('id = ? AND session_id = ? AND c_id = ?'=> array($lp_id, api_get_session_id(), $course_id)); |
9968 | - Database::update($lp_table, $attributes, $where ); |
|
9968 | + Database::update($lp_table, $attributes, $where); |
|
9969 | 9969 | } |
9970 | 9970 | } |
9971 | 9971 | |
@@ -9984,13 +9984,13 @@ discard block |
||
9984 | 9984 | |
9985 | 9985 | // Get the max order of the items |
9986 | 9986 | $sql_max_order = "SELECT max(display_order) AS display_order FROM $table_lp_item |
9987 | - WHERE c_id = $course_id AND lp_id = '" . $this->lp_id . "'"; |
|
9987 | + WHERE c_id = $course_id AND lp_id = '".$this->lp_id."'"; |
|
9988 | 9988 | $rs_max_order = Database::query($sql_max_order); |
9989 | 9989 | $row_max_order = Database::fetch_object($rs_max_order); |
9990 | 9990 | $max_order = $row_max_order->display_order; |
9991 | 9991 | // Get the previous item ID |
9992 | 9992 | $sql = "SELECT id as previous FROM $table_lp_item |
9993 | - WHERE c_id = $course_id AND lp_id = '" . $this->lp_id . "' AND display_order = '".$max_order."' "; |
|
9993 | + WHERE c_id = $course_id AND lp_id = '".$this->lp_id."' AND display_order = '".$max_order."' "; |
|
9994 | 9994 | $rs_max = Database::query($sql); |
9995 | 9995 | $row_max = Database::fetch_object($rs_max); |
9996 | 9996 | |
@@ -10046,9 +10046,9 @@ discard block |
||
10046 | 10046 | $documents_total_space = DocumentManager::documents_total_space(); |
10047 | 10047 | $course_max_space = DocumentManager::get_course_quota(); |
10048 | 10048 | $total_size = filesize($s) + $documents_total_space; |
10049 | - if (filesize($s)>$post_max || filesize($s)>$upl_max || $total_size>$course_max_space ){ |
|
10049 | + if (filesize($s) > $post_max || filesize($s) > $upl_max || $total_size > $course_max_space) { |
|
10050 | 10050 | return true; |
10051 | - } else{ |
|
10051 | + } else { |
|
10052 | 10052 | return false; |
10053 | 10053 | } |
10054 | 10054 | } |
@@ -10388,7 +10388,7 @@ discard block |
||
10388 | 10388 | if ($this->debug > 0) { |
10389 | 10389 | error_log('New LP - In learnpath::set_subscribe_users()', 0); |
10390 | 10390 | } |
10391 | - $this->subscribeUsers = intval($value);; |
|
10391 | + $this->subscribeUsers = intval($value); ; |
|
10392 | 10392 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
10393 | 10393 | $lp_id = $this->get_id(); |
10394 | 10394 | $sql = "UPDATE $lp_table SET subscribe_users = ".$this->subscribeUsers." |
@@ -10734,7 +10734,7 @@ discard block |
||
10734 | 10734 | */ |
10735 | 10735 | public function createForum($forumCategoryId) |
10736 | 10736 | { |
10737 | - require_once api_get_path(SYS_CODE_PATH) . '/forum/forumfunction.inc.php'; |
|
10737 | + require_once api_get_path(SYS_CODE_PATH).'/forum/forumfunction.inc.php'; |
|
10738 | 10738 | |
10739 | 10739 | $forumId = store_forum( |
10740 | 10740 | [ |
@@ -3939,8 +3939,9 @@ discard block |
||
3939 | 3939 | WHERE c_id = ".$course_id." |
3940 | 3940 | ORDER BY display_order"; |
3941 | 3941 | $res = Database::query($sql); |
3942 | - if ($res === false) |
|
3943 | - return false; |
|
3942 | + if ($res === false) { |
|
3943 | + return false; |
|
3944 | + } |
|
3944 | 3945 | $lps = array (); |
3945 | 3946 | $lp_order = array (); |
3946 | 3947 | $num = Database :: num_rows($res); |
@@ -4540,8 +4541,9 @@ discard block |
||
4540 | 4541 | if ($this->debug > 0) { |
4541 | 4542 | error_log('New LP - In learnpath::set_maker()', 0); |
4542 | 4543 | } |
4543 | - if (empty ($name)) |
|
4544 | - return false; |
|
4544 | + if (empty ($name)) { |
|
4545 | + return false; |
|
4546 | + } |
|
4545 | 4547 | $this->maker = $name; |
4546 | 4548 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4547 | 4549 | $course_id = api_get_course_int_id(); |
@@ -4606,8 +4608,9 @@ discard block |
||
4606 | 4608 | public function set_terms_by_prefix($terms_string, $prefix) |
4607 | 4609 | { |
4608 | 4610 | $course_id = api_get_course_int_id(); |
4609 | - if (api_get_setting('search_enabled') !== 'true') |
|
4610 | - return false; |
|
4611 | + if (api_get_setting('search_enabled') !== 'true') { |
|
4612 | + return false; |
|
4613 | + } |
|
4611 | 4614 | |
4612 | 4615 | if (!extension_loaded('xapian')) { |
4613 | 4616 | return false; |
@@ -4620,8 +4623,9 @@ discard block |
||
4620 | 4623 | $stored_terms = $this->get_common_index_terms_by_prefix($prefix); |
4621 | 4624 | |
4622 | 4625 | // Don't do anything if no change, verify only at DB, not the search engine. |
4623 | - if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) |
|
4624 | - return false; |
|
4626 | + if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) { |
|
4627 | + return false; |
|
4628 | + } |
|
4625 | 4629 | |
4626 | 4630 | require_once 'xapian.php'; // TODO: Try catch every xapian use or make wrappers on API. |
4627 | 4631 | require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php'; |
@@ -4813,8 +4817,9 @@ discard block |
||
4813 | 4817 | if ($this->debug > 0) { |
4814 | 4818 | error_log('New LP - In learnpath::set_proximity()', 0); |
4815 | 4819 | } |
4816 | - if (empty ($name)) |
|
4817 | - return false; |
|
4820 | + if (empty ($name)) { |
|
4821 | + return false; |
|
4822 | + } |
|
4818 | 4823 | |
4819 | 4824 | $this->proximity = $name; |
4820 | 4825 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
@@ -5156,8 +5161,9 @@ discard block |
||
5156 | 5161 | |
5157 | 5162 | $sql = "SELECT * FROM $lp_table WHERE c_id = ".$course_id." ORDER BY display_order"; |
5158 | 5163 | $res = Database::query($sql); |
5159 | - if ($res === false) |
|
5160 | - return false; |
|
5164 | + if ($res === false) { |
|
5165 | + return false; |
|
5166 | + } |
|
5161 | 5167 | |
5162 | 5168 | $num = Database :: num_rows($res); |
5163 | 5169 | // First check the order is correct, globally (might be wrong because |
@@ -5468,8 +5474,9 @@ discard block |
||
5468 | 5474 | $position[$key] = $row['display_order']; |
5469 | 5475 | } |
5470 | 5476 | |
5471 | - if (count($array) > 0) |
|
5472 | - array_multisort($parent, SORT_ASC, $position, SORT_ASC, $array); |
|
5477 | + if (count($array) > 0) { |
|
5478 | + array_multisort($parent, SORT_ASC, $position, SORT_ASC, $array); |
|
5479 | + } |
|
5473 | 5480 | |
5474 | 5481 | return $array; |
5475 | 5482 | } |
@@ -6023,8 +6030,9 @@ discard block |
||
6023 | 6030 | $tmp_filename = $filename; |
6024 | 6031 | |
6025 | 6032 | $i = 0; |
6026 | - while (file_exists($filepath . $tmp_filename . '.'.$extension)) |
|
6027 | - $tmp_filename = $filename . '_' . ++ $i; |
|
6033 | + while (file_exists($filepath . $tmp_filename . '.'.$extension)) { |
|
6034 | + $tmp_filename = $filename . '_' . ++ $i; |
|
6035 | + } |
|
6028 | 6036 | |
6029 | 6037 | $filename = $tmp_filename . '.'.$extension; |
6030 | 6038 | if ($extension == 'html') { |
@@ -6103,10 +6111,12 @@ discard block |
||
6103 | 6111 | if ($new_comment || $new_title) { |
6104 | 6112 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
6105 | 6113 | $ct = ''; |
6106 | - if ($new_comment) |
|
6107 | - $ct .= ", comment='" . Database::escape_string($new_comment). "'"; |
|
6108 | - if ($new_title) |
|
6109 | - $ct .= ", title='" . Database::escape_string(htmlspecialchars($new_title, ENT_QUOTES, $charset))."' "; |
|
6114 | + if ($new_comment) { |
|
6115 | + $ct .= ", comment='" . Database::escape_string($new_comment). "'"; |
|
6116 | + } |
|
6117 | + if ($new_title) { |
|
6118 | + $ct .= ", title='" . Database::escape_string(htmlspecialchars($new_title, ENT_QUOTES, $charset))."' "; |
|
6119 | + } |
|
6110 | 6120 | |
6111 | 6121 | $sql = "UPDATE " . $tbl_doc ." SET " . substr($ct, 1)." |
6112 | 6122 | WHERE c_id = ".$course_id." AND id = " . $document_id; |
@@ -6130,17 +6140,21 @@ discard block |
||
6130 | 6140 | // Please, do not modify this dirname formatting. |
6131 | 6141 | $dir = isset($_GET['dir']) ? $_GET['dir'] : $_POST['dir']; |
6132 | 6142 | |
6133 | - if (strstr($dir, '..')) |
|
6134 | - $dir = '/'; |
|
6143 | + if (strstr($dir, '..')) { |
|
6144 | + $dir = '/'; |
|
6145 | + } |
|
6135 | 6146 | |
6136 | - if ($dir[0] == '.') |
|
6137 | - $dir = substr($dir, 1); |
|
6147 | + if ($dir[0] == '.') { |
|
6148 | + $dir = substr($dir, 1); |
|
6149 | + } |
|
6138 | 6150 | |
6139 | - if ($dir[0] != '/') |
|
6140 | - $dir = '/' . $dir; |
|
6151 | + if ($dir[0] != '/') { |
|
6152 | + $dir = '/' . $dir; |
|
6153 | + } |
|
6141 | 6154 | |
6142 | - if ($dir[strlen($dir) - 1] != '/') |
|
6143 | - $dir .= '/'; |
|
6155 | + if ($dir[strlen($dir) - 1] != '/') { |
|
6156 | + $dir .= '/'; |
|
6157 | + } |
|
6144 | 6158 | |
6145 | 6159 | $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document' . $dir; |
6146 | 6160 | |
@@ -6206,8 +6220,9 @@ discard block |
||
6206 | 6220 | } |
6207 | 6221 | $return .= '<div style="padding:10px;">'; |
6208 | 6222 | |
6209 | - if ($msg != '') |
|
6210 | - $return .= $msg; |
|
6223 | + if ($msg != '') { |
|
6224 | + $return .= $msg; |
|
6225 | + } |
|
6211 | 6226 | |
6212 | 6227 | $return .= '<h3>'.$row['title'].'</h3>'; |
6213 | 6228 | switch ($row['item_type']) { |
@@ -6453,10 +6468,11 @@ discard block |
||
6453 | 6468 | $item_title = Security::remove_XSS($item_title); |
6454 | 6469 | $item_description = Security::remove_XSS($item_description); |
6455 | 6470 | |
6456 | - if ($id != 0 && is_array($extra_info)) |
|
6457 | - $parent = $extra_info['parent_item_id']; |
|
6458 | - else |
|
6459 | - $parent = 0; |
|
6471 | + if ($id != 0 && is_array($extra_info)) { |
|
6472 | + $parent = $extra_info['parent_item_id']; |
|
6473 | + } else { |
|
6474 | + $parent = 0; |
|
6475 | + } |
|
6460 | 6476 | |
6461 | 6477 | $sql = "SELECT * FROM " . $tbl_lp_item . " |
6462 | 6478 | WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
@@ -6729,11 +6745,13 @@ discard block |
||
6729 | 6745 | } |
6730 | 6746 | |
6731 | 6747 | $legend = '<legend>'; |
6732 | - if ($action == 'add') |
|
6733 | - $legend .= get_lang('CreateTheExercise'); |
|
6734 | - elseif ($action == 'move') $legend .= get_lang('MoveTheCurrentExercise'); |
|
6735 | - else |
|
6736 | - $legend .= get_lang('EditCurrentExecice'); |
|
6748 | + if ($action == 'add') { |
|
6749 | + $legend .= get_lang('CreateTheExercise'); |
|
6750 | + } elseif ($action == 'move') { |
|
6751 | + $legend .= get_lang('MoveTheCurrentExercise'); |
|
6752 | + } else { |
|
6753 | + $legend .= get_lang('EditCurrentExecice'); |
|
6754 | + } |
|
6737 | 6755 | if (isset ($_GET['edit']) && $_GET['edit'] == 'true') { |
6738 | 6756 | $legend .= Display :: return_warning_message(get_lang('Warning') . ' ! ' . get_lang('WarningEditingDocument')); |
6739 | 6757 | } |
@@ -6760,8 +6778,9 @@ discard block |
||
6760 | 6778 | $arrHide[] = $arrLP[$i]['id']; |
6761 | 6779 | } |
6762 | 6780 | } else { |
6763 | - if ($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir') |
|
6764 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
6781 | + if ($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir') { |
|
6782 | + $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
6783 | + } |
|
6765 | 6784 | } |
6766 | 6785 | } |
6767 | 6786 | |
@@ -6779,11 +6798,13 @@ discard block |
||
6779 | 6798 | |
6780 | 6799 | for ($i = 0; $i < count($arrLP); $i++) { |
6781 | 6800 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
6782 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
6801 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
6802 | + $selected = 'selected="selected" '; |
|
6803 | + } elseif ($action == 'add') { |
|
6783 | 6804 | $selected = 'selected="selected" '; |
6784 | - elseif ($action == 'add') $selected = 'selected="selected" '; |
|
6785 | - else |
|
6786 | - $selected = ''; |
|
6805 | + } else { |
|
6806 | + $selected = ''; |
|
6807 | + } |
|
6787 | 6808 | |
6788 | 6809 | $return .= '<option ' . $selected . 'value="' . $arrLP[$i]['id'] . '">' . get_lang('After') . ' "' . $arrLP[$i]['title'] . '"</option>'; |
6789 | 6810 | } |
@@ -6810,9 +6831,11 @@ discard block |
||
6810 | 6831 | $arrHide = array (); |
6811 | 6832 | for ($i = 0; $i < count($arrLP); $i++) { |
6812 | 6833 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
6813 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
6814 | - $s_selected_position = $arrLP[$i]['id']; |
|
6815 | - elseif ($action == 'add') $s_selected_position = 0; |
|
6834 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
6835 | + $s_selected_position = $arrLP[$i]['id']; |
|
6836 | + } elseif ($action == 'add') { |
|
6837 | + $s_selected_position = 0; |
|
6838 | + } |
|
6816 | 6839 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
6817 | 6840 | |
6818 | 6841 | } |
@@ -7009,9 +7032,11 @@ discard block |
||
7009 | 7032 | $arrHide = array(); |
7010 | 7033 | for ($i = 0; $i < count($arrLP); $i++) { |
7011 | 7034 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
7012 | - if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
7013 | - $s_selected_position = $arrLP[$i]['id']; |
|
7014 | - elseif ($action == 'add') $s_selected_position = 0; |
|
7035 | + if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
7036 | + $s_selected_position = $arrLP[$i]['id']; |
|
7037 | + } elseif ($action == 'add') { |
|
7038 | + $s_selected_position = 0; |
|
7039 | + } |
|
7015 | 7040 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
7016 | 7041 | } |
7017 | 7042 | } |
@@ -7214,9 +7239,11 @@ discard block |
||
7214 | 7239 | |
7215 | 7240 | for ($i = 0; $i < count($arrLP); $i++) { |
7216 | 7241 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
7217 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
7218 | - $s_selected_position = $arrLP[$i]['id']; |
|
7219 | - elseif ($action == 'add') $s_selected_position = 0; |
|
7242 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
7243 | + $s_selected_position = $arrLP[$i]['id']; |
|
7244 | + } elseif ($action == 'add') { |
|
7245 | + $s_selected_position = 0; |
|
7246 | + } |
|
7220 | 7247 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
7221 | 7248 | |
7222 | 7249 | } |
@@ -7250,8 +7277,7 @@ discard block |
||
7250 | 7277 | |
7251 | 7278 | if (is_numeric($extra_info)) { |
7252 | 7279 | $form->addHidden('path', $extra_info); |
7253 | - } |
|
7254 | - elseif (is_array($extra_info)) { |
|
7280 | + } elseif (is_array($extra_info)) { |
|
7255 | 7281 | $form->addHidden('path', $extra_info['path']); |
7256 | 7282 | } |
7257 | 7283 | |
@@ -7304,8 +7330,9 @@ discard block |
||
7304 | 7330 | lp_id = " . $this->lp_id . " AND |
7305 | 7331 | id != $id"; |
7306 | 7332 | |
7307 | - if ($item_type == 'module') |
|
7308 | - $sql .= " AND parent_item_id = 0"; |
|
7333 | + if ($item_type == 'module') { |
|
7334 | + $sql .= " AND parent_item_id = 0"; |
|
7335 | + } |
|
7309 | 7336 | |
7310 | 7337 | $result = Database::query($sql); |
7311 | 7338 | $arrLP = array (); |
@@ -7655,9 +7682,11 @@ discard block |
||
7655 | 7682 | //POSITION |
7656 | 7683 | for ($i = 0; $i < count($arrLP); $i++) { |
7657 | 7684 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
7658 | - if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
7685 | + if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
7686 | + $s_selected_position = $arrLP[$i]['id']; |
|
7687 | + } elseif ($action == 'add') { |
|
7659 | 7688 | $s_selected_position = $arrLP[$i]['id']; |
7660 | - elseif ($action == 'add') $s_selected_position = $arrLP[$i]['id']; |
|
7689 | + } |
|
7661 | 7690 | $arrHide[$arrLP[$i]['id']]['value'] = get_lang('After') . ' "' . $arrLP[$i]['title'] . '"'; |
7662 | 7691 | } |
7663 | 7692 | } |
@@ -7690,9 +7719,11 @@ discard block |
||
7690 | 7719 | |
7691 | 7720 | for ($i = 0; $i < count($arrLP); $i++) { |
7692 | 7721 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
7693 | - if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
7722 | + if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
7723 | + $s_selected_position = $arrLP[$i]['id']; |
|
7724 | + } elseif ($action == 'add') { |
|
7694 | 7725 | $s_selected_position = $arrLP[$i]['id']; |
7695 | - elseif ($action == 'add') $s_selected_position = $arrLP[$i]['id']; |
|
7726 | + } |
|
7696 | 7727 | |
7697 | 7728 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
7698 | 7729 | |
@@ -7703,17 +7734,18 @@ discard block |
||
7703 | 7734 | $item_type = isset($extra_info['item_type']) ? $extra_info['item_type'] : null; |
7704 | 7735 | $edit = isset($_GET['edit']) ? $_GET['edit'] : null; |
7705 | 7736 | if (($extra_info == 'new' || $item_type == TOOL_DOCUMENT || $edit == 'true')) { |
7706 | - if (isset ($_POST['content'])) |
|
7707 | - $content = stripslashes($_POST['content']); |
|
7708 | - elseif (is_array($extra_info)) { |
|
7737 | + if (isset ($_POST['content'])) { |
|
7738 | + $content = stripslashes($_POST['content']); |
|
7739 | + } elseif (is_array($extra_info)) { |
|
7709 | 7740 | //If it's an html document or a text file |
7710 | 7741 | if (!$no_display_edit_textarea) { |
7711 | 7742 | $content = $this->display_document($extra_info['path'], false, false); |
7712 | 7743 | } |
7713 | - } elseif (is_numeric($extra_info)) |
|
7714 | - $content = $this->display_document($extra_info, false, false); |
|
7715 | - else |
|
7716 | - $content = ''; |
|
7744 | + } elseif (is_numeric($extra_info)) { |
|
7745 | + $content = $this->display_document($extra_info, false, false); |
|
7746 | + } else { |
|
7747 | + $content = ''; |
|
7748 | + } |
|
7717 | 7749 | |
7718 | 7750 | if (!$no_display_edit_textarea) { |
7719 | 7751 | // We need to calculate here some specific settings for the online editor. |
@@ -7981,9 +8013,11 @@ discard block |
||
7981 | 8013 | $arrHide = array(); |
7982 | 8014 | for ($i = 0; $i < count($arrLP); $i++) { |
7983 | 8015 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
7984 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
7985 | - $s_selected_position = $arrLP[$i]['id']; |
|
7986 | - elseif ($action == 'add') $s_selected_position = 0; |
|
8016 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
8017 | + $s_selected_position = $arrLP[$i]['id']; |
|
8018 | + } elseif ($action == 'add') { |
|
8019 | + $s_selected_position = 0; |
|
8020 | + } |
|
7987 | 8021 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
7988 | 8022 | |
7989 | 8023 | } |
@@ -8186,9 +8220,11 @@ discard block |
||
8186 | 8220 | $arrHide = array (); |
8187 | 8221 | for ($i = 0; $i < count($arrLP); $i++) { |
8188 | 8222 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
8189 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
8190 | - $s_selected_position = $arrLP[$i]['id']; |
|
8191 | - elseif ($action == 'add') $s_selected_position = 0; |
|
8223 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
8224 | + $s_selected_position = $arrLP[$i]['id']; |
|
8225 | + } elseif ($action == 'add') { |
|
8226 | + $s_selected_position = 0; |
|
8227 | + } |
|
8192 | 8228 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
8193 | 8229 | |
8194 | 8230 | } |
@@ -9763,9 +9799,9 @@ discard block |
||
9763 | 9799 | $main_code_path = api_get_path(SYS_CODE_PATH).'newscorm/packaging/'; |
9764 | 9800 | $extra_files = scandir($main_code_path); |
9765 | 9801 | foreach ($extra_files as $extra_file) { |
9766 | - if (strpos($extra_file, '.') === 0) |
|
9767 | - continue; |
|
9768 | - else { |
|
9802 | + if (strpos($extra_file, '.') === 0) { |
|
9803 | + continue; |
|
9804 | + } else { |
|
9769 | 9805 | $dest_file = $archive_path . $temp_dir_short . '/' . $extra_file; |
9770 | 9806 | $this->create_path($dest_file); |
9771 | 9807 | copy($main_code_path.$extra_file, $dest_file); |
@@ -81,7 +81,7 @@ |
||
81 | 81 | |
82 | 82 | // Using the resource linker as a tool for adding resources to the learning path. |
83 | 83 | if ($action == 'add' && $type == 'learnpathitem') { |
84 | - $htmlHeadXtra[] = "<script type='text/javascript'> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>"; |
|
84 | + $htmlHeadXtra[] = "<script type='text/javascript'> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>"; |
|
85 | 85 | } |
86 | 86 | if ((!$is_allowed_to_edit)) { |
87 | 87 | error_log('New LP - User not authorized in lp_add_item.php'); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | $htmlHeadXtra[] = '<script>'. |
26 | 26 | |
27 | -$learnPath->get_js_dropdown_array() . |
|
27 | +$learnPath->get_js_dropdown_array(). |
|
28 | 28 | " |
29 | 29 | function load_cbo(id) { |
30 | 30 | if (!id) { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $isStudentView = isset($_REQUEST['isStudentView']) ? $_REQUEST['isStudentView'] : null; |
76 | 76 | $learnpath_id = isset($_REQUEST['lp_id']) ? intval($_REQUEST['lp_id']) : null; |
77 | -$submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null; |
|
77 | +$submit = isset($_POST['submit_button']) ? $_POST['submit_button'] : null; |
|
78 | 78 | |
79 | 79 | $type = isset($_GET['type']) ? $_GET['type'] : null; |
80 | 80 | $action = isset($_GET['action']) ? $_GET['action'] : null; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | if (!empty($gradebook) && $gradebook == 'view') { |
98 | - $interbreadcrumb[] = array ( |
|
98 | + $interbreadcrumb[] = array( |
|
99 | 99 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
100 | 100 | 'name' => get_lang('ToolGradebook') |
101 | 101 | ); |
@@ -106,19 +106,19 @@ discard block |
||
106 | 106 | |
107 | 107 | switch ($type) { |
108 | 108 | case 'chapter': |
109 | - $interbreadcrumb[]= array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$learnPath->get_id(), 'name' => get_lang('NewStep')); |
|
110 | - $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewChapter')); |
|
109 | + $interbreadcrumb[] = array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$learnPath->get_id(), 'name' => get_lang('NewStep')); |
|
110 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewChapter')); |
|
111 | 111 | break; |
112 | 112 | case 'document': |
113 | - $interbreadcrumb[]= array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$learnPath->get_id(), 'name' => get_lang('NewStep')); |
|
113 | + $interbreadcrumb[] = array('url' => 'lp_controller.php?action=add_item&type=step&lp_id='.$learnPath->get_id(), 'name' => get_lang('NewStep')); |
|
114 | 114 | break; |
115 | 115 | default: |
116 | - $interbreadcrumb[]= array('url' => '#', 'name' => get_lang('NewStep')); |
|
116 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewStep')); |
|
117 | 117 | break; |
118 | 118 | } |
119 | 119 | |
120 | -if ($action == 'add_item' && $type == 'document' ) { |
|
121 | - $interbreadcrumb[]= array ('url' => '#', 'name' => get_lang('NewDocumentCreated')); |
|
120 | +if ($action == 'add_item' && $type == 'document') { |
|
121 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewDocumentCreated')); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | // Theme calls. |
@@ -47,10 +47,10 @@ |
||
47 | 47 | " . |
48 | 48 | "\n" . |
49 | 49 | '$().ready(function() {'."\n" . |
50 | - 'if ($(\'#previous\')) {'."\n" . |
|
50 | + 'if ($(\'#previous\')) {'."\n" . |
|
51 | 51 | 'if(\'parent is\'+$(\'#idParent\').val()) {'. |
52 | - 'load_cbo($(\'#idParent\').val());'."\n" . |
|
53 | - '}}'."\n" . |
|
52 | + 'load_cbo($(\'#idParent\').val());'."\n" . |
|
53 | + '}}'."\n" . |
|
54 | 54 | '});</script>'."\n" ; |
55 | 55 | |
56 | 56 | /* Constants and variables */ |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | /* Header and action code */ |
23 | 23 | $htmlHeadXtra[] = '<script type="text/javascript">'. |
24 | -$_SESSION['oLP']->get_js_dropdown_array() . |
|
24 | +$_SESSION['oLP']->get_js_dropdown_array(). |
|
25 | 25 | " |
26 | 26 | function load_cbo(id) { |
27 | 27 | if (!id) { |
@@ -45,13 +45,13 @@ discard block |
||
45 | 45 | $('#previous').selectpicker('refresh'); |
46 | 46 | } |
47 | 47 | " . |
48 | -"\n" . |
|
49 | -'$().ready(function() {'."\n" . |
|
50 | - 'if ($(\'#previous\')) {'."\n" . |
|
48 | +"\n". |
|
49 | +'$().ready(function() {'."\n". |
|
50 | + 'if ($(\'#previous\')) {'."\n". |
|
51 | 51 | 'if(\'parent is\'+$(\'#idParent\').val()) {'. |
52 | - 'load_cbo($(\'#idParent\').val());'."\n" . |
|
53 | - '}}'."\n" . |
|
54 | -'});</script>'."\n" ; |
|
52 | + 'load_cbo($(\'#idParent\').val());'."\n". |
|
53 | + '}}'."\n". |
|
54 | +'});</script>'."\n"; |
|
55 | 55 | |
56 | 56 | /* Constants and variables */ |
57 | 57 | |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | /* SHOWING THE ADMIN TOOLS */ |
91 | 91 | |
92 | 92 | if (isset($_SESSION['gradebook'])) { |
93 | - $gradebook= $_SESSION['gradebook']; |
|
93 | + $gradebook = $_SESSION['gradebook']; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | if (!empty($gradebook) && $gradebook == 'view') { |
97 | - $interbreadcrumb[] = array ( |
|
97 | + $interbreadcrumb[] = array( |
|
98 | 98 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
99 | 99 | 'name' => get_lang('ToolGradebook') |
100 | 100 | ); |