@@ -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; |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $res = Database::query($sql); |
245 | 245 | |
246 | 246 | if ($this->debug > 2) { |
247 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - query lp items: ' . $sql, 0); |
|
247 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - query lp items: '.$sql, 0); |
|
248 | 248 | error_log('-- Start while--', 0); |
249 | 249 | } |
250 | 250 | |
@@ -264,8 +264,8 @@ discard block |
||
264 | 264 | $this->refs_list[$oItem->ref] = $my_item_id; |
265 | 265 | if ($this->debug > 2) { |
266 | 266 | error_log( |
267 | - 'New LP - learnpath::__construct() - ' . |
|
268 | - 'aicc object with id ' . $my_item_id . |
|
267 | + 'New LP - learnpath::__construct() - '. |
|
268 | + 'aicc object with id '.$my_item_id. |
|
269 | 269 | ' set in items[]', 0); |
270 | 270 | } |
271 | 271 | } |
@@ -282,19 +282,19 @@ discard block |
||
282 | 282 | |
283 | 283 | $this->refs_list[$oItem->ref] = $my_item_id; |
284 | 284 | if ($this->debug > 2) { |
285 | - error_log('New LP - object with id ' . $my_item_id . ' set in items[]', 0); |
|
285 | + error_log('New LP - object with id '.$my_item_id.' set in items[]', 0); |
|
286 | 286 | } |
287 | 287 | } |
288 | 288 | break; |
289 | 289 | case 1: |
290 | 290 | default: |
291 | 291 | if ($this->debug > 2) { |
292 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - calling learnpathItem', 0); |
|
292 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - calling learnpathItem', 0); |
|
293 | 293 | } |
294 | 294 | $oItem = new learnpathItem($row['id'], $user_id, $course_id, $row); |
295 | 295 | |
296 | 296 | if ($this->debug > 2) { |
297 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - end calling learnpathItem', 0); |
|
297 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - end calling learnpathItem', 0); |
|
298 | 298 | } |
299 | 299 | if (is_object($oItem)) { |
300 | 300 | $my_item_id = $oItem->get_id(); |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | $this->refs_list[$my_item_id] = $my_item_id; |
306 | 306 | if ($this->debug > 2) { |
307 | 307 | error_log( |
308 | - 'New LP - learnpath::__construct() ' . __LINE__ . |
|
309 | - ' - object with id ' . $my_item_id . ' set in items[]', |
|
308 | + 'New LP - learnpath::__construct() '.__LINE__. |
|
309 | + ' - object with id '.$my_item_id.' set in items[]', |
|
310 | 310 | 0); |
311 | 311 | } |
312 | 312 | } |
@@ -324,13 +324,13 @@ discard block |
||
324 | 324 | $this->items[$row['id']]->set_lp_view($this->lp_view_id, $course_id); |
325 | 325 | if ($this->items[$row['id']]->get_type() == TOOL_HOTPOTATOES) { |
326 | 326 | $this->items[$row['id']]->current_start_time = 0; |
327 | - $this->items[$row['id']]->current_stop_time = 0; |
|
327 | + $this->items[$row['id']]->current_stop_time = 0; |
|
328 | 328 | } |
329 | 329 | } |
330 | 330 | } |
331 | 331 | |
332 | 332 | if ($this->debug > 2) { |
333 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' ----- end while ----', 0); |
|
333 | + error_log('New LP - learnpath::__construct() '.__LINE__.' ----- end while ----', 0); |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | if (!empty($lp_item_id_list)) { |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | // TODO: Define the current item better. |
423 | 423 | $this->first(); |
424 | 424 | if ($this->debug > 2) { |
425 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - End of learnpath constructor for learnpath ' . $this->get_id(), 0); |
|
425 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - End of learnpath constructor for learnpath '.$this->get_id(), 0); |
|
426 | 426 | } |
427 | 427 | return true; |
428 | 428 | } |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | ) { |
497 | 497 | $course_id = $this->course_info['real_id']; |
498 | 498 | if ($this->debug > 0) { |
499 | - error_log('New LP - In learnpath::add_item(' . $parent . ',' . $previous . ',' . $type . ',' . $id . ',' . $title . ')', 0); |
|
499 | + error_log('New LP - In learnpath::add_item('.$parent.','.$previous.','.$type.','.$id.','.$title.')', 0); |
|
500 | 500 | } |
501 | 501 | if (empty($course_id)) { |
502 | 502 | // Sometimes Oogie doesn't catch the course info but sets $this->cc |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | FROM $tbl_lp_item |
517 | 517 | WHERE |
518 | 518 | c_id = $course_id AND |
519 | - lp_id = " . $this->get_id() . " AND |
|
519 | + lp_id = ".$this->get_id()." AND |
|
520 | 520 | parent_item_id = " . $parent; |
521 | 521 | |
522 | 522 | $res_count = Database::query($sql); |
@@ -526,11 +526,11 @@ discard block |
||
526 | 526 | if ($num > 0) { |
527 | 527 | if ($previous == 0) { |
528 | 528 | $sql = "SELECT id, next_item_id, display_order |
529 | - FROM " . $tbl_lp_item . " |
|
529 | + FROM " . $tbl_lp_item." |
|
530 | 530 | WHERE |
531 | 531 | c_id = $course_id AND |
532 | - lp_id = " . $this->get_id() . " AND |
|
533 | - parent_item_id = " . $parent . " AND |
|
532 | + lp_id = ".$this->get_id()." AND |
|
533 | + parent_item_id = " . $parent." AND |
|
534 | 534 | previous_item_id = 0 OR |
535 | 535 | previous_item_id=" . $parent; |
536 | 536 | $result = Database::query($sql); |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | FROM $tbl_lp_item |
546 | 546 | WHERE |
547 | 547 | c_id = $course_id AND |
548 | - lp_id = " . $this->get_id() . " AND |
|
548 | + lp_id = ".$this->get_id()." AND |
|
549 | 549 | id = " . $previous; |
550 | 550 | |
551 | 551 | $result = Database::query($sql); |
@@ -565,8 +565,8 @@ discard block |
||
565 | 565 | $typeCleaned = Database::escape_string($type); |
566 | 566 | if ($type == 'quiz') { |
567 | 567 | $sql = 'SELECT SUM(ponderation) |
568 | - FROM ' . Database :: get_course_table(TABLE_QUIZ_QUESTION) . ' as quiz_question |
|
569 | - INNER JOIN ' . Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION) . ' as quiz_rel_question |
|
568 | + FROM ' . Database :: get_course_table(TABLE_QUIZ_QUESTION).' as quiz_question |
|
569 | + INNER JOIN ' . Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION).' as quiz_rel_question |
|
570 | 570 | ON |
571 | 571 | quiz_question.id = quiz_rel_question.question_id AND |
572 | 572 | quiz_question.c_id = quiz_rel_question.c_id |
@@ -589,16 +589,16 @@ discard block |
||
589 | 589 | $params = array( |
590 | 590 | "c_id" => $course_id, |
591 | 591 | "lp_id" => $this->get_id(), |
592 | - "item_type" =>$typeCleaned , |
|
592 | + "item_type" =>$typeCleaned, |
|
593 | 593 | "ref" => '', |
594 | - "title" =>$title , |
|
594 | + "title" =>$title, |
|
595 | 595 | "description" => $description, |
596 | 596 | "path" => $id, |
597 | 597 | "max_score" => $max_score, |
598 | 598 | "parent_item_id" => $parent, |
599 | 599 | "previous_item_id" => $previous, |
600 | 600 | "next_item_id" => intval($next), |
601 | - "display_order" => $display_order +1, |
|
601 | + "display_order" => $display_order + 1, |
|
602 | 602 | "prerequisite" => $prerequisites, |
603 | 603 | "max_time_allowed" => $max_time_allowed, |
604 | 604 | 'min_score' => 0, |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | $new_item_id = Database::insert($tbl_lp_item, $params); |
613 | 613 | |
614 | 614 | if ($this->debug > 2) { |
615 | - error_log('New LP - Inserting chapter: ' . $new_item_id, 0); |
|
615 | + error_log('New LP - Inserting chapter: '.$new_item_id, 0); |
|
616 | 616 | } |
617 | 617 | |
618 | 618 | if ($new_item_id) { |
@@ -629,28 +629,28 @@ discard block |
||
629 | 629 | Database::query($sql); |
630 | 630 | |
631 | 631 | // Update all the items after the new item. |
632 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
632 | + $sql = "UPDATE ".$tbl_lp_item." |
|
633 | 633 | SET display_order = display_order + 1 |
634 | 634 | WHERE |
635 | 635 | c_id = $course_id AND |
636 | - lp_id = " . $this->get_id() . " AND |
|
637 | - id <> " . $new_item_id . " AND |
|
638 | - parent_item_id = " . $parent . " AND |
|
636 | + lp_id = ".$this->get_id()." AND |
|
637 | + id <> " . $new_item_id." AND |
|
638 | + parent_item_id = " . $parent." AND |
|
639 | 639 | display_order > " . $display_order; |
640 | 640 | Database::query($sql); |
641 | 641 | |
642 | 642 | // Update the item that should come after the new item. |
643 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
644 | - SET ref = " . $new_item_id . " |
|
645 | - WHERE c_id = $course_id AND id = " . $new_item_id; |
|
643 | + $sql = "UPDATE ".$tbl_lp_item." |
|
644 | + SET ref = " . $new_item_id." |
|
645 | + WHERE c_id = $course_id AND id = ".$new_item_id; |
|
646 | 646 | Database::query($sql); |
647 | 647 | |
648 | 648 | // Upload audio. |
649 | 649 | if (!empty($_FILES['mp3']['name'])) { |
650 | 650 | // Create the audio folder if it does not exist yet. |
651 | - $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document/'; |
|
652 | - if (!is_dir($filepath . 'audio')) { |
|
653 | - mkdir($filepath . 'audio', api_get_permissions_for_new_directories()); |
|
651 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
652 | + if (!is_dir($filepath.'audio')) { |
|
653 | + mkdir($filepath.'audio', api_get_permissions_for_new_directories()); |
|
654 | 654 | $audio_id = add_document( |
655 | 655 | $_course, |
656 | 656 | '/audio', |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | $file_path = handle_uploaded_document( |
688 | 688 | $_course, |
689 | 689 | $_FILES['mp3'], |
690 | - api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document', |
|
690 | + api_get_path(SYS_COURSE_PATH).$_course['path'].'/document', |
|
691 | 691 | '/audio', |
692 | 692 | api_get_user_id(), |
693 | 693 | '', |
@@ -703,8 +703,8 @@ discard block |
||
703 | 703 | |
704 | 704 | // Store the mp3 file in the lp_item table. |
705 | 705 | $sql = "UPDATE $tbl_lp_item SET |
706 | - audio = '" . Database::escape_string($file) . "' |
|
707 | - WHERE id = '" . intval($new_item_id) . "'"; |
|
706 | + audio = '".Database::escape_string($file)."' |
|
707 | + WHERE id = '" . intval($new_item_id)."'"; |
|
708 | 708 | Database::query($sql); |
709 | 709 | } |
710 | 710 | } |
@@ -780,7 +780,7 @@ discard block |
||
780 | 780 | while (Database :: num_rows($res_name)) { |
781 | 781 | // There is already one such name, update the current one a bit. |
782 | 782 | $i++; |
783 | - $name = $name . ' - ' . $i; |
|
783 | + $name = $name.' - '.$i; |
|
784 | 784 | $check_name = "SELECT * FROM $tbl_lp WHERE c_id = $course_id AND name = '$name'"; |
785 | 785 | $res_name = Database::query($check_name); |
786 | 786 | } |
@@ -892,7 +892,7 @@ discard block |
||
892 | 892 | // if $item points to an object and there is a parent. |
893 | 893 | if ($debug) { |
894 | 894 | error_log( |
895 | - 'Autocompleting parent of item ' . $item . ' "'.$currentItem->get_title().'" (item ' . $parent_id . ' "'.$parent->get_title().'") ', |
|
895 | + 'Autocompleting parent of item '.$item.' "'.$currentItem->get_title().'" (item '.$parent_id.' "'.$parent->get_title().'") ', |
|
896 | 896 | 0 |
897 | 897 | ); |
898 | 898 | } |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | if ($childItemId != $item) { |
921 | 921 | if ($debug) { |
922 | 922 | error_log( |
923 | - 'Looking at brother #'.$childItemId . ' "' . $childItem->get_title() . '", status is ' . $childItem->get_status(), |
|
923 | + 'Looking at brother #'.$childItemId.' "'.$childItem->get_title().'", status is '.$childItem->get_status(), |
|
924 | 924 | 0 |
925 | 925 | ); |
926 | 926 | } |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | } else { |
941 | 941 | if ($debug > 2) { |
942 | 942 | error_log( |
943 | - '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, |
|
943 | + '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, |
|
944 | 944 | 0 |
945 | 945 | ); |
946 | 946 | } |
@@ -1045,15 +1045,15 @@ discard block |
||
1045 | 1045 | // Delete lp item id. |
1046 | 1046 | foreach ($this->items as $id => $dummy) { |
1047 | 1047 | $sql = "DELETE FROM $lp_item_view |
1048 | - WHERE c_id = $course_id AND lp_item_id = '" . $id . "'"; |
|
1048 | + WHERE c_id = $course_id AND lp_item_id = '".$id."'"; |
|
1049 | 1049 | Database::query($sql); |
1050 | 1050 | } |
1051 | 1051 | |
1052 | 1052 | // Proposed by Christophe (nickname: clefevre) |
1053 | - $sql = "DELETE FROM $lp_item WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
1053 | + $sql = "DELETE FROM $lp_item WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
1054 | 1054 | Database::query($sql); |
1055 | 1055 | |
1056 | - $sql = "DELETE FROM $lp_view WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
1056 | + $sql = "DELETE FROM $lp_view WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
1057 | 1057 | Database::query($sql); |
1058 | 1058 | |
1059 | 1059 | self::toggle_publish($this->lp_id, 'i'); |
@@ -1061,32 +1061,32 @@ discard block |
||
1061 | 1061 | if ($this->type == 2 || $this->type == 3) { |
1062 | 1062 | // This is a scorm learning path, delete the files as well. |
1063 | 1063 | $sql = "SELECT path FROM $lp |
1064 | - WHERE c_id = ".$course_id." AND id = " . $this->lp_id; |
|
1064 | + WHERE c_id = ".$course_id." AND id = ".$this->lp_id; |
|
1065 | 1065 | $res = Database::query($sql); |
1066 | 1066 | if (Database :: num_rows($res) > 0) { |
1067 | 1067 | $row = Database :: fetch_array($res); |
1068 | 1068 | $path = $row['path']; |
1069 | 1069 | $sql = "SELECT id FROM $lp |
1070 | - WHERE c_id = ".$course_id." AND path = '$path' AND id != " . $this->lp_id; |
|
1070 | + WHERE c_id = ".$course_id." AND path = '$path' AND id != ".$this->lp_id; |
|
1071 | 1071 | $res = Database::query($sql); |
1072 | 1072 | if (Database :: num_rows($res) > 0) { // Another learning path uses this directory, so don't delete it. |
1073 | 1073 | if ($this->debug > 2) { |
1074 | - error_log('New LP - In learnpath::delete(), found other LP using path ' . $path . ', keeping directory', 0); |
|
1074 | + error_log('New LP - In learnpath::delete(), found other LP using path '.$path.', keeping directory', 0); |
|
1075 | 1075 | } |
1076 | 1076 | } else { |
1077 | 1077 | // No other LP uses that directory, delete it. |
1078 | - $course_rel_dir = api_get_course_path() . '/scorm/'; // scorm dir web path starting from /courses |
|
1079 | - $course_scorm_dir = api_get_path(SYS_COURSE_PATH) . $course_rel_dir; // The absolute system path for this course. |
|
1080 | - if ($delete == 'remove' && is_dir($course_scorm_dir . $path) and !empty ($course_scorm_dir)) { |
|
1078 | + $course_rel_dir = api_get_course_path().'/scorm/'; // scorm dir web path starting from /courses |
|
1079 | + $course_scorm_dir = api_get_path(SYS_COURSE_PATH).$course_rel_dir; // The absolute system path for this course. |
|
1080 | + if ($delete == 'remove' && is_dir($course_scorm_dir.$path) and !empty ($course_scorm_dir)) { |
|
1081 | 1081 | if ($this->debug > 2) { |
1082 | - error_log('New LP - In learnpath::delete(), found SCORM, deleting directory: ' . $course_scorm_dir . $path, 0); |
|
1082 | + error_log('New LP - In learnpath::delete(), found SCORM, deleting directory: '.$course_scorm_dir.$path, 0); |
|
1083 | 1083 | } |
1084 | 1084 | // Proposed by Christophe (clefevre). |
1085 | 1085 | if (strcmp(substr($path, -2), "/.") == 0) { |
1086 | 1086 | $path = substr($path, 0, -1); // Remove "." at the end. |
1087 | 1087 | } |
1088 | 1088 | //exec('rm -rf ' . $course_scorm_dir . $path); // See Bug #5208, this is not OS-portable way. |
1089 | - rmdirr($course_scorm_dir . $path); |
|
1089 | + rmdirr($course_scorm_dir.$path); |
|
1090 | 1090 | } |
1091 | 1091 | } |
1092 | 1092 | } |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | WHERE c_id = ".$course_id." AND (link LIKE '$link%' AND image='scormbuilder.gif')"; |
1100 | 1100 | Database::query($sql); |
1101 | 1101 | |
1102 | - $sql = "DELETE FROM $lp WHERE c_id = ".$course_id." AND id = " . $this->lp_id; |
|
1102 | + $sql = "DELETE FROM $lp WHERE c_id = ".$course_id." AND id = ".$this->lp_id; |
|
1103 | 1103 | Database::query($sql); |
1104 | 1104 | // Updates the display order of all lps. |
1105 | 1105 | $this->update_display_order(); |
@@ -1112,7 +1112,7 @@ discard block |
||
1112 | 1112 | api_get_user_id() |
1113 | 1113 | ); |
1114 | 1114 | |
1115 | - $link_info = GradebookUtils::is_resource_in_course_gradebook(api_get_course_id(), 4 , $id, api_get_session_id()); |
|
1115 | + $link_info = GradebookUtils::is_resource_in_course_gradebook(api_get_course_id(), 4, $id, api_get_session_id()); |
|
1116 | 1116 | if ($link_info) { |
1117 | 1117 | GradebookUtils::remove_resource_from_course_gradebook($link_info->getId()); |
1118 | 1118 | } |
@@ -1132,7 +1132,7 @@ discard block |
||
1132 | 1132 | { |
1133 | 1133 | $course_id = $this->course_info['real_id']; |
1134 | 1134 | if ($this->debug > 0) { |
1135 | - error_log('New LP - In learnpath::delete_children_items(' . $id . ')', 0); |
|
1135 | + error_log('New LP - In learnpath::delete_children_items('.$id.')', 0); |
|
1136 | 1136 | } |
1137 | 1137 | $num = 0; |
1138 | 1138 | if (empty ($id) || $id != strval(intval($id))) { |
@@ -1143,7 +1143,7 @@ discard block |
||
1143 | 1143 | $res = Database::query($sql); |
1144 | 1144 | while ($row = Database :: fetch_array($res)) { |
1145 | 1145 | $num += $this->delete_children_items($row['id']); |
1146 | - $sql_del = "DELETE FROM $lp_item WHERE c_id = ".$course_id." AND id = " . $row['id']; |
|
1146 | + $sql_del = "DELETE FROM $lp_item WHERE c_id = ".$course_id." AND id = ".$row['id']; |
|
1147 | 1147 | Database::query($sql_del); |
1148 | 1148 | $num++; |
1149 | 1149 | } |
@@ -1173,7 +1173,7 @@ discard block |
||
1173 | 1173 | } |
1174 | 1174 | // First select item to get previous, next, and display order. |
1175 | 1175 | $lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
1176 | - $sql_sel = "SELECT * FROM $lp_item WHERE c_id = " . $course->getId() . " AND id = $id"; |
|
1176 | + $sql_sel = "SELECT * FROM $lp_item WHERE c_id = ".$course->getId()." AND id = $id"; |
|
1177 | 1177 | $res_sel = Database::query($sql_sel); |
1178 | 1178 | if (Database :: num_rows($res_sel) < 1) { |
1179 | 1179 | return false; |
@@ -1187,28 +1187,28 @@ discard block |
||
1187 | 1187 | // Delete children items. |
1188 | 1188 | $num = $this->delete_children_items($id); |
1189 | 1189 | if ($this->debug > 2) { |
1190 | - error_log('New LP - learnpath::delete_item() - deleted ' . $num . ' children of element ' . $id, 0); |
|
1190 | + error_log('New LP - learnpath::delete_item() - deleted '.$num.' children of element '.$id, 0); |
|
1191 | 1191 | } |
1192 | 1192 | // Now delete the item. |
1193 | 1193 | $sql_del = "DELETE FROM $lp_item WHERE c_id = {$course->getId()} AND id = $id"; |
1194 | 1194 | if ($this->debug > 2) { |
1195 | - error_log('New LP - Deleting item: ' . $sql_del, 0); |
|
1195 | + error_log('New LP - Deleting item: '.$sql_del, 0); |
|
1196 | 1196 | } |
1197 | 1197 | Database::query($sql_del); |
1198 | 1198 | // Now update surrounding items. |
1199 | 1199 | $sql_upd = "UPDATE $lp_item SET next_item_id = $next |
1200 | - WHERE c_id = " . $course->getId() . " AND id = $previous"; |
|
1200 | + WHERE c_id = ".$course->getId()." AND id = $previous"; |
|
1201 | 1201 | Database::query($sql_upd); |
1202 | 1202 | $sql_upd = "UPDATE $lp_item SET previous_item_id = $previous |
1203 | - WHERE c_id = " . $course->getId() . " AND id = $next"; |
|
1203 | + WHERE c_id = ".$course->getId()." AND id = $next"; |
|
1204 | 1204 | Database::query($sql_upd); |
1205 | 1205 | // Now update all following items with new display order. |
1206 | 1206 | $sql_all = "UPDATE $lp_item SET display_order = display_order-1 |
1207 | - WHERE c_id = " . $course->getId() . " AND lp_id = $lp AND parent_item_id = $parent AND display_order > $display"; |
|
1207 | + WHERE c_id = ".$course->getId()." AND lp_id = $lp AND parent_item_id = $parent AND display_order > $display"; |
|
1208 | 1208 | Database::query($sql_all); |
1209 | 1209 | |
1210 | 1210 | //Removing prerequisites since the item will not longer exist |
1211 | - $sql_all = "UPDATE $lp_item SET prerequisite = '' WHERE c_id = " . $course->getId() . " AND prerequisite = $id"; |
|
1211 | + $sql_all = "UPDATE $lp_item SET prerequisite = '' WHERE c_id = ".$course->getId()." AND prerequisite = $id"; |
|
1212 | 1212 | Database::query($sql_all); |
1213 | 1213 | |
1214 | 1214 | // Remove from search engine if enabled. |
@@ -1276,15 +1276,15 @@ discard block |
||
1276 | 1276 | } |
1277 | 1277 | |
1278 | 1278 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
1279 | - $sql_select = "SELECT * FROM " . $tbl_lp_item . " WHERE c_id = ".$course_id." AND id = " . $id; |
|
1279 | + $sql_select = "SELECT * FROM ".$tbl_lp_item." WHERE c_id = ".$course_id." AND id = ".$id; |
|
1280 | 1280 | $res_select = Database::query($sql_select); |
1281 | 1281 | $row_select = Database :: fetch_array($res_select); |
1282 | 1282 | $audio_update_sql = ''; |
1283 | 1283 | if (is_array($audio) && !empty ($audio['tmp_name']) && $audio['error'] === 0) { |
1284 | 1284 | // Create the audio folder if it does not exist yet. |
1285 | - $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document/'; |
|
1286 | - if (!is_dir($filepath . 'audio')) { |
|
1287 | - mkdir($filepath . 'audio', api_get_permissions_for_new_directories()); |
|
1285 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
1286 | + if (!is_dir($filepath.'audio')) { |
|
1287 | + mkdir($filepath.'audio', api_get_permissions_for_new_directories()); |
|
1288 | 1288 | $audio_id = add_document( |
1289 | 1289 | $_course, |
1290 | 1290 | '/audio', |
@@ -1322,11 +1322,11 @@ discard block |
||
1322 | 1322 | $pi = pathinfo($audio['name']); |
1323 | 1323 | if ($pi['extension'] == 'mp3') { |
1324 | 1324 | $c_det = api_get_course_info($this->cc); |
1325 | - $bp = api_get_path(SYS_COURSE_PATH) . $c_det['path'] . '/document'; |
|
1325 | + $bp = api_get_path(SYS_COURSE_PATH).$c_det['path'].'/document'; |
|
1326 | 1326 | $path = handle_uploaded_document($c_det, $audio, $bp, '/audio', api_get_user_id(), 0, null, 0, 'rename', false, 0); |
1327 | 1327 | $path = substr($path, 7); |
1328 | 1328 | // Update reference in lp_item - audio path is the path from inside de document/audio/ dir. |
1329 | - $audio_update_sql = ", audio = '" . Database::escape_string($path) . "' "; |
|
1329 | + $audio_update_sql = ", audio = '".Database::escape_string($path)."' "; |
|
1330 | 1330 | } |
1331 | 1331 | } |
1332 | 1332 | |
@@ -1336,13 +1336,13 @@ discard block |
||
1336 | 1336 | // TODO: htmlspecialchars to be checked for encoding related problems. |
1337 | 1337 | if ($same_parent && $same_previous) { |
1338 | 1338 | // Only update title and description. |
1339 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1340 | - SET title = '" . Database::escape_string($title) . "', |
|
1341 | - prerequisite = '" . $prerequisites . "', |
|
1342 | - description = '" . Database::escape_string($description) . "' |
|
1343 | - " . $audio_update_sql . ", |
|
1344 | - max_time_allowed = '" . Database::escape_string($max_time_allowed) . "' |
|
1345 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
1339 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1340 | + SET title = '" . Database::escape_string($title)."', |
|
1341 | + prerequisite = '" . $prerequisites."', |
|
1342 | + description = '" . Database::escape_string($description)."' |
|
1343 | + " . $audio_update_sql.", |
|
1344 | + max_time_allowed = '" . Database::escape_string($max_time_allowed)."' |
|
1345 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
1346 | 1346 | Database::query($sql); |
1347 | 1347 | } else { |
1348 | 1348 | $old_parent = $row_select['parent_item_id']; |
@@ -1357,27 +1357,27 @@ discard block |
||
1357 | 1357 | |
1358 | 1358 | if ($old_previous != 0) { |
1359 | 1359 | // Next |
1360 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1361 | - SET next_item_id = " . $old_next . " |
|
1362 | - WHERE c_id = ".$course_id." AND id = " . $old_previous; |
|
1360 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1361 | + SET next_item_id = " . $old_next." |
|
1362 | + WHERE c_id = ".$course_id." AND id = ".$old_previous; |
|
1363 | 1363 | Database::query($sql); |
1364 | 1364 | } |
1365 | 1365 | |
1366 | 1366 | if ($old_next != 0) { |
1367 | 1367 | // Previous |
1368 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1369 | - SET previous_item_id = " . $old_previous . " |
|
1370 | - WHERE c_id = ".$course_id." AND id = " . $old_next; |
|
1368 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1369 | + SET previous_item_id = " . $old_previous." |
|
1370 | + WHERE c_id = ".$course_id." AND id = ".$old_next; |
|
1371 | 1371 | Database::query($sql); |
1372 | 1372 | } |
1373 | 1373 | |
1374 | 1374 | // display_order - 1 for every item with a display_order bigger then the display_order of the current item. |
1375 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1375 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1376 | 1376 | SET display_order = display_order - 1 |
1377 | 1377 | WHERE |
1378 | 1378 | c_id = ".$course_id." AND |
1379 | - display_order > " . $old_order . " AND |
|
1380 | - lp_id = " . $this->lp_id . " AND |
|
1379 | + display_order > " . $old_order." AND |
|
1380 | + lp_id = " . $this->lp_id." AND |
|
1381 | 1381 | parent_item_id = " . $old_parent; |
1382 | 1382 | Database::query($sql); |
1383 | 1383 | /* END -- virtually remove the current item id */ |
@@ -1387,11 +1387,11 @@ discard block |
||
1387 | 1387 | if ($previous == 0) { |
1388 | 1388 | // Select the data of the item that should come after the current item. |
1389 | 1389 | $sql = "SELECT id, display_order |
1390 | - FROM " . $tbl_lp_item . " |
|
1390 | + FROM " . $tbl_lp_item." |
|
1391 | 1391 | WHERE |
1392 | 1392 | c_id = ".$course_id." AND |
1393 | - lp_id = " . $this->lp_id . " AND |
|
1394 | - parent_item_id = " . $parent . " AND |
|
1393 | + lp_id = " . $this->lp_id." AND |
|
1394 | + parent_item_id = " . $parent." AND |
|
1395 | 1395 | previous_item_id = " . $previous; |
1396 | 1396 | $res_select_old = Database::query($sql); |
1397 | 1397 | $row_select_old = Database::fetch_array($res_select_old); |
@@ -1407,8 +1407,8 @@ discard block |
||
1407 | 1407 | } else { |
1408 | 1408 | // Select the data of the item that should come before the current item. |
1409 | 1409 | $sql = "SELECT next_item_id, display_order |
1410 | - FROM " . $tbl_lp_item . " |
|
1411 | - WHERE c_id = ".$course_id." AND id = " . $previous; |
|
1410 | + FROM " . $tbl_lp_item." |
|
1411 | + WHERE c_id = ".$course_id." AND id = ".$previous; |
|
1412 | 1412 | $res_select_old = Database::query($sql); |
1413 | 1413 | $row_select_old = Database :: fetch_array($res_select_old); |
1414 | 1414 | $new_next = $row_select_old['next_item_id']; |
@@ -1417,57 +1417,57 @@ discard block |
||
1417 | 1417 | |
1418 | 1418 | // TODO: htmlspecialchars to be checked for encoding related problems. |
1419 | 1419 | // Update the current item with the new data. |
1420 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1420 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1421 | 1421 | SET |
1422 | - title = '" . Database::escape_string($title) . "', |
|
1423 | - description = '" . Database::escape_string($description) . "', |
|
1424 | - parent_item_id = " . $parent . ", |
|
1425 | - previous_item_id = " . $previous . ", |
|
1426 | - next_item_id = " . $new_next . ", |
|
1427 | - display_order = " . $new_order . " |
|
1428 | - " . $audio_update_sql . " |
|
1429 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
1422 | + title = '" . Database::escape_string($title)."', |
|
1423 | + description = '" . Database::escape_string($description)."', |
|
1424 | + parent_item_id = " . $parent.", |
|
1425 | + previous_item_id = " . $previous.", |
|
1426 | + next_item_id = " . $new_next.", |
|
1427 | + display_order = " . $new_order." |
|
1428 | + " . $audio_update_sql." |
|
1429 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
1430 | 1430 | Database::query($sql); |
1431 | 1431 | |
1432 | 1432 | if ($previous != 0) { |
1433 | 1433 | // Update the previous item's next_item_id. |
1434 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1435 | - SET next_item_id = " . $id . " |
|
1436 | - WHERE c_id = ".$course_id." AND id = " . $previous; |
|
1434 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1435 | + SET next_item_id = " . $id." |
|
1436 | + WHERE c_id = ".$course_id." AND id = ".$previous; |
|
1437 | 1437 | Database::query($sql); |
1438 | 1438 | } |
1439 | 1439 | |
1440 | 1440 | if ($new_next != 0) { |
1441 | 1441 | // Update the next item's previous_item_id. |
1442 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1443 | - SET previous_item_id = " . $id . " |
|
1444 | - WHERE c_id = ".$course_id." AND id = " . $new_next; |
|
1442 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1443 | + SET previous_item_id = " . $id." |
|
1444 | + WHERE c_id = ".$course_id." AND id = ".$new_next; |
|
1445 | 1445 | Database::query($sql); |
1446 | 1446 | } |
1447 | 1447 | |
1448 | 1448 | if ($old_prerequisite != $prerequisites) { |
1449 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1450 | - SET prerequisite = '" . $prerequisites . "' |
|
1451 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
1449 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1450 | + SET prerequisite = '" . $prerequisites."' |
|
1451 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
1452 | 1452 | Database::query($sql); |
1453 | 1453 | } |
1454 | 1454 | |
1455 | 1455 | if ($old_max_time_allowed != $max_time_allowed) { |
1456 | 1456 | // update max time allowed |
1457 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1458 | - SET max_time_allowed = " . $max_time_allowed . " |
|
1459 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
1457 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1458 | + SET max_time_allowed = " . $max_time_allowed." |
|
1459 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
1460 | 1460 | Database::query($sql); |
1461 | 1461 | } |
1462 | 1462 | |
1463 | 1463 | // Update all the items with the same or a bigger display_order than the current item. |
1464 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
1464 | + $sql = "UPDATE ".$tbl_lp_item." |
|
1465 | 1465 | SET display_order = display_order + 1 |
1466 | 1466 | WHERE |
1467 | 1467 | c_id = ".$course_id." AND |
1468 | - lp_id = " . $this->get_id() . " AND |
|
1469 | - id <> " . $id . " AND |
|
1470 | - parent_item_id = " . $parent . " AND |
|
1468 | + lp_id = " . $this->get_id()." AND |
|
1469 | + id <> " . $id." AND |
|
1470 | + parent_item_id = " . $parent." AND |
|
1471 | 1471 | display_order >= " . $new_order; |
1472 | 1472 | |
1473 | 1473 | Database::query($sql); |
@@ -1493,7 +1493,7 @@ discard block |
||
1493 | 1493 | { |
1494 | 1494 | $course_id = api_get_course_int_id(); |
1495 | 1495 | if ($this->debug > 0) { |
1496 | - error_log('New LP - In learnpath::edit_item_prereq(' . $id . ',' . $prerequisite_id . ',' . $mastery_score . ',' . $max_score . ')', 0); |
|
1496 | + error_log('New LP - In learnpath::edit_item_prereq('.$id.','.$prerequisite_id.','.$mastery_score.','.$max_score.')', 0); |
|
1497 | 1497 | } |
1498 | 1498 | |
1499 | 1499 | if (empty($id) || ($id != strval(intval($id))) || empty ($prerequisite_id)) { |
@@ -1591,8 +1591,8 @@ discard block |
||
1591 | 1591 | error_log('New LP - In learnpath::get_brother_chapters()', 0); |
1592 | 1592 | } |
1593 | 1593 | |
1594 | - if (empty($id)|| $id != strval(intval($id))) { |
|
1595 | - return array (); |
|
1594 | + if (empty($id) || $id != strval(intval($id))) { |
|
1595 | + return array(); |
|
1596 | 1596 | } |
1597 | 1597 | |
1598 | 1598 | $lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
@@ -1610,13 +1610,13 @@ discard block |
||
1610 | 1610 | item_type='dokeos_chapter' |
1611 | 1611 | ORDER BY display_order"; |
1612 | 1612 | $res_bros = Database::query($sql_bros); |
1613 | - $list = array (); |
|
1613 | + $list = array(); |
|
1614 | 1614 | while ($row_bro = Database :: fetch_array($res_bros)) { |
1615 | 1615 | $list[] = $row_bro; |
1616 | 1616 | } |
1617 | 1617 | return $list; |
1618 | 1618 | } |
1619 | - return array (); |
|
1619 | + return array(); |
|
1620 | 1620 | } |
1621 | 1621 | |
1622 | 1622 | /** |
@@ -1629,11 +1629,11 @@ discard block |
||
1629 | 1629 | { |
1630 | 1630 | $course_id = api_get_course_int_id(); |
1631 | 1631 | if ($this->debug > 0) { |
1632 | - error_log('New LP - In learnpath::get_brother_items(' . $id . ')', 0); |
|
1632 | + error_log('New LP - In learnpath::get_brother_items('.$id.')', 0); |
|
1633 | 1633 | } |
1634 | 1634 | |
1635 | 1635 | if (empty ($id) || $id != strval(intval($id))) { |
1636 | - return array (); |
|
1636 | + return array(); |
|
1637 | 1637 | } |
1638 | 1638 | |
1639 | 1639 | $lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
@@ -1645,13 +1645,13 @@ discard block |
||
1645 | 1645 | $sql_bros = "SELECT * FROM $lp_item WHERE c_id = ".$course_id." AND parent_item_id = $parent |
1646 | 1646 | ORDER BY display_order"; |
1647 | 1647 | $res_bros = Database::query($sql_bros); |
1648 | - $list = array (); |
|
1648 | + $list = array(); |
|
1649 | 1649 | while ($row_bro = Database :: fetch_array($res_bros)) { |
1650 | 1650 | $list[] = $row_bro; |
1651 | 1651 | } |
1652 | 1652 | return $list; |
1653 | 1653 | } |
1654 | - return array (); |
|
1654 | + return array(); |
|
1655 | 1655 | } |
1656 | 1656 | |
1657 | 1657 | /** |
@@ -1721,7 +1721,7 @@ discard block |
||
1721 | 1721 | $current = $this->current; |
1722 | 1722 | } |
1723 | 1723 | if ($this->debug > 2) { |
1724 | - error_log('New LP - In learnpath::get_current_item_id() - Returning ' . $current, 0); |
|
1724 | + error_log('New LP - In learnpath::get_current_item_id() - Returning '.$current, 0); |
|
1725 | 1725 | } |
1726 | 1726 | return $current; |
1727 | 1727 | } |
@@ -1802,7 +1802,7 @@ discard block |
||
1802 | 1802 | ) { |
1803 | 1803 | |
1804 | 1804 | if ($this->debug > 2) { |
1805 | - 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); |
|
1805 | + 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); |
|
1806 | 1806 | } |
1807 | 1807 | $index = -1; |
1808 | 1808 | foreach ($this->ordered_items as $myindex => $item_id) { |
@@ -1814,7 +1814,7 @@ discard block |
||
1814 | 1814 | if ($index == -1) { |
1815 | 1815 | // Index hasn't changed, so item not found - panic (this shouldn't happen). |
1816 | 1816 | if ($this->debug > 2) { |
1817 | - error_log('New LP - Last item (' . $this->last_item_seen . ') was found in items but not in ordered_items, panic!', 0); |
|
1817 | + error_log('New LP - Last item ('.$this->last_item_seen.') was found in items but not in ordered_items, panic!', 0); |
|
1818 | 1818 | } |
1819 | 1819 | return false; |
1820 | 1820 | } else { |
@@ -1829,7 +1829,7 @@ discard block |
||
1829 | 1829 | $index = 0; |
1830 | 1830 | // Loop through all ordered items and stop at the first item that is |
1831 | 1831 | // not a directory *and* that has not been completed yet. |
1832 | - while ( !empty($this->ordered_items[$index]) AND |
|
1832 | + while (!empty($this->ordered_items[$index]) AND |
|
1833 | 1833 | is_a($this->items[$this->ordered_items[$index]], 'learnpathItem') AND |
1834 | 1834 | ( |
1835 | 1835 | $this->items[$this->ordered_items[$index]]->get_type() == 'dir' OR |
@@ -1843,14 +1843,14 @@ discard block |
||
1843 | 1843 | $this->current = isset($this->ordered_items[$index]) ? $this->ordered_items[$index] : null; |
1844 | 1844 | $this->index = $index; |
1845 | 1845 | if ($this->debug > 2) { |
1846 | - error_log('$index ' . $index); |
|
1846 | + error_log('$index '.$index); |
|
1847 | 1847 | } |
1848 | 1848 | if ($this->debug > 2) { |
1849 | - error_log('New LP - In learnpath::first() - No last item seen. New last = ' . $this->last . '(' . $this->ordered_items[$index] . ')', 0); |
|
1849 | + error_log('New LP - In learnpath::first() - No last item seen. New last = '.$this->last.'('.$this->ordered_items[$index].')', 0); |
|
1850 | 1850 | } |
1851 | 1851 | } |
1852 | 1852 | if ($this->debug > 2) { |
1853 | - error_log('New LP - In learnpath::first() - First item is ' . $this->get_current_item_id()); |
|
1853 | + error_log('New LP - In learnpath::first() - First item is '.$this->get_current_item_id()); |
|
1854 | 1854 | } |
1855 | 1855 | } |
1856 | 1856 | |
@@ -1863,7 +1863,7 @@ discard block |
||
1863 | 1863 | public function get_js_info($item_id = '') |
1864 | 1864 | { |
1865 | 1865 | if ($this->debug > 0) { |
1866 | - error_log('New LP - In learnpath::get_js_info(' . $item_id . ')', 0); |
|
1866 | + error_log('New LP - In learnpath::get_js_info('.$item_id.')', 0); |
|
1867 | 1867 | } |
1868 | 1868 | |
1869 | 1869 | $info = ''; |
@@ -1873,17 +1873,17 @@ discard block |
||
1873 | 1873 | //if item is defined, return values from DB |
1874 | 1874 | $oItem = $this->items[$item_id]; |
1875 | 1875 | $info .= '<script language="javascript">'; |
1876 | - $info .= "top.set_score(" . $oItem->get_score() . ");\n"; |
|
1877 | - $info .= "top.set_max(" . $oItem->get_max() . ");\n"; |
|
1878 | - $info .= "top.set_min(" . $oItem->get_min() . ");\n"; |
|
1879 | - $info .= "top.set_lesson_status('" . $oItem->get_status() . "');"; |
|
1880 | - $info .= "top.set_session_time('" . $oItem->get_scorm_time('js') . "');"; |
|
1881 | - $info .= "top.set_suspend_data('" . $oItem->get_suspend_data() . "');"; |
|
1882 | - $info .= "top.set_saved_lesson_status('" . $oItem->get_status() . "');"; |
|
1876 | + $info .= "top.set_score(".$oItem->get_score().");\n"; |
|
1877 | + $info .= "top.set_max(".$oItem->get_max().");\n"; |
|
1878 | + $info .= "top.set_min(".$oItem->get_min().");\n"; |
|
1879 | + $info .= "top.set_lesson_status('".$oItem->get_status()."');"; |
|
1880 | + $info .= "top.set_session_time('".$oItem->get_scorm_time('js')."');"; |
|
1881 | + $info .= "top.set_suspend_data('".$oItem->get_suspend_data()."');"; |
|
1882 | + $info .= "top.set_saved_lesson_status('".$oItem->get_status()."');"; |
|
1883 | 1883 | $info .= "top.set_flag_synchronized();"; |
1884 | 1884 | $info .= '</script>'; |
1885 | 1885 | if ($this->debug > 2) { |
1886 | - error_log('New LP - in learnpath::get_js_info(' . $item_id . ') - returning: ' . $info, 0); |
|
1886 | + error_log('New LP - in learnpath::get_js_info('.$item_id.') - returning: '.$info, 0); |
|
1887 | 1887 | } |
1888 | 1888 | return $info; |
1889 | 1889 | |
@@ -1891,17 +1891,17 @@ discard block |
||
1891 | 1891 | |
1892 | 1892 | // If item_id is empty, just update to default SCORM data. |
1893 | 1893 | $info .= '<script language="javascript">'; |
1894 | - $info .= "top.set_score(" . learnpathItem :: get_score() . ");\n"; |
|
1895 | - $info .= "top.set_max(" . learnpathItem :: get_max() . ");\n"; |
|
1896 | - $info .= "top.set_min(" . learnpathItem :: get_min() . ");\n"; |
|
1897 | - $info .= "top.set_lesson_status('" . learnpathItem :: get_status() . "');"; |
|
1898 | - $info .= "top.set_session_time('" . learnpathItem :: getScormTimeFromParameter('js') . "');"; |
|
1899 | - $info .= "top.set_suspend_data('" . learnpathItem :: get_suspend_data() . "');"; |
|
1900 | - $info .= "top.set_saved_lesson_status('" . learnpathItem :: get_status() . "');"; |
|
1894 | + $info .= "top.set_score(".learnpathItem :: get_score().");\n"; |
|
1895 | + $info .= "top.set_max(".learnpathItem :: get_max().");\n"; |
|
1896 | + $info .= "top.set_min(".learnpathItem :: get_min().");\n"; |
|
1897 | + $info .= "top.set_lesson_status('".learnpathItem :: get_status()."');"; |
|
1898 | + $info .= "top.set_session_time('".learnpathItem :: getScormTimeFromParameter('js')."');"; |
|
1899 | + $info .= "top.set_suspend_data('".learnpathItem :: get_suspend_data()."');"; |
|
1900 | + $info .= "top.set_saved_lesson_status('".learnpathItem :: get_status()."');"; |
|
1901 | 1901 | $info .= "top.set_flag_synchronized();"; |
1902 | 1902 | $info .= '</script>'; |
1903 | 1903 | if ($this->debug > 2) { |
1904 | - error_log('New LP - in learnpath::get_js_info(' . $item_id . ') - returning: ' . $info, 0); |
|
1904 | + error_log('New LP - in learnpath::get_js_info('.$item_id.') - returning: '.$info, 0); |
|
1905 | 1905 | } |
1906 | 1906 | return $info; |
1907 | 1907 | } |
@@ -1960,8 +1960,8 @@ discard block |
||
1960 | 1960 | if ($this->debug > 0) { |
1961 | 1961 | error_log('New LP - In learnpath::get_navigation_bar()', 0); |
1962 | 1962 | } |
1963 | - if(empty($idBar)){ |
|
1964 | - $idBar='control-top'; |
|
1963 | + if (empty($idBar)) { |
|
1964 | + $idBar = 'control-top'; |
|
1965 | 1965 | } |
1966 | 1966 | /* if(empty($display)){ |
1967 | 1967 | $display='display:block'; |
@@ -1974,16 +1974,16 @@ discard block |
||
1974 | 1974 | $navbar = ' |
1975 | 1975 | <span id="'.$idBar.'" class="buttons"> |
1976 | 1976 | <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"> |
1977 | - <span class="fa fa-info"></span><span class="sr-only">' . get_lang('Reporting') . '</span> |
|
1977 | + <span class="fa fa-info"></span><span class="sr-only">' . get_lang('Reporting').'</span> |
|
1978 | 1978 | </a> |
1979 | - <a class="icon-toolbar" id="scorm-previous" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'previous\');return false;" title="previous"> |
|
1980 | - <span class="fa fa-chevron-left"></span><span class="sr-only">' . get_lang('ScormPrevious') . '</span> |
|
1979 | + <a class="icon-toolbar" id="scorm-previous" href="#" onclick="switch_item(' . $mycurrentitemid.',\'previous\');return false;" title="previous"> |
|
1980 | + <span class="fa fa-chevron-left"></span><span class="sr-only">' . get_lang('ScormPrevious').'</span> |
|
1981 | 1981 | </a> |
1982 | - <a class="icon-toolbar" id="scorm-next" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'next\');return false;" title="next"> |
|
1983 | - <span class="fa fa-chevron-right"></span><span class="sr-only">' . get_lang('ScormNext') . '</span> |
|
1982 | + <a class="icon-toolbar" id="scorm-next" href="#" onclick="switch_item(' . $mycurrentitemid.',\'next\');return false;" title="next"> |
|
1983 | + <span class="fa fa-chevron-right"></span><span class="sr-only">' . get_lang('ScormNext').'</span> |
|
1984 | 1984 | </a> |
1985 | 1985 | <a class="icon-toolbar" id="view-embedded" href="lp_controller.php?action=mode&mode=embedded" target="_top" title="embedded mode"> |
1986 | - <span class="fa fa-columns"></span><span class="sr-only">' . get_lang('ScormExitFullScreen') . '</span> |
|
1986 | + <span class="fa fa-columns"></span><span class="sr-only">' . get_lang('ScormExitFullScreen').'</span> |
|
1987 | 1987 | </a> |
1988 | 1988 | </span>'; |
1989 | 1989 | |
@@ -1991,13 +1991,13 @@ discard block |
||
1991 | 1991 | $navbar = ' |
1992 | 1992 | <span id="'.$idBar.'" class="buttons text-right"> |
1993 | 1993 | <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"> |
1994 | - <span class="fa fa-info"></span><span class="sr-only">' . get_lang('Reporting') . '</span> |
|
1994 | + <span class="fa fa-info"></span><span class="sr-only">' . get_lang('Reporting').'</span> |
|
1995 | 1995 | </a> |
1996 | - <a class="icon-toolbar" id="scorm-previous" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'previous\');return false;" title="previous"> |
|
1997 | - <span class="fa fa-chevron-left"></span><span class="sr-only">' . get_lang('ScormPrevious') . '</span> |
|
1996 | + <a class="icon-toolbar" id="scorm-previous" href="#" onclick="switch_item(' . $mycurrentitemid.',\'previous\');return false;" title="previous"> |
|
1997 | + <span class="fa fa-chevron-left"></span><span class="sr-only">' . get_lang('ScormPrevious').'</span> |
|
1998 | 1998 | </a> |
1999 | - <a class="icon-toolbar" id="scorm-next" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'next\');return false;" title="next"> |
|
2000 | - <span class="fa fa-chevron-right"></span><span class="sr-only">' . get_lang('ScormNext') . '</span> |
|
1999 | + <a class="icon-toolbar" id="scorm-next" href="#" onclick="switch_item(' . $mycurrentitemid.',\'next\');return false;" title="next"> |
|
2000 | + <span class="fa fa-chevron-right"></span><span class="sr-only">' . get_lang('ScormNext').'</span> |
|
2001 | 2001 | </a> |
2002 | 2002 | </span>'; |
2003 | 2003 | } |
@@ -2018,11 +2018,11 @@ discard block |
||
2018 | 2018 | $index = $this->index; |
2019 | 2019 | $index++; |
2020 | 2020 | if ($this->debug > 2) { |
2021 | - error_log('New LP - Now looking at ordered_items[' . ($index) . '] - type is ' . $this->items[$this->ordered_items[$index]]->type, 0); |
|
2021 | + error_log('New LP - Now looking at ordered_items['.($index).'] - type is '.$this->items[$this->ordered_items[$index]]->type, 0); |
|
2022 | 2022 | } |
2023 | 2023 | 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) { |
2024 | 2024 | $index++; |
2025 | - if ($index == $this->max_ordered_items){ |
|
2025 | + if ($index == $this->max_ordered_items) { |
|
2026 | 2026 | if ($this->items[$this->ordered_items[$index]]->get_type() == 'dir' || $this->items[$this->ordered_items[$index]]->get_type() == 'dokeos_chapter') { |
2027 | 2027 | return $this->index; |
2028 | 2028 | } else { |
@@ -2034,7 +2034,7 @@ discard block |
||
2034 | 2034 | return $this->index; |
2035 | 2035 | } |
2036 | 2036 | if ($this->debug > 2) { |
2037 | - error_log('New LP - index is now ' . $index, 0); |
|
2037 | + error_log('New LP - index is now '.$index, 0); |
|
2038 | 2038 | } |
2039 | 2039 | return $index; |
2040 | 2040 | } |
@@ -2052,7 +2052,7 @@ discard block |
||
2052 | 2052 | if (!empty ($new_index)) { |
2053 | 2053 | if (isset ($this->ordered_items[$new_index])) { |
2054 | 2054 | if ($this->debug > 2) { |
2055 | - error_log('New LP - In learnpath::get_next_index() - Returning ' . $this->ordered_items[$new_index], 0); |
|
2055 | + error_log('New LP - In learnpath::get_next_index() - Returning '.$this->ordered_items[$new_index], 0); |
|
2056 | 2056 | } |
2057 | 2057 | return $this->ordered_items[$new_index]; |
2058 | 2058 | } |
@@ -2094,7 +2094,7 @@ discard block |
||
2094 | 2094 | } |
2095 | 2095 | |
2096 | 2096 | // Filename without its extension. |
2097 | - $file_base_name = str_replace('.' . $extension, '', $filename); |
|
2097 | + $file_base_name = str_replace('.'.$extension, '', $filename); |
|
2098 | 2098 | |
2099 | 2099 | $zipFile = new PclZip($file_path); |
2100 | 2100 | // Check the zip content (real size and file extension). |
@@ -2118,7 +2118,7 @@ discard block |
||
2118 | 2118 | break; // Exit the foreach loop. |
2119 | 2119 | } elseif ( |
2120 | 2120 | preg_match('/aicc\//i', $thisContent['filename']) || |
2121 | - in_array(strtolower(pathinfo($thisContent['filename'], PATHINFO_EXTENSION)), array( 'crs','au','des','cst')) |
|
2121 | + in_array(strtolower(pathinfo($thisContent['filename'], PATHINFO_EXTENSION)), array('crs', 'au', 'des', 'cst')) |
|
2122 | 2122 | ) { |
2123 | 2123 | $ext = strtolower(pathinfo($thisContent['filename'], PATHINFO_EXTENSION)); |
2124 | 2124 | switch ($ext) { |
@@ -2160,7 +2160,7 @@ discard block |
||
2160 | 2160 | error_log('New LP - In learnpath::get_previous_index()', 0); |
2161 | 2161 | } |
2162 | 2162 | $index = $this->index; |
2163 | - if (isset ($this->ordered_items[$index -1])) { |
|
2163 | + if (isset ($this->ordered_items[$index - 1])) { |
|
2164 | 2164 | $index--; |
2165 | 2165 | 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')) { |
2166 | 2166 | $index--; |
@@ -2170,7 +2170,7 @@ discard block |
||
2170 | 2170 | } |
2171 | 2171 | } else { |
2172 | 2172 | if ($this->debug > 2) { |
2173 | - error_log('New LP - get_previous_index() - there was no previous index available, reusing ' . $index, 0); |
|
2173 | + error_log('New LP - get_previous_index() - there was no previous index available, reusing '.$index, 0); |
|
2174 | 2174 | } |
2175 | 2175 | // There is no previous item. |
2176 | 2176 | } |
@@ -2243,7 +2243,7 @@ discard block |
||
2243 | 2243 | lp.c_id = $course_id AND |
2244 | 2244 | lp_view.c_id = $course_id"; |
2245 | 2245 | $result = Database::query($sql); |
2246 | - $row = Database::fetch_assoc($result); |
|
2246 | + $row = Database::fetch_assoc($result); |
|
2247 | 2247 | $output = ''; |
2248 | 2248 | |
2249 | 2249 | if (!empty ($row['audio'])) { |
@@ -2251,7 +2251,7 @@ discard block |
||
2251 | 2251 | $list = $learnPath->get_toc(); |
2252 | 2252 | $type_quiz = false; |
2253 | 2253 | |
2254 | - foreach($list as $toc) { |
|
2254 | + foreach ($list as $toc) { |
|
2255 | 2255 | if ($toc['id'] == $learnPath->current && ($toc['type'] == 'quiz')) { |
2256 | 2256 | $type_quiz = true; |
2257 | 2257 | } |
@@ -2316,7 +2316,7 @@ discard block |
||
2316 | 2316 | $courseCode = null, |
2317 | 2317 | $sessionId = null |
2318 | 2318 | ) { |
2319 | - $lp_id = (int)$lp_id; |
|
2319 | + $lp_id = (int) $lp_id; |
|
2320 | 2320 | $courseInfo = api_get_course_info($courseCode); |
2321 | 2321 | $sessionId = intval($sessionId); |
2322 | 2322 | |
@@ -2482,10 +2482,10 @@ discard block |
||
2482 | 2482 | */ |
2483 | 2483 | public static function get_progress_bar($percentage = -1, $text_add = '') |
2484 | 2484 | { |
2485 | - $text = $percentage . $text_add; |
|
2485 | + $text = $percentage.$text_add; |
|
2486 | 2486 | $output = '<div class="progress"> |
2487 | - <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.';"> |
|
2488 | - '. $text .' |
|
2487 | + <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.';"> |
|
2488 | + '. $text.' |
|
2489 | 2489 | </div> |
2490 | 2490 | </div>'; |
2491 | 2491 | |
@@ -2521,16 +2521,16 @@ discard block |
||
2521 | 2521 | } |
2522 | 2522 | $total_items = $this->get_total_items_count_without_chapters(); |
2523 | 2523 | if ($this->debug > 2) { |
2524 | - error_log('New LP - Total items available in this learnpath: ' . $total_items, 0); |
|
2524 | + error_log('New LP - Total items available in this learnpath: '.$total_items, 0); |
|
2525 | 2525 | } |
2526 | 2526 | $completeItems = $this->get_complete_items_count(); |
2527 | 2527 | if ($this->debug > 2) { |
2528 | - error_log('New LP - Items completed so far: ' . $completeItems, 0); |
|
2528 | + error_log('New LP - Items completed so far: '.$completeItems, 0); |
|
2529 | 2529 | } |
2530 | 2530 | if ($add != 0) { |
2531 | 2531 | $completeItems += $add; |
2532 | 2532 | if ($this->debug > 2) { |
2533 | - error_log('New LP - Items completed so far (+modifier): ' . $completeItems, 0); |
|
2533 | + error_log('New LP - Items completed so far (+modifier): '.$completeItems, 0); |
|
2534 | 2534 | } |
2535 | 2535 | } |
2536 | 2536 | $text = ''; |
@@ -2548,7 +2548,7 @@ discard block |
||
2548 | 2548 | $text = '%'; |
2549 | 2549 | } elseif ($mode == 'abs') { |
2550 | 2550 | $percentage = $completeItems; |
2551 | - $text = '/' . $total_items; |
|
2551 | + $text = '/'.$total_items; |
|
2552 | 2552 | } |
2553 | 2553 | |
2554 | 2554 | return array( |
@@ -2744,7 +2744,7 @@ discard block |
||
2744 | 2744 | // and replace them, one by one, by the internal IDs (chamilo db) |
2745 | 2745 | // TODO: Modify the '*' replacement to replace the multiplier in front of it |
2746 | 2746 | // by a space as well. |
2747 | - $find = array ( |
|
2747 | + $find = array( |
|
2748 | 2748 | '&', |
2749 | 2749 | '|', |
2750 | 2750 | '~', |
@@ -2756,7 +2756,7 @@ discard block |
||
2756 | 2756 | '(', |
2757 | 2757 | ')' |
2758 | 2758 | ); |
2759 | - $replace = array ( |
|
2759 | + $replace = array( |
|
2760 | 2760 | ' ', |
2761 | 2761 | ' ', |
2762 | 2762 | ' ', |
@@ -2773,7 +2773,7 @@ discard block |
||
2773 | 2773 | foreach ($ids as $id) { |
2774 | 2774 | $id = trim($id); |
2775 | 2775 | if (isset ($this->refs_list[$id])) { |
2776 | - $prereq = preg_replace('/[^a-zA-Z_0-9](' . $id . ')[^a-zA-Z_0-9]/', 'ITEM_' . $this->refs_list[$id], $prereq); |
|
2776 | + $prereq = preg_replace('/[^a-zA-Z_0-9]('.$id.')[^a-zA-Z_0-9]/', 'ITEM_'.$this->refs_list[$id], $prereq); |
|
2777 | 2777 | } |
2778 | 2778 | } |
2779 | 2779 | |
@@ -2881,9 +2881,9 @@ discard block |
||
2881 | 2881 | if ($this->debug > 0) { |
2882 | 2882 | error_log('New LP - In learnpath::get_items_status_list()', 0); |
2883 | 2883 | } |
2884 | - $list = array (); |
|
2884 | + $list = array(); |
|
2885 | 2885 | foreach ($this->ordered_items as $item_id) { |
2886 | - $list[] = array ( |
|
2886 | + $list[] = array( |
|
2887 | 2887 | $item_id => $this->items[$item_id]->get_status() |
2888 | 2888 | ); |
2889 | 2889 | } |
@@ -2937,7 +2937,7 @@ discard block |
||
2937 | 2937 | $res = Database::query($sql); |
2938 | 2938 | $num = Database :: num_rows($res); |
2939 | 2939 | if ($num > 0) { |
2940 | - $list[] = array ( |
|
2940 | + $list[] = array( |
|
2941 | 2941 | 'order_id' => api_htmlentities(get_lang('Order'), ENT_QUOTES), |
2942 | 2942 | 'id' => api_htmlentities(get_lang('InteractionID'), ENT_QUOTES), |
2943 | 2943 | 'type' => api_htmlentities(get_lang('Type'), ENT_QUOTES), |
@@ -2948,7 +2948,7 @@ discard block |
||
2948 | 2948 | 'latency' => api_htmlentities(get_lang('LatencyTimeSpent'), ENT_QUOTES) |
2949 | 2949 | ); |
2950 | 2950 | while ($row = Database :: fetch_array($res)) { |
2951 | - $list[] = array ( |
|
2951 | + $list[] = array( |
|
2952 | 2952 | 'order_id' => ($row['order_id'] + 1), |
2953 | 2953 | 'id' => urldecode($row['interaction_id']), //urldecode because they often have %2F or stuff like that |
2954 | 2954 | 'type' => $row['interaction_type'], |
@@ -3016,7 +3016,7 @@ discard block |
||
3016 | 3016 | 'status' => api_htmlentities(get_lang('ObjectiveStatus'), ENT_QUOTES) |
3017 | 3017 | ); |
3018 | 3018 | while ($row = Database :: fetch_array($res)) { |
3019 | - $list[] = array ( |
|
3019 | + $list[] = array( |
|
3020 | 3020 | 'order_id' => ($row['order_id'] + 1), |
3021 | 3021 | 'objective_id' => urldecode($row['objective_id']), // urldecode() because they often have %2F or stuff like that. |
3022 | 3022 | 'score_raw' => $row['score_raw'], |
@@ -3043,10 +3043,10 @@ discard block |
||
3043 | 3043 | $toc = array(); |
3044 | 3044 | foreach ($this->ordered_items as $item_id) { |
3045 | 3045 | if ($this->debug > 2) { |
3046 | - error_log('learnpath::get_toc(): getting info for item ' . $item_id, 0); |
|
3046 | + error_log('learnpath::get_toc(): getting info for item '.$item_id, 0); |
|
3047 | 3047 | } |
3048 | 3048 | // TODO: Change this link generation and use new function instead. |
3049 | - $toc[] = array ( |
|
3049 | + $toc[] = array( |
|
3050 | 3050 | 'id' => $item_id, |
3051 | 3051 | 'title' => $this->items[$item_id]->get_title(), |
3052 | 3052 | 'status' => $this->items[$item_id]->get_status(), |
@@ -3057,7 +3057,7 @@ discard block |
||
3057 | 3057 | ); |
3058 | 3058 | } |
3059 | 3059 | if ($this->debug > 2) { |
3060 | - error_log('New LP - In learnpath::get_toc() - TOC array: ' . print_r($toc, true), 0); |
|
3060 | + error_log('New LP - In learnpath::get_toc() - TOC array: '.print_r($toc, true), 0); |
|
3061 | 3061 | } |
3062 | 3062 | return $toc; |
3063 | 3063 | } |
@@ -3074,10 +3074,10 @@ discard block |
||
3074 | 3074 | } |
3075 | 3075 | $toc = $varname.' = new Array();'; |
3076 | 3076 | foreach ($this->ordered_items as $item_id) { |
3077 | - $toc.= $varname."['i$item_id'] = '".$this->items[$item_id]->get_type()."';"; |
|
3077 | + $toc .= $varname."['i$item_id'] = '".$this->items[$item_id]->get_type()."';"; |
|
3078 | 3078 | } |
3079 | 3079 | if ($this->debug > 2) { |
3080 | - error_log('New LP - In learnpath::get_items_details_as_js() - TOC array: ' . print_r($toc, true), 0); |
|
3080 | + error_log('New LP - In learnpath::get_items_details_as_js() - TOC array: '.print_r($toc, true), 0); |
|
3081 | 3081 | } |
3082 | 3082 | return $toc; |
3083 | 3083 | } |
@@ -3101,7 +3101,7 @@ discard block |
||
3101 | 3101 | } |
3102 | 3102 | } |
3103 | 3103 | if ($this->debug > 2) { |
3104 | - error_log('New LP - In learnpath::get_type() - Returning ' . ($res ? $res : 'false'), 0); |
|
3104 | + error_log('New LP - In learnpath::get_type() - Returning '.($res ? $res : 'false'), 0); |
|
3105 | 3105 | } |
3106 | 3106 | return $res; |
3107 | 3107 | } |
@@ -3117,7 +3117,7 @@ discard block |
||
3117 | 3117 | $tbl_lp = Database :: get_course_table(TABLE_LP_MAIN); |
3118 | 3118 | $lp_id = intval($lp_id); |
3119 | 3119 | $sql = "SELECT lp_type FROM $tbl_lp |
3120 | - WHERE c_id = $course_id AND id = '" . $lp_id . "'"; |
|
3120 | + WHERE c_id = $course_id AND id = '".$lp_id."'"; |
|
3121 | 3121 | $res = Database::query($sql); |
3122 | 3122 | if ($res === false) { |
3123 | 3123 | return null; |
@@ -3229,7 +3229,7 @@ discard block |
||
3229 | 3229 | $dirTypes = self::getChapterTypes(); |
3230 | 3230 | |
3231 | 3231 | if (in_array($item['type'], $dirTypes)) { |
3232 | - $scorm_color_background ='scorm_item_section '; |
|
3232 | + $scorm_color_background = 'scorm_item_section '; |
|
3233 | 3233 | $style_item = ''; |
3234 | 3234 | } |
3235 | 3235 | if ($item['id'] == $this->current) { |
@@ -3238,7 +3238,7 @@ discard block |
||
3238 | 3238 | $scorm_color_background = 'scorm_item_normal '.$scorm_color_background.' '; |
3239 | 3239 | } |
3240 | 3240 | |
3241 | - $html .= '<div id="toc_' . $item['id'] . '" class="' . $scorm_color_background . ' '.$class_name[$item['status']].' ">'; |
|
3241 | + $html .= '<div id="toc_'.$item['id'].'" class="'.$scorm_color_background.' '.$class_name[$item['status']].' ">'; |
|
3242 | 3242 | |
3243 | 3243 | // Learning path title |
3244 | 3244 | $title = $item['title']; |
@@ -3268,7 +3268,7 @@ discard block |
||
3268 | 3268 | $html .= stripslashes($title); |
3269 | 3269 | } else { |
3270 | 3270 | $this->get_link('http', $item['id'], $toc_list); |
3271 | - $html .= '<a class="items-list" href="#" onclick="switch_item(' .$mycurrentitemid . ',' .$item['id'] . ');' .'return false;" >' . stripslashes($title) . '</a>'; |
|
3271 | + $html .= '<a class="items-list" href="#" onclick="switch_item('.$mycurrentitemid.','.$item['id'].');'.'return false;" >'.stripslashes($title).'</a>'; |
|
3272 | 3272 | } |
3273 | 3273 | $html .= "</div>"; |
3274 | 3274 | |
@@ -3298,12 +3298,12 @@ discard block |
||
3298 | 3298 | if ($this->get_lp_session_id() == api_get_session_id()) { |
3299 | 3299 | $html .= '<div id="actions_lp" class="actions_lp"><hr>'; |
3300 | 3300 | $html .= '<div class="btn-group">'; |
3301 | - $html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?" . api_get_cidreq()."&action=build&lp_id=" . $this->lp_id . "' target='_parent'>" . |
|
3302 | - Display::returnFontAwesomeIcon('street-view') . get_lang('Overview') . "</a>"; |
|
3303 | - $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 . "' target='_parent'>" . |
|
3304 | - Display::returnFontAwesomeIcon('pencil') . get_lang('Edit') . "</a>"; |
|
3305 | - $html .= '<a class="btn btn-sm btn-default" href="lp_controller.php?'.api_get_cidreq()."&action=edit&lp_id=" . $this->lp_id.'">' . |
|
3306 | - Display::returnFontAwesomeIcon('cog') . get_lang('Settings').'</a>'; |
|
3301 | + $html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?".api_get_cidreq()."&action=build&lp_id=".$this->lp_id."' target='_parent'>". |
|
3302 | + Display::returnFontAwesomeIcon('street-view').get_lang('Overview')."</a>"; |
|
3303 | + $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."' target='_parent'>". |
|
3304 | + Display::returnFontAwesomeIcon('pencil').get_lang('Edit')."</a>"; |
|
3305 | + $html .= '<a class="btn btn-sm btn-default" href="lp_controller.php?'.api_get_cidreq()."&action=edit&lp_id=".$this->lp_id.'">'. |
|
3306 | + Display::returnFontAwesomeIcon('cog').get_lang('Settings').'</a>'; |
|
3307 | 3307 | $html .= '</div>'; |
3308 | 3308 | $html .= '</div>'; |
3309 | 3309 | } |
@@ -3355,11 +3355,11 @@ discard block |
||
3355 | 3355 | $course_id = $this->get_course_int_id(); |
3356 | 3356 | |
3357 | 3357 | if ($this->debug > 0) { |
3358 | - error_log('New LP - In learnpath::get_link(' . $type . ',' . $item_id . ')', 0); |
|
3358 | + error_log('New LP - In learnpath::get_link('.$type.','.$item_id.')', 0); |
|
3359 | 3359 | } |
3360 | 3360 | if (empty($item_id)) { |
3361 | 3361 | if ($this->debug > 2) { |
3362 | - error_log('New LP - In learnpath::get_link() - no item id given in learnpath::get_link(), using current: ' . $this->get_current_item_id(), 0); |
|
3362 | + error_log('New LP - In learnpath::get_link() - no item id given in learnpath::get_link(), using current: '.$this->get_current_item_id(), 0); |
|
3363 | 3363 | } |
3364 | 3364 | $item_id = $this->get_current_item_id(); |
3365 | 3365 | } |
@@ -3391,7 +3391,7 @@ discard block |
||
3391 | 3391 | ON (li.lp_id = l.id AND l.c_id = $course_id AND li.c_id = $course_id ) |
3392 | 3392 | WHERE li.id = $item_id "; |
3393 | 3393 | if ($this->debug > 2) { |
3394 | - error_log('New LP - In learnpath::get_link() - selecting item ' . $sql, 0); |
|
3394 | + error_log('New LP - In learnpath::get_link() - selecting item '.$sql, 0); |
|
3395 | 3395 | } |
3396 | 3396 | $res = Database::query($sql); |
3397 | 3397 | if (Database :: num_rows($res) > 0) { |
@@ -3405,9 +3405,9 @@ discard block |
||
3405 | 3405 | if (empty($lp_item_params) && strpos($lp_item_path, '?') !== false) { |
3406 | 3406 | list($lp_item_path, $lp_item_params) = explode('?', $lp_item_path); |
3407 | 3407 | } |
3408 | - $sys_course_path = api_get_path(SYS_COURSE_PATH) . api_get_course_path(); |
|
3408 | + $sys_course_path = api_get_path(SYS_COURSE_PATH).api_get_course_path(); |
|
3409 | 3409 | if ($type == 'http') { |
3410 | - $course_path = api_get_path(WEB_COURSE_PATH) . api_get_course_path(); //web path |
|
3410 | + $course_path = api_get_path(WEB_COURSE_PATH).api_get_course_path(); //web path |
|
3411 | 3411 | } else { |
3412 | 3412 | $course_path = $sys_course_path; //system path |
3413 | 3413 | } |
@@ -3418,8 +3418,8 @@ discard block |
||
3418 | 3418 | } |
3419 | 3419 | |
3420 | 3420 | if ($this->debug > 2) { |
3421 | - error_log('New LP - In learnpath::get_link() - $lp_type ' . $lp_type, 0); |
|
3422 | - error_log('New LP - In learnpath::get_link() - $lp_item_type ' . $lp_item_type, 0); |
|
3421 | + error_log('New LP - In learnpath::get_link() - $lp_type '.$lp_type, 0); |
|
3422 | + error_log('New LP - In learnpath::get_link() - $lp_item_type '.$lp_item_type, 0); |
|
3423 | 3423 | } |
3424 | 3424 | |
3425 | 3425 | // Now go through the specific cases to get the end of the path |
@@ -3434,7 +3434,7 @@ discard block |
||
3434 | 3434 | ); |
3435 | 3435 | |
3436 | 3436 | if ($this->debug > 0) { |
3437 | - error_log('rl_get_resource_link_for_learnpath - file: ' . $file, 0); |
|
3437 | + error_log('rl_get_resource_link_for_learnpath - file: '.$file, 0); |
|
3438 | 3438 | } |
3439 | 3439 | |
3440 | 3440 | switch ($lp_item_type) { |
@@ -3506,7 +3506,7 @@ discard block |
||
3506 | 3506 | status='completed'"; |
3507 | 3507 | $result = Database::query($sql); |
3508 | 3508 | $row_count = Database:: fetch_row($result); |
3509 | - $count_item_view = (int)$row_count[0]; |
|
3509 | + $count_item_view = (int) $row_count[0]; |
|
3510 | 3510 | $not_multiple_attempt = 0; |
3511 | 3511 | if ($prevent_reinit === 1 && $count_item_view > 0) { |
3512 | 3512 | $not_multiple_attempt = 1; |
@@ -3525,7 +3525,7 @@ discard block |
||
3525 | 3525 | break; |
3526 | 3526 | case 2 : |
3527 | 3527 | if ($this->debug > 2) { |
3528 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - Item type: ' . $lp_item_type, 0); |
|
3528 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - Item type: '.$lp_item_type, 0); |
|
3529 | 3529 | } |
3530 | 3530 | |
3531 | 3531 | if ($lp_item_type != 'dir') { |
@@ -3539,19 +3539,19 @@ discard block |
||
3539 | 3539 | //if ($this->prerequisites_match($item_id)) { |
3540 | 3540 | if (preg_match('#^[a-zA-Z]{2,5}://#', $lp_item_path) != 0) { |
3541 | 3541 | if ($this->debug > 2) { |
3542 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - Found match for protocol in ' . $lp_item_path, 0); |
|
3542 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - Found match for protocol in '.$lp_item_path, 0); |
|
3543 | 3543 | } |
3544 | 3544 | // Distant url, return as is. |
3545 | 3545 | $file = $lp_item_path; |
3546 | 3546 | } else { |
3547 | 3547 | if ($this->debug > 2) { |
3548 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - No starting protocol in ' . $lp_item_path, 0); |
|
3548 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - No starting protocol in '.$lp_item_path, 0); |
|
3549 | 3549 | } |
3550 | 3550 | // Prevent getting untranslatable urls. |
3551 | 3551 | $lp_item_path = preg_replace('/%2F/', '/', $lp_item_path); |
3552 | 3552 | $lp_item_path = preg_replace('/%3A/', ':', $lp_item_path); |
3553 | 3553 | // Prepare the path. |
3554 | - $file = $course_path . '/scorm/' . $lp_path . '/' . $lp_item_path; |
|
3554 | + $file = $course_path.'/scorm/'.$lp_path.'/'.$lp_item_path; |
|
3555 | 3555 | // TODO: Fix this for urls with protocol header. |
3556 | 3556 | $file = str_replace('//', '/', $file); |
3557 | 3557 | $file = str_replace(':/', '://', $file); |
@@ -3559,11 +3559,11 @@ discard block |
||
3559 | 3559 | $lp_path = substr($lp_path, 0, -1); |
3560 | 3560 | } |
3561 | 3561 | |
3562 | - if (!is_file(realpath($sys_course_path . '/scorm/' . $lp_path . '/' . $lp_item_path))) { |
|
3562 | + if (!is_file(realpath($sys_course_path.'/scorm/'.$lp_path.'/'.$lp_item_path))) { |
|
3563 | 3563 | // if file not found. |
3564 | 3564 | $decoded = html_entity_decode($lp_item_path); |
3565 | 3565 | list ($decoded) = explode('?', $decoded); |
3566 | - if (!is_file(realpath($sys_course_path . '/scorm/' . $lp_path . '/' . $decoded))) { |
|
3566 | + if (!is_file(realpath($sys_course_path.'/scorm/'.$lp_path.'/'.$decoded))) { |
|
3567 | 3567 | $file = self::rl_get_resource_link_for_learnpath( |
3568 | 3568 | $course_id, |
3569 | 3569 | $this->get_id(), |
@@ -3582,14 +3582,14 @@ discard block |
||
3582 | 3582 | } |
3583 | 3583 | } |
3584 | 3584 | } else { |
3585 | - $file = $course_path . '/scorm/' . $lp_path . '/' . $decoded; |
|
3585 | + $file = $course_path.'/scorm/'.$lp_path.'/'.$decoded; |
|
3586 | 3586 | } |
3587 | 3587 | } |
3588 | 3588 | } |
3589 | 3589 | |
3590 | 3590 | // We want to use parameters if they were defined in the imsmanifest |
3591 | 3591 | if (strpos($file, 'blank.php') === false) { |
3592 | - $file .= (strstr($file, '?') === false ? '?' : '') . $lp_item_params; |
|
3592 | + $file .= (strstr($file, '?') === false ? '?' : '').$lp_item_params; |
|
3593 | 3593 | } |
3594 | 3594 | } else { |
3595 | 3595 | $file = 'lp_content.php?type=dir'; |
@@ -3597,12 +3597,12 @@ discard block |
||
3597 | 3597 | break; |
3598 | 3598 | case 3 : |
3599 | 3599 | if ($this->debug > 2) { |
3600 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - Item type: ' . $lp_item_type, 0); |
|
3600 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - Item type: '.$lp_item_type, 0); |
|
3601 | 3601 | } |
3602 | 3602 | // Formatting AICC HACP append URL. |
3603 | - $aicc_append = '?aicc_sid=' . urlencode(session_id()) . '&aicc_url=' . urlencode(api_get_path(WEB_CODE_PATH) . 'newscorm/aicc_hacp.php') . '&'; |
|
3603 | + $aicc_append = '?aicc_sid='.urlencode(session_id()).'&aicc_url='.urlencode(api_get_path(WEB_CODE_PATH).'newscorm/aicc_hacp.php').'&'; |
|
3604 | 3604 | if (!empty($lp_item_params)) { |
3605 | - $aicc_append .= $lp_item_params . '&'; |
|
3605 | + $aicc_append .= $lp_item_params.'&'; |
|
3606 | 3606 | } |
3607 | 3607 | if ($lp_item_type != 'dir') { |
3608 | 3608 | // Quite complex here: |
@@ -3614,7 +3614,7 @@ discard block |
||
3614 | 3614 | |
3615 | 3615 | if (preg_match('#^[a-zA-Z]{2,5}://#', $lp_item_path) != 0) { |
3616 | 3616 | if ($this->debug > 2) { |
3617 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - Found match for protocol in ' . $lp_item_path, 0); |
|
3617 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - Found match for protocol in '.$lp_item_path, 0); |
|
3618 | 3618 | } |
3619 | 3619 | // Distant url, return as is. |
3620 | 3620 | $file = $lp_item_path; |
@@ -3627,19 +3627,19 @@ discard block |
||
3627 | 3627 | if (stripos($file, '<servername>') !== false) { |
3628 | 3628 | //$file = str_replace('<servername>',$course_path.'/scorm/'.$lp_path.'/',$lp_item_path); |
3629 | 3629 | $web_course_path = str_replace('https://', '', str_replace('http://', '', $course_path)); |
3630 | - $file = str_replace('<servername>', $web_course_path . '/scorm/' . $lp_path, $lp_item_path); |
|
3630 | + $file = str_replace('<servername>', $web_course_path.'/scorm/'.$lp_path, $lp_item_path); |
|
3631 | 3631 | } |
3632 | 3632 | // |
3633 | 3633 | $file .= $aicc_append; |
3634 | 3634 | } else { |
3635 | 3635 | if ($this->debug > 2) { |
3636 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - No starting protocol in ' . $lp_item_path, 0); |
|
3636 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - No starting protocol in '.$lp_item_path, 0); |
|
3637 | 3637 | } |
3638 | 3638 | // Prevent getting untranslatable urls. |
3639 | 3639 | $lp_item_path = preg_replace('/%2F/', '/', $lp_item_path); |
3640 | 3640 | $lp_item_path = preg_replace('/%3A/', ':', $lp_item_path); |
3641 | 3641 | // Prepare the path - lp_path might be unusable because it includes the "aicc" subdir name. |
3642 | - $file = $course_path . '/scorm/' . $lp_path . '/' . $lp_item_path; |
|
3642 | + $file = $course_path.'/scorm/'.$lp_path.'/'.$lp_item_path; |
|
3643 | 3643 | // TODO: Fix this for urls with protocol header. |
3644 | 3644 | $file = str_replace('//', '/', $file); |
3645 | 3645 | $file = str_replace(':/', '://', $file); |
@@ -3658,7 +3658,7 @@ discard block |
||
3658 | 3658 | $file = !empty($file) ? str_replace('&', '&', $file) : ''; |
3659 | 3659 | } |
3660 | 3660 | if ($this->debug > 2) { |
3661 | - error_log('New LP - In learnpath::get_link() - returning "' . $file . '" from get_link', 0); |
|
3661 | + error_log('New LP - In learnpath::get_link() - returning "'.$file.'" from get_link', 0); |
|
3662 | 3662 | } |
3663 | 3663 | return $file; |
3664 | 3664 | } |
@@ -3676,7 +3676,7 @@ discard block |
||
3676 | 3676 | $search = ''; |
3677 | 3677 | // Use $attempt_num to enable multi-views management (disabled so far). |
3678 | 3678 | if ($attempt_num != 0 AND intval(strval($attempt_num)) == $attempt_num) { |
3679 | - $search = 'AND view_count = ' . $attempt_num; |
|
3679 | + $search = 'AND view_count = '.$attempt_num; |
|
3680 | 3680 | } |
3681 | 3681 | // When missing $attempt_num, search for a unique lp_view record for this lp and user. |
3682 | 3682 | $lp_view_table = Database :: get_course_table(TABLE_LP_VIEW); |
@@ -3686,9 +3686,9 @@ discard block |
||
3686 | 3686 | |
3687 | 3687 | $sql = "SELECT id, view_count FROM $lp_view_table |
3688 | 3688 | WHERE |
3689 | - c_id = " . $course_id . " AND |
|
3690 | - lp_id = " . $this->get_id() . " AND |
|
3691 | - user_id = " . $this->get_user_id() . " AND |
|
3689 | + c_id = ".$course_id." AND |
|
3690 | + lp_id = " . $this->get_id()." AND |
|
3691 | + user_id = " . $this->get_user_id()." AND |
|
3692 | 3692 | session_id = $sessionId |
3693 | 3693 | $search |
3694 | 3694 | ORDER BY view_count DESC"; |
@@ -3699,7 +3699,7 @@ discard block |
||
3699 | 3699 | } else if (!api_is_invitee()) { |
3700 | 3700 | // There is no database record, create one. |
3701 | 3701 | $sql = "INSERT INTO $lp_view_table (c_id, lp_id,user_id, view_count, session_id) VALUES |
3702 | - ($course_id, " . $this->get_id() . "," . $this->get_user_id() . ", 1, $sessionId)"; |
|
3702 | + ($course_id, ".$this->get_id().",".$this->get_user_id().", 1, $sessionId)"; |
|
3703 | 3703 | Database::query($sql); |
3704 | 3704 | $id = Database :: insert_id(); |
3705 | 3705 | $this->lp_view_id = $id; |
@@ -3799,15 +3799,15 @@ discard block |
||
3799 | 3799 | { |
3800 | 3800 | $course_id = api_get_course_int_id(); |
3801 | 3801 | if ($this->debug > 0) { |
3802 | - error_log('New LP - In learnpath::move_item(' . $id . ',' . $direction . ')', 0); |
|
3802 | + error_log('New LP - In learnpath::move_item('.$id.','.$direction.')', 0); |
|
3803 | 3803 | } |
3804 | 3804 | if (empty($id) || empty($direction)) { |
3805 | 3805 | return false; |
3806 | 3806 | } |
3807 | 3807 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
3808 | 3808 | $sql_sel = "SELECT * |
3809 | - FROM " . $tbl_lp_item . " |
|
3810 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
3809 | + FROM " . $tbl_lp_item." |
|
3810 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
3811 | 3811 | $res_sel = Database::query($sql_sel); |
3812 | 3812 | // Check if elem exists. |
3813 | 3813 | if (Database :: num_rows($res_sel) < 1) { |
@@ -3832,7 +3832,7 @@ discard block |
||
3832 | 3832 | WHERE c_id = ".$course_id." AND id = $previous"; |
3833 | 3833 | |
3834 | 3834 | if ($this->debug > 2) { |
3835 | - error_log('Selecting previous: ' . $sql_sel2, 0); |
|
3835 | + error_log('Selecting previous: '.$sql_sel2, 0); |
|
3836 | 3836 | } |
3837 | 3837 | $res_sel2 = Database::query($sql_sel2); |
3838 | 3838 | if (Database :: num_rows($res_sel2) < 1) { |
@@ -3885,7 +3885,7 @@ discard block |
||
3885 | 3885 | } |
3886 | 3886 | Database::query($sql_upd2); |
3887 | 3887 | } |
3888 | - $display = $display -1; |
|
3888 | + $display = $display - 1; |
|
3889 | 3889 | } |
3890 | 3890 | break; |
3891 | 3891 | case 'down': |
@@ -3896,7 +3896,7 @@ discard block |
||
3896 | 3896 | } else { |
3897 | 3897 | $sql_sel2 = "SELECT * FROM $tbl_lp_item WHERE c_id = ".$course_id." AND id = $next"; |
3898 | 3898 | if ($this->debug > 2) { |
3899 | - error_log('Selecting next: ' . $sql_sel2, 0); |
|
3899 | + error_log('Selecting next: '.$sql_sel2, 0); |
|
3900 | 3900 | } |
3901 | 3901 | $res_sel2 = Database::query($sql_sel2); |
3902 | 3902 | if (Database :: num_rows($res_sel2) < 1) { |
@@ -3934,7 +3934,7 @@ discard block |
||
3934 | 3934 | WHERE c_id = ".$course_id." AND id = $next_next"; |
3935 | 3935 | Database::query($sql_upd2); |
3936 | 3936 | } |
3937 | - $display = $display +1; |
|
3937 | + $display = $display + 1; |
|
3938 | 3938 | } |
3939 | 3939 | break; |
3940 | 3940 | default : |
@@ -3957,8 +3957,8 @@ discard block |
||
3957 | 3957 | $res = Database::query($sql); |
3958 | 3958 | if ($res === false) |
3959 | 3959 | return false; |
3960 | - $lps = array (); |
|
3961 | - $lp_order = array (); |
|
3960 | + $lps = array(); |
|
3961 | + $lp_order = array(); |
|
3962 | 3962 | $num = Database :: num_rows($res); |
3963 | 3963 | // First check the order is correct, globally (might be wrong because |
3964 | 3964 | // of versions < 1.8.4) |
@@ -3968,7 +3968,7 @@ discard block |
||
3968 | 3968 | if ($row['display_order'] != $i) { // If we find a gap in the order, we need to fix it. |
3969 | 3969 | $need_fix = true; |
3970 | 3970 | $sql_u = "UPDATE $lp_table SET display_order = $i |
3971 | - WHERE c_id = ".$course_id." AND id = " . $row['id']; |
|
3971 | + WHERE c_id = ".$course_id." AND id = ".$row['id']; |
|
3972 | 3972 | Database::query($sql_u); |
3973 | 3973 | } |
3974 | 3974 | $row['display_order'] = $i; |
@@ -3981,10 +3981,10 @@ discard block |
||
3981 | 3981 | $order = $lps[$lp_id]['display_order']; |
3982 | 3982 | if ($order > 1) { // If it's the first element, no need to move up. |
3983 | 3983 | $sql_u1 = "UPDATE $lp_table SET display_order = $order |
3984 | - WHERE c_id = ".$course_id." AND id = " . $lp_order[$order - 1]; |
|
3984 | + WHERE c_id = ".$course_id." AND id = ".$lp_order[$order - 1]; |
|
3985 | 3985 | Database::query($sql_u1); |
3986 | - $sql_u2 = "UPDATE $lp_table SET display_order = " . ($order - 1) . " |
|
3987 | - WHERE c_id = ".$course_id." AND id = " . $lp_id; |
|
3986 | + $sql_u2 = "UPDATE $lp_table SET display_order = ".($order - 1)." |
|
3987 | + WHERE c_id = ".$course_id." AND id = ".$lp_id; |
|
3988 | 3988 | Database::query($sql_u2); |
3989 | 3989 | } |
3990 | 3990 | } |
@@ -4005,8 +4005,8 @@ discard block |
||
4005 | 4005 | if ($res === false) { |
4006 | 4006 | return false; |
4007 | 4007 | } |
4008 | - $lps = array (); |
|
4009 | - $lp_order = array (); |
|
4008 | + $lps = array(); |
|
4009 | + $lp_order = array(); |
|
4010 | 4010 | $num = Database :: num_rows($res); |
4011 | 4011 | $max = 0; |
4012 | 4012 | // First check the order is correct, globally (might be wrong because |
@@ -4018,7 +4018,7 @@ discard block |
||
4018 | 4018 | if ($row['display_order'] != $i) { // If we find a gap in the order, we need to fix it. |
4019 | 4019 | $need_fix = true; |
4020 | 4020 | $sql_u = "UPDATE $lp_table SET display_order = $i |
4021 | - WHERE c_id = ".$course_id." AND id = " . $row['id']; |
|
4021 | + WHERE c_id = ".$course_id." AND id = ".$row['id']; |
|
4022 | 4022 | Database::query($sql_u); |
4023 | 4023 | } |
4024 | 4024 | $row['display_order'] = $i; |
@@ -4031,10 +4031,10 @@ discard block |
||
4031 | 4031 | $order = $lps[$lp_id]['display_order']; |
4032 | 4032 | if ($order < $max) { // If it's the first element, no need to move up. |
4033 | 4033 | $sql_u1 = "UPDATE $lp_table SET display_order = $order |
4034 | - WHERE c_id = ".$course_id." AND id = " . $lp_order[$order + 1]; |
|
4034 | + WHERE c_id = ".$course_id." AND id = ".$lp_order[$order + 1]; |
|
4035 | 4035 | Database::query($sql_u1); |
4036 | - $sql_u2 = "UPDATE $lp_table SET display_order = " . ($order + 1) . " |
|
4037 | - WHERE c_id = ".$course_id." AND id = " . $lp_id; |
|
4036 | + $sql_u2 = "UPDATE $lp_table SET display_order = ".($order + 1)." |
|
4037 | + WHERE c_id = ".$course_id." AND id = ".$lp_id; |
|
4038 | 4038 | Database::query($sql_u2); |
4039 | 4039 | } |
4040 | 4040 | } |
@@ -4054,15 +4054,15 @@ discard block |
||
4054 | 4054 | $this->autocomplete_parents($this->last); |
4055 | 4055 | $new_index = $this->get_next_index(); |
4056 | 4056 | if ($this->debug > 2) { |
4057 | - error_log('New LP - New index: ' . $new_index, 0); |
|
4057 | + error_log('New LP - New index: '.$new_index, 0); |
|
4058 | 4058 | } |
4059 | 4059 | $this->index = $new_index; |
4060 | 4060 | if ($this->debug > 2) { |
4061 | - error_log('New LP - Now having orderedlist[' . $new_index . '] = ' . $this->ordered_items[$new_index], 0); |
|
4061 | + error_log('New LP - Now having orderedlist['.$new_index.'] = '.$this->ordered_items[$new_index], 0); |
|
4062 | 4062 | } |
4063 | 4063 | $this->current = $this->ordered_items[$new_index]; |
4064 | 4064 | if ($this->debug > 2) { |
4065 | - error_log('New LP - new item id is ' . $this->current . '-' . $this->get_current_item_id(), 0); |
|
4065 | + error_log('New LP - new item id is '.$this->current.'-'.$this->get_current_item_id(), 0); |
|
4066 | 4066 | } |
4067 | 4067 | } |
4068 | 4068 | |
@@ -4126,7 +4126,7 @@ discard block |
||
4126 | 4126 | // Clean spaces. |
4127 | 4127 | $prereq_string = str_replace(' ', '', $prereq_string); |
4128 | 4128 | if ($debug > 0) { |
4129 | - error_log('Found prereq_string: ' . $prereq_string, 0); |
|
4129 | + error_log('Found prereq_string: '.$prereq_string, 0); |
|
4130 | 4130 | } |
4131 | 4131 | // Now send to the parse_prereq() function that will check this component's prerequisites. |
4132 | 4132 | $result = $currentItem->parse_prereq( |
@@ -4142,12 +4142,12 @@ discard block |
||
4142 | 4142 | } else { |
4143 | 4143 | $result = true; |
4144 | 4144 | if ($debug > 1) { |
4145 | - error_log('$this->items[' . $itemId . '] was not an object', 0); |
|
4145 | + error_log('$this->items['.$itemId.'] was not an object', 0); |
|
4146 | 4146 | } |
4147 | 4147 | } |
4148 | 4148 | |
4149 | 4149 | if ($debug > 1) { |
4150 | - error_log('End of prerequisites_match(). Error message is now ' . $this->error, 0); |
|
4150 | + error_log('End of prerequisites_match(). Error message is now '.$this->error, 0); |
|
4151 | 4151 | } |
4152 | 4152 | return $result; |
4153 | 4153 | } |
@@ -4213,12 +4213,12 @@ discard block |
||
4213 | 4213 | $row = Database :: fetch_array($result); |
4214 | 4214 | $name = domesticate($row['name']); |
4215 | 4215 | if ($set_visibility == 'i') { |
4216 | - $s = $name . " " . get_lang('LearnpathNotPublished'); |
|
4216 | + $s = $name." ".get_lang('LearnpathNotPublished'); |
|
4217 | 4217 | $dialogBox = $s; |
4218 | 4218 | $v = 0; |
4219 | 4219 | } |
4220 | 4220 | if ($set_visibility == 'v') { |
4221 | - $s = $name . " " . get_lang('LearnpathPublished'); |
|
4221 | + $s = $name." ".get_lang('LearnpathPublished'); |
|
4222 | 4222 | $dialogBox = $s; |
4223 | 4223 | $v = 1; |
4224 | 4224 | } |
@@ -4301,9 +4301,9 @@ discard block |
||
4301 | 4301 | $course_id = api_get_course_int_id(); |
4302 | 4302 | $lp_view_table = Database :: get_course_table(TABLE_LP_VIEW); |
4303 | 4303 | $sql = "INSERT INTO $lp_view_table (c_id, lp_id, user_id, view_count, session_id) |
4304 | - VALUES ($course_id, " . $this->lp_id . "," . $this->get_user_id() . "," . ($this->attempt + 1) . ", $session_id)"; |
|
4304 | + VALUES ($course_id, ".$this->lp_id.",".$this->get_user_id().",".($this->attempt + 1).", $session_id)"; |
|
4305 | 4305 | if ($this->debug > 2) { |
4306 | - error_log('New LP - Inserting new lp_view for restart: ' . $sql, 0); |
|
4306 | + error_log('New LP - Inserting new lp_view for restart: '.$sql, 0); |
|
4307 | 4307 | } |
4308 | 4308 | $res = Database::query($sql); |
4309 | 4309 | $view_id = Database::insert_id(); |
@@ -4341,10 +4341,10 @@ discard block |
||
4341 | 4341 | // TODO: Do a better check on the index pointing to the right item (it is supposed to be working |
4342 | 4342 | // on $ordered_items[] but not sure it's always safe to use with $items[]). |
4343 | 4343 | if ($this->debug > 2) { |
4344 | - error_log('New LP - save_current() saving item ' . $this->current, 0); |
|
4344 | + error_log('New LP - save_current() saving item '.$this->current, 0); |
|
4345 | 4345 | } |
4346 | 4346 | if ($this->debug > 2) { |
4347 | - error_log('' . print_r($this->items, true), 0); |
|
4347 | + error_log(''.print_r($this->items, true), 0); |
|
4348 | 4348 | } |
4349 | 4349 | if (isset($this->items[$this->current]) && |
4350 | 4350 | is_object($this->items[$this->current]) |
@@ -4368,7 +4368,7 @@ discard block |
||
4368 | 4368 | { |
4369 | 4369 | $debug = $this->debug; |
4370 | 4370 | if ($debug) { |
4371 | - error_log('In learnpath::save_item(' . $item_id . ',' . intval($from_outside). ')', 0); |
|
4371 | + error_log('In learnpath::save_item('.$item_id.','.intval($from_outside).')', 0); |
|
4372 | 4372 | } |
4373 | 4373 | // TODO: Do a better check on the index pointing to the right item (it is supposed to be working |
4374 | 4374 | // on $ordered_items[] but not sure it's always safe to use with $items[]). |
@@ -4391,7 +4391,7 @@ discard block |
||
4391 | 4391 | |
4392 | 4392 | if ($debug) { |
4393 | 4393 | error_log('update_queue before:'); |
4394 | - error_log(print_r($this->update_queue,1)); |
|
4394 | + error_log(print_r($this->update_queue, 1)); |
|
4395 | 4395 | } |
4396 | 4396 | $this->autocomplete_parents($item_id); |
4397 | 4397 | |
@@ -4399,9 +4399,9 @@ discard block |
||
4399 | 4399 | $this->update_queue[$item_id] = $status; |
4400 | 4400 | |
4401 | 4401 | if ($debug) { |
4402 | - error_log('get_status(): ' . $status); |
|
4402 | + error_log('get_status(): '.$status); |
|
4403 | 4403 | error_log('update_queue after:'); |
4404 | - error_log(print_r($this->update_queue,1)); |
|
4404 | + error_log(print_r($this->update_queue, 1)); |
|
4405 | 4405 | } |
4406 | 4406 | return $res; |
4407 | 4407 | } |
@@ -4422,17 +4422,17 @@ discard block |
||
4422 | 4422 | |
4423 | 4423 | if (isset($this->current) && !api_is_invitee()) { |
4424 | 4424 | if ($this->debug > 2) { |
4425 | - error_log('New LP - Saving current item (' . $this->current . ') for later review', 0); |
|
4425 | + error_log('New LP - Saving current item ('.$this->current.') for later review', 0); |
|
4426 | 4426 | } |
4427 | 4427 | $sql = "UPDATE $table SET |
4428 | - last_item = " . intval($this->get_current_item_id()). " |
|
4428 | + last_item = ".intval($this->get_current_item_id())." |
|
4429 | 4429 | WHERE |
4430 | 4430 | c_id = $course_id AND |
4431 | - lp_id = " . $this->get_id() . " AND |
|
4431 | + lp_id = ".$this->get_id()." AND |
|
4432 | 4432 | user_id = " . $this->get_user_id()." ".$session_condition; |
4433 | 4433 | |
4434 | 4434 | if ($this->debug > 2) { |
4435 | - error_log('New LP - Saving last item seen : ' . $sql, 0); |
|
4435 | + error_log('New LP - Saving last item seen : '.$sql, 0); |
|
4436 | 4436 | } |
4437 | 4437 | Database::query($sql); |
4438 | 4438 | } |
@@ -4446,7 +4446,7 @@ discard block |
||
4446 | 4446 | progress = $progress |
4447 | 4447 | WHERE |
4448 | 4448 | c_id = ".$course_id." AND |
4449 | - lp_id = " . $this->get_id() . " AND |
|
4449 | + lp_id = " . $this->get_id()." AND |
|
4450 | 4450 | user_id = " . $this->get_user_id()." ".$session_condition; |
4451 | 4451 | // Ignore errors as some tables might not have the progress field just yet. |
4452 | 4452 | Database::query($sql); |
@@ -4462,7 +4462,7 @@ discard block |
||
4462 | 4462 | public function set_current_item($item_id = null) |
4463 | 4463 | { |
4464 | 4464 | if ($this->debug > 0) { |
4465 | - error_log('New LP - In learnpath::set_current_item(' . $item_id . ')', 0); |
|
4465 | + error_log('New LP - In learnpath::set_current_item('.$item_id.')', 0); |
|
4466 | 4466 | } |
4467 | 4467 | if (empty ($item_id)) { |
4468 | 4468 | if ($this->debug > 2) { |
@@ -4471,7 +4471,7 @@ discard block |
||
4471 | 4471 | // Do nothing. |
4472 | 4472 | } else { |
4473 | 4473 | if ($this->debug > 2) { |
4474 | - error_log('New LP - New current item given is ' . $item_id . '...', 0); |
|
4474 | + error_log('New LP - New current item given is '.$item_id.'...', 0); |
|
4475 | 4475 | } |
4476 | 4476 | if (is_numeric($item_id)) { |
4477 | 4477 | $item_id = intval($item_id); |
@@ -4486,10 +4486,10 @@ discard block |
||
4486 | 4486 | } |
4487 | 4487 | } |
4488 | 4488 | if ($this->debug > 2) { |
4489 | - error_log('New LP - set_current_item(' . $item_id . ') done. Index is now : ' . $this->index, 0); |
|
4489 | + error_log('New LP - set_current_item('.$item_id.') done. Index is now : '.$this->index, 0); |
|
4490 | 4490 | } |
4491 | 4491 | } else { |
4492 | - error_log('New LP - set_current_item(' . $item_id . ') failed. Not a numeric value: ', 0); |
|
4492 | + error_log('New LP - set_current_item('.$item_id.') failed. Not a numeric value: ', 0); |
|
4493 | 4493 | } |
4494 | 4494 | } |
4495 | 4495 | } |
@@ -4538,7 +4538,7 @@ discard block |
||
4538 | 4538 | |
4539 | 4539 | if ($lp != 0) { |
4540 | 4540 | $tbl_lp = Database :: get_course_table(TABLE_LP_MAIN); |
4541 | - $sql = "UPDATE $tbl_lp SET js_lib = '$lib' WHERE c_id = ".$course_id." AND id = " . $lp; |
|
4541 | + $sql = "UPDATE $tbl_lp SET js_lib = '$lib' WHERE c_id = ".$course_id." AND id = ".$lp; |
|
4542 | 4542 | $res = Database::query($sql); |
4543 | 4543 | return $res; |
4544 | 4544 | } else { |
@@ -4563,10 +4563,10 @@ discard block |
||
4563 | 4563 | $course_id = api_get_course_int_id(); |
4564 | 4564 | $lp_id = $this->get_id(); |
4565 | 4565 | $sql = "UPDATE $lp_table SET |
4566 | - content_maker = '" . Database::escape_string($this->maker) . "' |
|
4566 | + content_maker = '".Database::escape_string($this->maker)."' |
|
4567 | 4567 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4568 | 4568 | if ($this->debug > 2) { |
4569 | - error_log('New LP - lp updated with new content_maker : ' . $this->maker, 0); |
|
4569 | + error_log('New LP - lp updated with new content_maker : '.$this->maker, 0); |
|
4570 | 4570 | } |
4571 | 4571 | Database::query($sql); |
4572 | 4572 | return true; |
@@ -4590,10 +4590,10 @@ discard block |
||
4590 | 4590 | $lp_id = $this->get_id(); |
4591 | 4591 | $course_id = $this->course_info['real_id']; |
4592 | 4592 | $sql = "UPDATE $lp_table SET |
4593 | - name = '" . Database::escape_string($this->name). "' |
|
4593 | + name = '".Database::escape_string($this->name)."' |
|
4594 | 4594 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4595 | 4595 | if ($this->debug > 2) { |
4596 | - error_log('New LP - lp updated with new name : ' . $this->name, 0); |
|
4596 | + error_log('New LP - lp updated with new name : '.$this->name, 0); |
|
4597 | 4597 | } |
4598 | 4598 | $result = Database::query($sql); |
4599 | 4599 | // If the lp is visible on the homepage, change his name there. |
@@ -4601,7 +4601,7 @@ discard block |
||
4601 | 4601 | $session_id = api_get_session_id(); |
4602 | 4602 | $session_condition = api_get_session_condition($session_id); |
4603 | 4603 | $tbl_tool = Database :: get_course_table(TABLE_TOOL_LIST); |
4604 | - $link = 'newscorm/lp_controller.php?action=view&lp_id=' . $lp_id.'&id_session='.$session_id; |
|
4604 | + $link = 'newscorm/lp_controller.php?action=view&lp_id='.$lp_id.'&id_session='.$session_id; |
|
4605 | 4605 | $sql = "UPDATE $tbl_tool SET name = '$this->name' |
4606 | 4606 | WHERE |
4607 | 4607 | c_id = $course_id AND |
@@ -4680,10 +4680,10 @@ discard block |
||
4680 | 4680 | |
4681 | 4681 | // Save it to search engine. |
4682 | 4682 | foreach ($missing_terms as $term) { |
4683 | - $doc->add_term($prefix . $term, 1); |
|
4683 | + $doc->add_term($prefix.$term, 1); |
|
4684 | 4684 | } |
4685 | 4685 | foreach ($deprecated_terms as $term) { |
4686 | - $doc->remove_term($prefix . $term); |
|
4686 | + $doc->remove_term($prefix.$term); |
|
4687 | 4687 | } |
4688 | 4688 | $di->getDb()->replace_document($se_ref->getSearchDid(), $doc); |
4689 | 4689 | $di->getDb()->flush(); |
@@ -4708,10 +4708,10 @@ discard block |
||
4708 | 4708 | $this->theme = $name; |
4709 | 4709 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4710 | 4710 | $lp_id = $this->get_id(); |
4711 | - $sql = "UPDATE $lp_table SET theme = '" . Database::escape_string($this->theme). "' |
|
4711 | + $sql = "UPDATE $lp_table SET theme = '".Database::escape_string($this->theme)."' |
|
4712 | 4712 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4713 | 4713 | if ($this->debug > 2) { |
4714 | - error_log('New LP - lp updated with new theme : ' . $this->theme, 0); |
|
4714 | + error_log('New LP - lp updated with new theme : '.$this->theme, 0); |
|
4715 | 4715 | } |
4716 | 4716 | Database::query($sql); |
4717 | 4717 | |
@@ -4734,10 +4734,10 @@ discard block |
||
4734 | 4734 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4735 | 4735 | $lp_id = $this->get_id(); |
4736 | 4736 | $sql = "UPDATE $lp_table SET |
4737 | - preview_image = '" . Database::escape_string($this->preview_image). "' |
|
4737 | + preview_image = '".Database::escape_string($this->preview_image)."' |
|
4738 | 4738 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4739 | 4739 | if ($this->debug > 2) { |
4740 | - error_log('New LP - lp updated with new preview image : ' . $this->preview_image, 0); |
|
4740 | + error_log('New LP - lp updated with new preview image : '.$this->preview_image, 0); |
|
4741 | 4741 | } |
4742 | 4742 | Database::query($sql); |
4743 | 4743 | return true; |
@@ -4757,10 +4757,10 @@ discard block |
||
4757 | 4757 | $this->author = $name; |
4758 | 4758 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4759 | 4759 | $lp_id = $this->get_id(); |
4760 | - $sql = "UPDATE $lp_table SET author = '" . Database::escape_string($name). "' |
|
4760 | + $sql = "UPDATE $lp_table SET author = '".Database::escape_string($name)."' |
|
4761 | 4761 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4762 | 4762 | if ($this->debug > 2) { |
4763 | - error_log('New LP - lp updated with new preview author : ' . $this->author, 0); |
|
4763 | + error_log('New LP - lp updated with new preview author : '.$this->author, 0); |
|
4764 | 4764 | } |
4765 | 4765 | Database::query($sql); |
4766 | 4766 | |
@@ -4778,15 +4778,15 @@ discard block |
||
4778 | 4778 | if ($this->debug > 0) { |
4779 | 4779 | error_log('New LP - In learnpath::set_hide_toc_frame()', 0); |
4780 | 4780 | } |
4781 | - if (intval($hide) == $hide){ |
|
4781 | + if (intval($hide) == $hide) { |
|
4782 | 4782 | $this->hide_toc_frame = $hide; |
4783 | 4783 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4784 | 4784 | $lp_id = $this->get_id(); |
4785 | 4785 | $sql = "UPDATE $lp_table SET |
4786 | - hide_toc_frame = '" . $this->hide_toc_frame . "' |
|
4786 | + hide_toc_frame = '".$this->hide_toc_frame."' |
|
4787 | 4787 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4788 | 4788 | if ($this->debug > 2) { |
4789 | - error_log('New LP - lp updated with new preview hide_toc_frame : ' . $this->author, 0); |
|
4789 | + error_log('New LP - lp updated with new preview hide_toc_frame : '.$this->author, 0); |
|
4790 | 4790 | } |
4791 | 4791 | Database::query($sql); |
4792 | 4792 | |
@@ -4813,7 +4813,7 @@ discard block |
||
4813 | 4813 | $sql = "UPDATE $lp_table SET prerequisite = '".$this->prerequisite."' |
4814 | 4814 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4815 | 4815 | if ($this->debug > 2) { |
4816 | - error_log('New LP - lp updated with new preview requisite : ' . $this->requisite, 0); |
|
4816 | + error_log('New LP - lp updated with new preview requisite : '.$this->requisite, 0); |
|
4817 | 4817 | } |
4818 | 4818 | Database::query($sql); |
4819 | 4819 | return true; |
@@ -4837,10 +4837,10 @@ discard block |
||
4837 | 4837 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4838 | 4838 | $lp_id = $this->get_id(); |
4839 | 4839 | $sql = "UPDATE $lp_table SET |
4840 | - content_local = '" . Database::escape_string($name) . "' |
|
4840 | + content_local = '".Database::escape_string($name)."' |
|
4841 | 4841 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4842 | 4842 | if ($this->debug > 2) { |
4843 | - error_log('New LP - lp updated with new proximity : ' . $this->proximity, 0); |
|
4843 | + error_log('New LP - lp updated with new proximity : '.$this->proximity, 0); |
|
4844 | 4844 | } |
4845 | 4845 | Database::query($sql); |
4846 | 4846 | return true; |
@@ -4874,11 +4874,11 @@ discard block |
||
4874 | 4874 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4875 | 4875 | $lp_id = $this->get_id(); |
4876 | 4876 | $sql = "UPDATE $lp_table SET |
4877 | - use_max_score = '" . $this->use_max_score . "' |
|
4877 | + use_max_score = '".$this->use_max_score."' |
|
4878 | 4878 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4879 | 4879 | |
4880 | 4880 | if ($this->debug > 2) { |
4881 | - error_log('New LP - lp updated with new use_max_score : ' . $this->use_max_score, 0); |
|
4881 | + error_log('New LP - lp updated with new use_max_score : '.$this->use_max_score, 0); |
|
4882 | 4882 | } |
4883 | 4883 | Database::query($sql); |
4884 | 4884 | |
@@ -4905,10 +4905,10 @@ discard block |
||
4905 | 4905 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4906 | 4906 | $lp_id = $this->get_id(); |
4907 | 4907 | $sql = "UPDATE $lp_table SET |
4908 | - expired_on = '" . Database::escape_string($this->expired_on) . "' |
|
4908 | + expired_on = '".Database::escape_string($this->expired_on)."' |
|
4909 | 4909 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4910 | 4910 | if ($this->debug > 2) { |
4911 | - error_log('New LP - lp updated with new expired_on : ' . $this->expired_on, 0); |
|
4911 | + error_log('New LP - lp updated with new expired_on : '.$this->expired_on, 0); |
|
4912 | 4912 | } |
4913 | 4913 | Database::query($sql); |
4914 | 4914 | |
@@ -4934,10 +4934,10 @@ discard block |
||
4934 | 4934 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4935 | 4935 | $lp_id = $this->get_id(); |
4936 | 4936 | $sql = "UPDATE $lp_table SET |
4937 | - publicated_on = '" . Database::escape_string($this->publicated_on) . "' |
|
4937 | + publicated_on = '".Database::escape_string($this->publicated_on)."' |
|
4938 | 4938 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4939 | 4939 | if ($this->debug > 2) { |
4940 | - error_log('New LP - lp updated with new publicated_on : ' . $this->publicated_on, 0); |
|
4940 | + error_log('New LP - lp updated with new publicated_on : '.$this->publicated_on, 0); |
|
4941 | 4941 | } |
4942 | 4942 | Database::query($sql); |
4943 | 4943 | |
@@ -4957,10 +4957,10 @@ discard block |
||
4957 | 4957 | $this->modified_on = api_get_utc_datetime(); |
4958 | 4958 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
4959 | 4959 | $lp_id = $this->get_id(); |
4960 | - $sql = "UPDATE $lp_table SET modified_on = '" . $this->modified_on . "' |
|
4960 | + $sql = "UPDATE $lp_table SET modified_on = '".$this->modified_on."' |
|
4961 | 4961 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4962 | 4962 | if ($this->debug > 2) { |
4963 | - error_log('New LP - lp updated with new expired_on : ' . $this->modified_on, 0); |
|
4963 | + error_log('New LP - lp updated with new expired_on : '.$this->modified_on, 0); |
|
4964 | 4964 | } |
4965 | 4965 | Database::query($sql); |
4966 | 4966 | return true; |
@@ -5031,13 +5031,13 @@ discard block |
||
5031 | 5031 | |
5032 | 5032 | if ($this->last != 0 && $this->last != $this->current && is_object($this->items[$this->last])) { |
5033 | 5033 | if ($this->debug > 2) { |
5034 | - error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' is object', 0); |
|
5034 | + error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' is object', 0); |
|
5035 | 5035 | } |
5036 | 5036 | switch ($this->get_type()) { |
5037 | 5037 | case '3' : |
5038 | 5038 | if ($this->items[$this->last]->get_type() != 'au') { |
5039 | 5039 | if ($this->debug > 2) { |
5040 | - error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' in lp_type 3 is <> au', 0); |
|
5040 | + error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' in lp_type 3 is <> au', 0); |
|
5041 | 5041 | } |
5042 | 5042 | $this->items[$this->last]->close(); |
5043 | 5043 | //$this->autocomplete_parents($this->last); |
@@ -5050,7 +5050,7 @@ discard block |
||
5050 | 5050 | case '2' : |
5051 | 5051 | if ($this->items[$this->last]->get_type() != 'sco') { |
5052 | 5052 | if ($this->debug > 2) { |
5053 | - error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' in lp_type 2 is <> sco', 0); |
|
5053 | + error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' in lp_type 2 is <> sco', 0); |
|
5054 | 5054 | } |
5055 | 5055 | $this->items[$this->last]->close(); |
5056 | 5056 | //$this->autocomplete_parents($this->last); |
@@ -5064,7 +5064,7 @@ discard block |
||
5064 | 5064 | case '1' : |
5065 | 5065 | default : |
5066 | 5066 | if ($this->debug > 2) { |
5067 | - error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' in lp_type 1 is asset', 0); |
|
5067 | + error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' in lp_type 1 is asset', 0); |
|
5068 | 5068 | } |
5069 | 5069 | $this->items[$this->last]->close(); |
5070 | 5070 | break; |
@@ -5090,7 +5090,7 @@ discard block |
||
5090 | 5090 | } |
5091 | 5091 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
5092 | 5092 | $sql = "SELECT * FROM $lp_table |
5093 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5093 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5094 | 5094 | $res = Database::query($sql); |
5095 | 5095 | if (Database :: num_rows($res) > 0) { |
5096 | 5096 | $row = Database :: fetch_array($res); |
@@ -5111,14 +5111,14 @@ discard block |
||
5111 | 5111 | break; |
5112 | 5112 | } |
5113 | 5113 | $sql = "UPDATE $lp_table SET default_view_mod = '$view_mode' |
5114 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5114 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5115 | 5115 | Database::query($sql); |
5116 | 5116 | $this->mode = $view_mode; |
5117 | 5117 | |
5118 | 5118 | return $view_mode; |
5119 | 5119 | } else { |
5120 | 5120 | if ($this->debug > 2) { |
5121 | - error_log('New LP - Problem in update_default_view() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
5121 | + error_log('New LP - Problem in update_default_view() - could not find LP '.$this->get_id().' in DB', 0); |
|
5122 | 5122 | } |
5123 | 5123 | } |
5124 | 5124 | return -1; |
@@ -5136,7 +5136,7 @@ discard block |
||
5136 | 5136 | } |
5137 | 5137 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
5138 | 5138 | $sql = "SELECT * FROM $lp_table |
5139 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5139 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5140 | 5140 | $res = Database::query($sql); |
5141 | 5141 | if (Database :: num_rows($res) > 0) { |
5142 | 5142 | $row = Database :: fetch_array($res); |
@@ -5149,14 +5149,14 @@ discard block |
||
5149 | 5149 | $force_return = true; |
5150 | 5150 | } |
5151 | 5151 | $sql = "UPDATE $lp_table SET force_commit = $force |
5152 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5152 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5153 | 5153 | Database::query($sql); |
5154 | 5154 | $this->force_commit = $force_return; |
5155 | 5155 | |
5156 | 5156 | return $force_return; |
5157 | 5157 | } else { |
5158 | 5158 | if ($this->debug > 2) { |
5159 | - error_log('New LP - Problem in update_default_scorm_commit() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
5159 | + error_log('New LP - Problem in update_default_scorm_commit() - could not find LP '.$this->get_id().' in DB', 0); |
|
5160 | 5160 | } |
5161 | 5161 | } |
5162 | 5162 | return -1; |
@@ -5185,7 +5185,7 @@ discard block |
||
5185 | 5185 | if ($row['display_order'] != $i) { // If we find a gap in the order, we need to fix it. |
5186 | 5186 | $need_fix = true; |
5187 | 5187 | $sql = "UPDATE $lp_table SET display_order = $i |
5188 | - WHERE c_id = ".$course_id." AND id = " . $row['id']; |
|
5188 | + WHERE c_id = ".$course_id." AND id = ".$row['id']; |
|
5189 | 5189 | Database::query($sql); |
5190 | 5190 | } |
5191 | 5191 | $i++; |
@@ -5206,7 +5206,7 @@ discard block |
||
5206 | 5206 | } |
5207 | 5207 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
5208 | 5208 | $sql = "SELECT * FROM $lp_table |
5209 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5209 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5210 | 5210 | $res = Database::query($sql); |
5211 | 5211 | if (Database :: num_rows($res) > 0) { |
5212 | 5212 | $row = Database :: fetch_array($res); |
@@ -5217,13 +5217,13 @@ discard block |
||
5217 | 5217 | $force = 1; |
5218 | 5218 | } |
5219 | 5219 | $sql = "UPDATE $lp_table SET prevent_reinit = $force |
5220 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5220 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5221 | 5221 | Database::query($sql); |
5222 | 5222 | $this->prevent_reinit = $force; |
5223 | 5223 | return $force; |
5224 | 5224 | } else { |
5225 | 5225 | if ($this->debug > 2) { |
5226 | - error_log('New LP - Problem in update_reinit() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
5226 | + error_log('New LP - Problem in update_reinit() - could not find LP '.$this->get_id().' in DB', 0); |
|
5227 | 5227 | } |
5228 | 5228 | } |
5229 | 5229 | return -1; |
@@ -5239,11 +5239,11 @@ discard block |
||
5239 | 5239 | { |
5240 | 5240 | //Set default value for seriousgame_mode |
5241 | 5241 | if (!isset($this->seriousgame_mode)) { |
5242 | - $this->seriousgame_mode=0; |
|
5242 | + $this->seriousgame_mode = 0; |
|
5243 | 5243 | } |
5244 | 5244 | // Set default value for prevent_reinit |
5245 | 5245 | if (!isset($this->prevent_reinit)) { |
5246 | - $this->prevent_reinit =1; |
|
5246 | + $this->prevent_reinit = 1; |
|
5247 | 5247 | } |
5248 | 5248 | if ($this->seriousgame_mode == 1 && $this->prevent_reinit == 1) { |
5249 | 5249 | return 'seriousgame'; |
@@ -5291,7 +5291,7 @@ discard block |
||
5291 | 5291 | $sql = "UPDATE $lp_table SET |
5292 | 5292 | prevent_reinit = $prevent_reinit , |
5293 | 5293 | seriousgame_mode = $sg_mode |
5294 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5294 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5295 | 5295 | $res = Database::query($sql); |
5296 | 5296 | if ($res) { |
5297 | 5297 | return true; |
@@ -5343,7 +5343,7 @@ discard block |
||
5343 | 5343 | error_log('New LP - In learnpath::set_seriousgame_mode()', 0); |
5344 | 5344 | } |
5345 | 5345 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
5346 | - $sql = "SELECT * FROM $lp_table WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5346 | + $sql = "SELECT * FROM $lp_table WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5347 | 5347 | $res = Database::query($sql); |
5348 | 5348 | if (Database :: num_rows($res) > 0) { |
5349 | 5349 | $row = Database :: fetch_array($res); |
@@ -5354,13 +5354,13 @@ discard block |
||
5354 | 5354 | $force = 1; |
5355 | 5355 | } |
5356 | 5356 | $sql = "UPDATE $lp_table SET seriousgame_mode = $force |
5357 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5357 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5358 | 5358 | Database::query($sql); |
5359 | 5359 | $this->seriousgame_mode = $force; |
5360 | 5360 | return $force; |
5361 | 5361 | } else { |
5362 | 5362 | if ($this->debug > 2) { |
5363 | - error_log('New LP - Problem in set_seriousgame_mode() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
5363 | + error_log('New LP - Problem in set_seriousgame_mode() - could not find LP '.$this->get_id().' in DB', 0); |
|
5364 | 5364 | } |
5365 | 5365 | } |
5366 | 5366 | return -1; |
@@ -5378,7 +5378,7 @@ discard block |
||
5378 | 5378 | } |
5379 | 5379 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
5380 | 5380 | $sql = "SELECT * FROM $lp_table |
5381 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5381 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5382 | 5382 | $res = Database::query($sql); |
5383 | 5383 | if (Database :: num_rows($res) > 0) { |
5384 | 5384 | $row = Database :: fetch_array($res); |
@@ -5389,13 +5389,13 @@ discard block |
||
5389 | 5389 | $force = 1; |
5390 | 5390 | } |
5391 | 5391 | $sql = "UPDATE $lp_table SET debug = $force |
5392 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
5392 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
5393 | 5393 | $res = Database::query($sql); |
5394 | 5394 | $this->scorm_debug = $force; |
5395 | 5395 | return $force; |
5396 | 5396 | } else { |
5397 | 5397 | if ($this->debug > 2) { |
5398 | - error_log('New LP - Problem in update_scorm_debug() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
5398 | + error_log('New LP - Problem in update_scorm_debug() - could not find LP '.$this->get_id().' in DB', 0); |
|
5399 | 5399 | } |
5400 | 5400 | } |
5401 | 5401 | return -1; |
@@ -5424,7 +5424,7 @@ discard block |
||
5424 | 5424 | * @param int $depth |
5425 | 5425 | * @param array $tmp |
5426 | 5426 | */ |
5427 | - public function create_tree_array($array, $parent = 0, $depth = -1, $tmp = array ()) |
|
5427 | + public function create_tree_array($array, $parent = 0, $depth = -1, $tmp = array()) |
|
5428 | 5428 | { |
5429 | 5429 | if ($this->debug > 1) { |
5430 | 5430 | error_log('New LP - In learnpath::create_tree_array())', 0); |
@@ -5523,14 +5523,14 @@ discard block |
||
5523 | 5523 | } else { |
5524 | 5524 | $return_audio = '<table class="data_table">'; |
5525 | 5525 | $return_audio .= '<tr>'; |
5526 | - $return_audio .= '<th width="40%">' . get_lang('Title') . '</th>'; |
|
5527 | - $return_audio .= '<th>' . get_lang('Audio') . '</th>'; |
|
5526 | + $return_audio .= '<th width="40%">'.get_lang('Title').'</th>'; |
|
5527 | + $return_audio .= '<th>'.get_lang('Audio').'</th>'; |
|
5528 | 5528 | $return_audio .= '</tr>'; |
5529 | 5529 | |
5530 | 5530 | if ($update_audio != 'true') { |
5531 | 5531 | $return .= '<div class="col-md-12">'; |
5532 | 5532 | $return .= self::return_new_tree($update_audio); |
5533 | - $return .='</div>'; |
|
5533 | + $return .= '</div>'; |
|
5534 | 5534 | $return .= Display::div(Display::url(get_lang('Save'), '#', array('id'=>'listSubmit', 'class'=>'btn btn-primary')), array('style'=>'float:left; margin-top:15px;width:100%')); |
5535 | 5535 | } else { |
5536 | 5536 | $return_audio .= self::return_new_tree($update_audio); |
@@ -5540,7 +5540,7 @@ discard block |
||
5540 | 5540 | // We need to close the form when we are updating the mp3 files. |
5541 | 5541 | if ($update_audio == 'true') { |
5542 | 5542 | $return .= '<div class="footer-audio">'; |
5543 | - $return .= Display::button('save_audio','<em class="fa fa-file-audio-o"></em> '. get_lang('SaveAudioAndOrganization'),array('class'=>'btn btn-primary','type'=>'submit')); |
|
5543 | + $return .= Display::button('save_audio', '<em class="fa fa-file-audio-o"></em> '.get_lang('SaveAudioAndOrganization'), array('class'=>'btn btn-primary', 'type'=>'submit')); |
|
5544 | 5544 | $return .= '</div>'; |
5545 | 5545 | //$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? |
5546 | 5546 | } |
@@ -5564,7 +5564,7 @@ discard block |
||
5564 | 5564 | public function return_new_tree($update_audio = 'false', $drop_element_here = false) |
5565 | 5565 | { |
5566 | 5566 | $return = ''; |
5567 | - $is_allowed_to_edit = api_is_allowed_to_edit(null,true); |
|
5567 | + $is_allowed_to_edit = api_is_allowed_to_edit(null, true); |
|
5568 | 5568 | |
5569 | 5569 | $course_id = api_get_course_int_id(); |
5570 | 5570 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
@@ -5610,7 +5610,7 @@ discard block |
||
5610 | 5610 | |
5611 | 5611 | $title_cut = cut($arrLP[$i]['title'], 25); |
5612 | 5612 | |
5613 | - $url = api_get_self() . '?'.api_get_cidreq().'&action=view_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id; |
|
5613 | + $url = api_get_self().'?'.api_get_cidreq().'&action=view_item&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id; |
|
5614 | 5614 | $title_cut = Display::url( |
5615 | 5615 | $title_cut, |
5616 | 5616 | $url, |
@@ -5625,22 +5625,22 @@ discard block |
||
5625 | 5625 | } else { |
5626 | 5626 | $oddClass = 'row_even'; |
5627 | 5627 | } |
5628 | - $return_audio .= '<tr id ="lp_item_'.$arrLP[$i]['id'] .'" class="' . $oddClass . '">'; |
|
5628 | + $return_audio .= '<tr id ="lp_item_'.$arrLP[$i]['id'].'" class="'.$oddClass.'">'; |
|
5629 | 5629 | |
5630 | 5630 | $icon_name = str_replace(' ', '', $arrLP[$i]['item_type']); |
5631 | 5631 | |
5632 | - if (file_exists('../img/lp_' . $icon_name . '.png')) { |
|
5633 | - $icon = Display::return_icon('lp_' . $icon_name . '.png'); |
|
5632 | + if (file_exists('../img/lp_'.$icon_name.'.png')) { |
|
5633 | + $icon = Display::return_icon('lp_'.$icon_name.'.png'); |
|
5634 | 5634 | } else { |
5635 | - if (file_exists('../img/lp_' . $icon_name . '.gif')) { |
|
5636 | - $icon = Display::return_icon('lp_' . $icon_name . '.gif'); |
|
5635 | + if (file_exists('../img/lp_'.$icon_name.'.gif')) { |
|
5636 | + $icon = Display::return_icon('lp_'.$icon_name.'.gif'); |
|
5637 | 5637 | } else { |
5638 | 5638 | $icon = Display::return_icon('folder_document.gif'); |
5639 | 5639 | } |
5640 | 5640 | } |
5641 | 5641 | |
5642 | 5642 | // The audio column. |
5643 | - $return_audio .= '<td align="left" style="padding-left:10px;">'; |
|
5643 | + $return_audio .= '<td align="left" style="padding-left:10px;">'; |
|
5644 | 5644 | $audio = ''; |
5645 | 5645 | if (!$update_audio || $update_audio <> 'true') { |
5646 | 5646 | if (!empty($arrLP[$i]['audio'])) { |
@@ -5650,10 +5650,10 @@ discard block |
||
5650 | 5650 | } else { |
5651 | 5651 | $types = self::getChapterTypes(); |
5652 | 5652 | if (!in_array($arrLP[$i]['item_type'], $types)) { |
5653 | - $audio .= '<input type="file" name="mp3file' . $arrLP[$i]['id'] . '" id="mp3file" />'; |
|
5653 | + $audio .= '<input type="file" name="mp3file'.$arrLP[$i]['id'].'" id="mp3file" />'; |
|
5654 | 5654 | if (!empty ($arrLP[$i]['audio'])) { |
5655 | 5655 | $audio .= '<br />'.Security::remove_XSS($arrLP[$i]['audio']).'<br /> |
5656 | - <input type="checkbox" name="removemp3' . $arrLP[$i]['id'] . '" id="checkbox' . $arrLP[$i]['id'] . '" />' . get_lang('RemoveAudio'); |
|
5656 | + <input type="checkbox" name="removemp3' . $arrLP[$i]['id'].'" id="checkbox'.$arrLP[$i]['id'].'" />'.get_lang('RemoveAudio'); |
|
5657 | 5657 | } |
5658 | 5658 | } |
5659 | 5659 | } |
@@ -5679,7 +5679,7 @@ discard block |
||
5679 | 5679 | // No edit for this item types |
5680 | 5680 | if (!in_array($arrLP[$i]['item_type'], array('sco', 'asset'))) { |
5681 | 5681 | if (!in_array($arrLP[$i]['item_type'], array('dokeos_chapter', 'dokeos_module'))) { |
5682 | - $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">'; |
|
5682 | + $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">'; |
|
5683 | 5683 | $edit_icon .= Display::return_icon('edit.png', get_lang('LearnpathEditModule'), array(), ICON_SIZE_TINY); |
5684 | 5684 | $edit_icon .= '</a>'; |
5685 | 5685 | |
@@ -5690,7 +5690,7 @@ discard block |
||
5690 | 5690 | $this->lp_session_id |
5691 | 5691 | ) |
5692 | 5692 | ) { |
5693 | - $forumIconUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
5693 | + $forumIconUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
5694 | 5694 | 'action' => 'dissociate_forum', |
5695 | 5695 | 'id' => $arrLP[$i]['id'], |
5696 | 5696 | 'lp_id' => $this->lp_id |
@@ -5701,7 +5701,7 @@ discard block |
||
5701 | 5701 | ['class' => 'btn btn-default lp-btn-dissociate-forum'] |
5702 | 5702 | ); |
5703 | 5703 | } else { |
5704 | - $forumIconUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
5704 | + $forumIconUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
5705 | 5705 | 'action' => 'create_forum', |
5706 | 5706 | 'id' => $arrLP[$i]['id'], |
5707 | 5707 | 'lp_id' => $this->lp_id |
@@ -5714,17 +5714,17 @@ discard block |
||
5714 | 5714 | } |
5715 | 5715 | } |
5716 | 5716 | } else { |
5717 | - $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">'; |
|
5717 | + $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">'; |
|
5718 | 5718 | $edit_icon .= Display::return_icon('edit.png', get_lang('LearnpathEditModule'), array(), ICON_SIZE_TINY); |
5719 | 5719 | $edit_icon .= '</a>'; |
5720 | 5720 | } |
5721 | 5721 | } |
5722 | 5722 | |
5723 | - $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">'; |
|
5723 | + $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">'; |
|
5724 | 5724 | $delete_icon .= Display::return_icon('delete.png', get_lang('LearnpathDeleteModule'), array(), ICON_SIZE_TINY); |
5725 | 5725 | $delete_icon .= '</a>'; |
5726 | 5726 | |
5727 | - $url = api_get_self() . '?'.api_get_cidreq().'&view=build&id='.$arrLP[$i]['id'] .'&lp_id='.$this->lp_id; |
|
5727 | + $url = api_get_self().'?'.api_get_cidreq().'&view=build&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id; |
|
5728 | 5728 | |
5729 | 5729 | if ($arrLP[$i]['item_type'] == 'document') { |
5730 | 5730 | $urlPreviewLink = api_get_self().'?'.api_get_cidreq().'&action=view_item&mode=preview_document&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id; |
@@ -5761,8 +5761,8 @@ discard block |
||
5761 | 5761 | } |
5762 | 5762 | } |
5763 | 5763 | if ($update_audio != 'true') { |
5764 | - $row = $move_icon . ' ' . $icon . |
|
5765 | - Display::span($title_cut) . |
|
5764 | + $row = $move_icon.' '.$icon. |
|
5765 | + Display::span($title_cut). |
|
5766 | 5766 | Display::tag( |
5767 | 5767 | 'div', |
5768 | 5768 | "<div class=\"btn-group btn-group-xs\">$previewIcon $audio $edit_icon $forumIcon $prerequisities_icon $move_item_icon $audio_icon $delete_icon</div>", |
@@ -5783,8 +5783,8 @@ discard block |
||
5783 | 5783 | $parent_arrays = array(); |
5784 | 5784 | if ($arrLP[$i]['depth'] > 1) { |
5785 | 5785 | //Getting list of parents |
5786 | - for($j = 0; $j < $arrLP[$i]['depth']; $j++) { |
|
5787 | - foreach($arrLP as $item) { |
|
5786 | + for ($j = 0; $j < $arrLP[$i]['depth']; $j++) { |
|
5787 | + foreach ($arrLP as $item) { |
|
5788 | 5788 | if ($item['id'] == $parent_id) { |
5789 | 5789 | if ($item['parent_item_id'] == 0) { |
5790 | 5790 | $parent_id = $item['id']; |
@@ -5806,8 +5806,8 @@ discard block |
||
5806 | 5806 | $parent_arrays = array_reverse($parent_arrays); |
5807 | 5807 | $val = '$elements'; |
5808 | 5808 | $x = 0; |
5809 | - foreach($parent_arrays as $item) { |
|
5810 | - if ($x != count($parent_arrays) -1) { |
|
5809 | + foreach ($parent_arrays as $item) { |
|
5810 | + if ($x != count($parent_arrays) - 1) { |
|
5811 | 5811 | $val .= '["'.$item.'"]["children"]'; |
5812 | 5812 | } else { |
5813 | 5813 | $val .= '["'.$item.'"]["children"]'; |
@@ -5876,7 +5876,7 @@ discard block |
||
5876 | 5876 | if (isset($_REQUEST['id']) && $key == $_REQUEST['id']) { |
5877 | 5877 | $active = 'active'; |
5878 | 5878 | } |
5879 | - $return .= Display::tag('li', Display::div($item['data'], array('class'=>"item_data $active")).$sub_list, array('id'=>$key, 'class'=>'record li_container')); |
|
5879 | + $return .= Display::tag('li', Display::div($item['data'], array('class'=>"item_data $active")).$sub_list, array('id'=>$key, 'class'=>'record li_container')); |
|
5880 | 5880 | } else { |
5881 | 5881 | // Sections |
5882 | 5882 | if (isset($item['children'])) { |
@@ -5950,7 +5950,7 @@ discard block |
||
5950 | 5950 | { |
5951 | 5951 | // Creating learning_path folder |
5952 | 5952 | $dir = '/learning_path'; |
5953 | - $filepath = api_get_path(SYS_COURSE_PATH).$course['path'] . '/document'; |
|
5953 | + $filepath = api_get_path(SYS_COURSE_PATH).$course['path'].'/document'; |
|
5954 | 5954 | $folder = false; |
5955 | 5955 | if (!is_dir($filepath.'/'.$dir)) { |
5956 | 5956 | $folderData = create_unexisting_directory( |
@@ -5989,14 +5989,14 @@ discard block |
||
5989 | 5989 | |
5990 | 5990 | $folder = self::generate_learning_path_folder($course); |
5991 | 5991 | // Limits title size |
5992 | - $title = api_substr(api_replace_dangerous_char($lp_name), 0 , 80); |
|
5992 | + $title = api_substr(api_replace_dangerous_char($lp_name), 0, 80); |
|
5993 | 5993 | $dir = $dir.$title; |
5994 | 5994 | |
5995 | 5995 | // Creating LP folder |
5996 | 5996 | $documentId = null; |
5997 | 5997 | |
5998 | 5998 | if ($folder) { |
5999 | - $filepath = api_get_path(SYS_COURSE_PATH) . $course['path'] . '/document'; |
|
5999 | + $filepath = api_get_path(SYS_COURSE_PATH).$course['path'].'/document'; |
|
6000 | 6000 | if (!is_dir($filepath.'/'.$dir)) { |
6001 | 6001 | $folderData = create_unexisting_directory( |
6002 | 6002 | $course, |
@@ -6018,7 +6018,7 @@ discard block |
||
6018 | 6018 | } |
6019 | 6019 | $dir = $dir.'/'; |
6020 | 6020 | if ($folder) { |
6021 | - $filepath = api_get_path(SYS_COURSE_PATH) . $course['path'] . '/document'.$dir; |
|
6021 | + $filepath = api_get_path(SYS_COURSE_PATH).$course['path'].'/document'.$dir; |
|
6022 | 6022 | } |
6023 | 6023 | } |
6024 | 6024 | |
@@ -6071,7 +6071,7 @@ discard block |
||
6071 | 6071 | $dir = substr($dir, 1); |
6072 | 6072 | } |
6073 | 6073 | if (!empty($dir[0]) && $dir[0] != '/') { |
6074 | - $dir = '/' . $dir; |
|
6074 | + $dir = '/'.$dir; |
|
6075 | 6075 | } |
6076 | 6076 | if (isset($dir[strlen($dir) - 1]) && $dir[strlen($dir) - 1] != '/') { |
6077 | 6077 | $dir .= '/'; |
@@ -6083,11 +6083,11 @@ discard block |
||
6083 | 6083 | } |
6084 | 6084 | } |
6085 | 6085 | |
6086 | - $filepath = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document' . $dir; |
|
6086 | + $filepath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'.$dir; |
|
6087 | 6087 | |
6088 | 6088 | if (!is_dir($filepath)) { |
6089 | 6089 | $dir = '/'; |
6090 | - $filepath = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document'.$dir; |
|
6090 | + $filepath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'.$dir; |
|
6091 | 6091 | } |
6092 | 6092 | |
6093 | 6093 | // stripslashes() before calling api_replace_dangerous_char() because $_POST['title'] |
@@ -6106,11 +6106,11 @@ discard block |
||
6106 | 6106 | $tmp_filename = $filename; |
6107 | 6107 | |
6108 | 6108 | $i = 0; |
6109 | - while (file_exists($filepath . $tmp_filename . '.'.$extension)) { |
|
6110 | - $tmp_filename = $filename . '_' . ++ $i; |
|
6109 | + while (file_exists($filepath.$tmp_filename.'.'.$extension)) { |
|
6110 | + $tmp_filename = $filename.'_'.++ $i; |
|
6111 | 6111 | } |
6112 | 6112 | |
6113 | - $filename = $tmp_filename . '.'.$extension; |
|
6113 | + $filename = $tmp_filename.'.'.$extension; |
|
6114 | 6114 | if ($extension == 'html') { |
6115 | 6115 | $content = stripslashes($content); |
6116 | 6116 | $content = str_replace( |
@@ -6145,12 +6145,12 @@ discard block |
||
6145 | 6145 | ); |
6146 | 6146 | } |
6147 | 6147 | |
6148 | - if (!file_exists($filepath . $filename)) { |
|
6149 | - if ($fp = @ fopen($filepath . $filename, 'w')) { |
|
6148 | + if (!file_exists($filepath.$filename)) { |
|
6149 | + if ($fp = @ fopen($filepath.$filename, 'w')) { |
|
6150 | 6150 | fputs($fp, $content); |
6151 | 6151 | fclose($fp); |
6152 | 6152 | |
6153 | - $file_size = filesize($filepath . $filename); |
|
6153 | + $file_size = filesize($filepath.$filename); |
|
6154 | 6154 | $save_file_path = $dir.$filename; |
6155 | 6155 | |
6156 | 6156 | $document_id = add_document( |
@@ -6182,9 +6182,9 @@ discard block |
||
6182 | 6182 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
6183 | 6183 | $ct = ''; |
6184 | 6184 | if ($new_comment) |
6185 | - $ct .= ", comment='" . Database::escape_string($new_comment). "'"; |
|
6185 | + $ct .= ", comment='".Database::escape_string($new_comment)."'"; |
|
6186 | 6186 | if ($new_title) |
6187 | - $ct .= ", title='" . Database::escape_string($new_title)."' "; |
|
6187 | + $ct .= ", title='".Database::escape_string($new_title)."' "; |
|
6188 | 6188 | |
6189 | 6189 | $sql = "UPDATE ".$tbl_doc." SET ".substr($ct, 1)." |
6190 | 6190 | WHERE c_id = ".$course_id." AND id = ".$document_id; |
@@ -6216,42 +6216,42 @@ discard block |
||
6216 | 6216 | $dir = substr($dir, 1); |
6217 | 6217 | |
6218 | 6218 | if ($dir[0] != '/') |
6219 | - $dir = '/' . $dir; |
|
6219 | + $dir = '/'.$dir; |
|
6220 | 6220 | |
6221 | 6221 | if ($dir[strlen($dir) - 1] != '/') |
6222 | 6222 | $dir .= '/'; |
6223 | 6223 | |
6224 | - $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document' . $dir; |
|
6224 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir; |
|
6225 | 6225 | |
6226 | 6226 | if (!is_dir($filepath)) { |
6227 | - $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document/'; |
|
6227 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
6228 | 6228 | $dir = '/'; |
6229 | 6229 | } |
6230 | 6230 | |
6231 | 6231 | $table_doc = Database :: get_course_table(TABLE_DOCUMENT); |
6232 | 6232 | if (isset($_POST['path']) && !empty($_POST['path'])) { |
6233 | 6233 | $document_id = intval($_POST['path']); |
6234 | - $sql = "SELECT path FROM " . $table_doc . " |
|
6235 | - WHERE c_id = $course_id AND id = " . $document_id; |
|
6234 | + $sql = "SELECT path FROM ".$table_doc." |
|
6235 | + WHERE c_id = $course_id AND id = ".$document_id; |
|
6236 | 6236 | $res = Database::query($sql); |
6237 | 6237 | $row = Database :: fetch_array($res); |
6238 | 6238 | $content = stripslashes($_POST['content_lp']); |
6239 | - $file = $filepath . $row['path']; |
|
6239 | + $file = $filepath.$row['path']; |
|
6240 | 6240 | |
6241 | 6241 | if ($fp = @ fopen($file, 'w')) { |
6242 | - $content = str_replace(api_get_path(WEB_COURSE_PATH), $urlAppend . '/courses/', $content); |
|
6242 | + $content = str_replace(api_get_path(WEB_COURSE_PATH), $urlAppend.'/courses/', $content); |
|
6243 | 6243 | |
6244 | 6244 | // Change the path of mp3 to absolute. |
6245 | 6245 | // The first regexp deals with :// urls. |
6246 | - $content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1" . api_get_path(REL_COURSE_PATH) . $_course['path'] . '/document/', $content); |
|
6246 | + $content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/', $content); |
|
6247 | 6247 | // The second regexp deals with audio/ urls. |
6248 | - $content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1" . api_get_path(REL_COURSE_PATH) . $_course['path'] . '/document/$2/', $content); |
|
6248 | + $content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/$2/', $content); |
|
6249 | 6249 | fputs($fp, $content); |
6250 | 6250 | fclose($fp); |
6251 | 6251 | |
6252 | - $sql = "UPDATE " . $table_doc ." SET |
|
6252 | + $sql = "UPDATE ".$table_doc." SET |
|
6253 | 6253 | title='".Database::escape_string($_POST['title'])."' |
6254 | - WHERE c_id = ".$course_id." AND id = " . $document_id; |
|
6254 | + WHERE c_id = ".$course_id." AND id = ".$document_id; |
|
6255 | 6255 | Database::query($sql); |
6256 | 6256 | } |
6257 | 6257 | } |
@@ -6269,10 +6269,10 @@ discard block |
||
6269 | 6269 | $return = ''; |
6270 | 6270 | if (is_numeric($item_id)) { |
6271 | 6271 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
6272 | - $sql = "SELECT lp.* FROM " . $tbl_lp_item . " as lp |
|
6273 | - WHERE c_id = ".$course_id." AND lp.id = " . intval($item_id); |
|
6272 | + $sql = "SELECT lp.* FROM ".$tbl_lp_item." as lp |
|
6273 | + WHERE c_id = ".$course_id." AND lp.id = ".intval($item_id); |
|
6274 | 6274 | $result = Database::query($sql); |
6275 | - while ($row = Database :: fetch_array($result,'ASSOC')) { |
|
6275 | + while ($row = Database :: fetch_array($result, 'ASSOC')) { |
|
6276 | 6276 | $valueId = ($row['item_type'] == 'dokeos_chapter' || $row['item_type'] == 'dokeos_module' || $row['item_type'] == 'dir') ? $item_id : 0; |
6277 | 6277 | Session::write('parent_item_id', $valueId); |
6278 | 6278 | |
@@ -6305,8 +6305,8 @@ discard block |
||
6305 | 6305 | break; |
6306 | 6306 | case TOOL_DOCUMENT: |
6307 | 6307 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
6308 | - $sql_doc = "SELECT path FROM " . $tbl_doc . " |
|
6309 | - WHERE c_id = ".$course_id." AND id = " . intval($row['path']); |
|
6308 | + $sql_doc = "SELECT path FROM ".$tbl_doc." |
|
6309 | + WHERE c_id = ".$course_id." AND id = ".intval($row['path']); |
|
6310 | 6310 | $result = Database::query($sql_doc); |
6311 | 6311 | $path_file = Database::result($result, 0, 0); |
6312 | 6312 | $path_parts = pathinfo($path_file); |
@@ -6345,7 +6345,7 @@ discard block |
||
6345 | 6345 | if (is_numeric($item_id)) { |
6346 | 6346 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
6347 | 6347 | $sql = "SELECT * FROM $tbl_lp_item |
6348 | - WHERE c_id = ".$course_id." AND id = " . intval($item_id); |
|
6348 | + WHERE c_id = ".$course_id." AND id = ".intval($item_id); |
|
6349 | 6349 | $res = Database::query($sql); |
6350 | 6350 | $row = Database::fetch_array($res); |
6351 | 6351 | |
@@ -6356,21 +6356,21 @@ discard block |
||
6356 | 6356 | case 'sco' : |
6357 | 6357 | if (isset ($_GET['view']) && $_GET['view'] == 'build') { |
6358 | 6358 | $return .= $this->display_manipulate($item_id, $row['item_type']); |
6359 | - $return .= $this->display_item_form($row['item_type'], get_lang('EditCurrentChapter') . ' :', 'edit', $item_id, $row); |
|
6359 | + $return .= $this->display_item_form($row['item_type'], get_lang('EditCurrentChapter').' :', 'edit', $item_id, $row); |
|
6360 | 6360 | } else { |
6361 | - $return .= $this->display_item_small_form($row['item_type'], get_lang('EditCurrentChapter') . ' :', $row); |
|
6361 | + $return .= $this->display_item_small_form($row['item_type'], get_lang('EditCurrentChapter').' :', $row); |
|
6362 | 6362 | } |
6363 | 6363 | break; |
6364 | 6364 | case TOOL_DOCUMENT : |
6365 | 6365 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
6366 | 6366 | $sql = "SELECT lp.*, doc.path as dir |
6367 | - FROM " . $tbl_lp_item . " as lp |
|
6368 | - LEFT JOIN " . $tbl_doc . " as doc |
|
6367 | + FROM " . $tbl_lp_item." as lp |
|
6368 | + LEFT JOIN " . $tbl_doc." as doc |
|
6369 | 6369 | ON doc.id = lp.path |
6370 | 6370 | WHERE |
6371 | 6371 | lp.c_id = $course_id AND |
6372 | 6372 | doc.c_id = $course_id AND |
6373 | - lp.id = " . intval($item_id); |
|
6373 | + lp.id = ".intval($item_id); |
|
6374 | 6374 | $res_step = Database::query($sql); |
6375 | 6375 | $row_step = Database :: fetch_array($res_step); |
6376 | 6376 | $return .= $this->display_manipulate($item_id, $row['item_type']); |
@@ -6380,8 +6380,8 @@ discard block |
||
6380 | 6380 | $link_id = (string) $row['path']; |
6381 | 6381 | if (ctype_digit($link_id)) { |
6382 | 6382 | $tbl_link = Database :: get_course_table(TABLE_LINK); |
6383 | - $sql_select = 'SELECT url FROM ' . $tbl_link . ' |
|
6384 | - WHERE c_id = '.$course_id.' AND id = ' . intval($link_id); |
|
6383 | + $sql_select = 'SELECT url FROM '.$tbl_link.' |
|
6384 | + WHERE c_id = '.$course_id.' AND id = '.intval($link_id); |
|
6385 | 6385 | $res_link = Database::query($sql_select); |
6386 | 6386 | $row_link = Database :: fetch_array($res_link); |
6387 | 6387 | if (is_array($row_link)) { |
@@ -6394,9 +6394,9 @@ discard block |
||
6394 | 6394 | case 'dokeos_module' : |
6395 | 6395 | if (isset ($_GET['view']) && $_GET['view'] == 'build') { |
6396 | 6396 | $return .= $this->display_manipulate($item_id, $row['item_type']); |
6397 | - $return .= $this->display_item_form($row['item_type'], get_lang('EditCurrentModule') . ' :', 'edit', $item_id, $row); |
|
6397 | + $return .= $this->display_item_form($row['item_type'], get_lang('EditCurrentModule').' :', 'edit', $item_id, $row); |
|
6398 | 6398 | } else { |
6399 | - $return .= $this->display_item_small_form($row['item_type'], get_lang('EditCurrentModule') . ' :', $row); |
|
6399 | + $return .= $this->display_item_small_form($row['item_type'], get_lang('EditCurrentModule').' :', $row); |
|
6400 | 6400 | } |
6401 | 6401 | break; |
6402 | 6402 | case TOOL_QUIZ : |
@@ -6451,7 +6451,7 @@ discard block |
||
6451 | 6451 | |
6452 | 6452 | $headers = array( |
6453 | 6453 | Display::return_icon('folder_document.png', get_lang('Documents'), array(), ICON_SIZE_BIG), |
6454 | - Display::return_icon('quiz.png', get_lang('Quiz'), array(), ICON_SIZE_BIG), |
|
6454 | + Display::return_icon('quiz.png', get_lang('Quiz'), array(), ICON_SIZE_BIG), |
|
6455 | 6455 | Display::return_icon('links.png', get_lang('Links'), array(), ICON_SIZE_BIG), |
6456 | 6456 | Display::return_icon('works.png', get_lang('Works'), array(), ICON_SIZE_BIG), |
6457 | 6457 | Display::return_icon('forum.png', get_lang('Forums'), array(), ICON_SIZE_BIG), |
@@ -6495,16 +6495,16 @@ discard block |
||
6495 | 6495 | $course_id = api_get_course_int_id(); |
6496 | 6496 | $return = ''; |
6497 | 6497 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
6498 | - $sql_doc = "SELECT * FROM " . $tbl_doc . " |
|
6499 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
6498 | + $sql_doc = "SELECT * FROM ".$tbl_doc." |
|
6499 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
6500 | 6500 | $res_doc = Database::query($sql_doc); |
6501 | 6501 | $row_doc = Database :: fetch_array($res_doc); |
6502 | 6502 | |
6503 | 6503 | // TODO: Add a path filter. |
6504 | 6504 | if ($iframe) { |
6505 | - $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>'; |
|
6505 | + $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>'; |
|
6506 | 6506 | } else { |
6507 | - $return .= file_get_contents(api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document' . $row_doc['path']); |
|
6507 | + $return .= file_get_contents(api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$row_doc['path']); |
|
6508 | 6508 | } |
6509 | 6509 | |
6510 | 6510 | return $return; |
@@ -6528,8 +6528,8 @@ discard block |
||
6528 | 6528 | $item_description = $extra_info['description']; |
6529 | 6529 | } elseif (is_numeric($extra_info)) { |
6530 | 6530 | $sql = "SELECT title, description |
6531 | - FROM " . $tbl_quiz . " |
|
6532 | - WHERE c_id = ".$course_id." AND id = " . $extra_info; |
|
6531 | + FROM " . $tbl_quiz." |
|
6532 | + WHERE c_id = ".$course_id." AND id = ".$extra_info; |
|
6533 | 6533 | |
6534 | 6534 | $result = Database::query($sql); |
6535 | 6535 | $row = Database::fetch_array($result); |
@@ -6539,8 +6539,8 @@ discard block |
||
6539 | 6539 | $item_title = ''; |
6540 | 6540 | $item_description = ''; |
6541 | 6541 | } |
6542 | - $item_title = Security::remove_XSS($item_title); |
|
6543 | - $item_description = Security::remove_XSS($item_description); |
|
6542 | + $item_title = Security::remove_XSS($item_title); |
|
6543 | + $item_description = Security::remove_XSS($item_description); |
|
6544 | 6544 | |
6545 | 6545 | $legend = '<legend>'; |
6546 | 6546 | if ($id != 0 && is_array($extra_info)) |
@@ -6548,13 +6548,13 @@ discard block |
||
6548 | 6548 | else |
6549 | 6549 | $parent = 0; |
6550 | 6550 | |
6551 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
6552 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
6551 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
6552 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
6553 | 6553 | |
6554 | 6554 | $result = Database::query($sql); |
6555 | - $arrLP = array (); |
|
6555 | + $arrLP = array(); |
|
6556 | 6556 | while ($row = Database :: fetch_array($result)) { |
6557 | - $arrLP[] = array ( |
|
6557 | + $arrLP[] = array( |
|
6558 | 6558 | 'id' => $row['id'], |
6559 | 6559 | 'item_type' => $row['item_type'], |
6560 | 6560 | 'title' => $row['title'], |
@@ -6577,15 +6577,15 @@ discard block |
||
6577 | 6577 | unset ($this->arrMenu); |
6578 | 6578 | |
6579 | 6579 | if ($action == 'add') { |
6580 | - $legend .= get_lang('CreateTheExercise') . ' :'; |
|
6580 | + $legend .= get_lang('CreateTheExercise').' :'; |
|
6581 | 6581 | } elseif ($action == 'move') { |
6582 | - $legend .= get_lang('MoveTheCurrentExercise') . ' :'; |
|
6582 | + $legend .= get_lang('MoveTheCurrentExercise').' :'; |
|
6583 | 6583 | } else { |
6584 | - $legend .= get_lang('EditCurrentExecice') . ' :'; |
|
6584 | + $legend .= get_lang('EditCurrentExecice').' :'; |
|
6585 | 6585 | } |
6586 | 6586 | |
6587 | 6587 | if (isset ($_GET['edit']) && $_GET['edit'] == 'true') { |
6588 | - $legend .= Display :: return_warning_message(get_lang('Warning') . ' ! ' . get_lang('WarningEditingDocument')); |
|
6588 | + $legend .= Display :: return_warning_message(get_lang('Warning').' ! '.get_lang('WarningEditingDocument')); |
|
6589 | 6589 | } |
6590 | 6590 | |
6591 | 6591 | $legend .= '</legend>'; |
@@ -6598,34 +6598,34 @@ discard block |
||
6598 | 6598 | |
6599 | 6599 | if ($action != 'move') { |
6600 | 6600 | $return .= '<tr>'; |
6601 | - $return .= '<td class="label"><label for="idTitle">' . get_lang('Title') . '</label></td>'; |
|
6602 | - $return .= '<td class="input"><input id="idTitle" name="title" size="44" type="text" value="' . $item_title . '" /></td>'; |
|
6601 | + $return .= '<td class="label"><label for="idTitle">'.get_lang('Title').'</label></td>'; |
|
6602 | + $return .= '<td class="input"><input id="idTitle" name="title" size="44" type="text" value="'.$item_title.'" /></td>'; |
|
6603 | 6603 | $return .= '</tr>'; |
6604 | 6604 | } |
6605 | 6605 | |
6606 | 6606 | $return .= '<tr>'; |
6607 | 6607 | |
6608 | - $return .= '<td class="label"><label for="idParent">' . get_lang('Parent') . '</label></td>'; |
|
6608 | + $return .= '<td class="label"><label for="idParent">'.get_lang('Parent').'</label></td>'; |
|
6609 | 6609 | $return .= '<td class="input">'; |
6610 | 6610 | |
6611 | 6611 | // Select for Parent item, root or chapter |
6612 | 6612 | $return .= '<select id="idParent" style="width:100%;" name="parent" onChange="javascript: load_cbo(this.value);" size="1">'; |
6613 | 6613 | |
6614 | - $return .= '<option class="top" value="0">' . $this->name . '</option>'; |
|
6614 | + $return .= '<option class="top" value="0">'.$this->name.'</option>'; |
|
6615 | 6615 | |
6616 | - $arrHide = array ( |
|
6616 | + $arrHide = array( |
|
6617 | 6617 | $id |
6618 | 6618 | ); |
6619 | 6619 | for ($i = 0; $i < count($arrLP); $i++) { |
6620 | 6620 | if ($action != 'add') { |
6621 | 6621 | 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)) { |
6622 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
6622 | + $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
6623 | 6623 | } else { |
6624 | 6624 | $arrHide[] = $arrLP[$i]['id']; |
6625 | 6625 | } |
6626 | 6626 | } else { |
6627 | 6627 | if ($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir') |
6628 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
6628 | + $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
6629 | 6629 | } |
6630 | 6630 | } |
6631 | 6631 | if (is_array($arrLP)) { |
@@ -6637,11 +6637,11 @@ discard block |
||
6637 | 6637 | $return .= '</tr>'; |
6638 | 6638 | $return .= '<tr>'; |
6639 | 6639 | |
6640 | - $return .= '<td class="label"><label for="previous">' . get_lang('Position') . '</label></td>'; |
|
6640 | + $return .= '<td class="label"><label for="previous">'.get_lang('Position').'</label></td>'; |
|
6641 | 6641 | $return .= '<td class="input">'; |
6642 | 6642 | |
6643 | 6643 | $return .= '<select class="learnpath_item_form" style="width:100%;" id="previous" name="previous" size="1">'; |
6644 | - $return .= '<option class="top" value="0">' . get_lang('FirstPosition') . '</option>'; |
|
6644 | + $return .= '<option class="top" value="0">'.get_lang('FirstPosition').'</option>'; |
|
6645 | 6645 | for ($i = 0; $i < count($arrLP); $i++) { |
6646 | 6646 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
6647 | 6647 | if (is_array($extra_info)) { |
@@ -6653,7 +6653,7 @@ discard block |
||
6653 | 6653 | } else { |
6654 | 6654 | $selected = ''; |
6655 | 6655 | } |
6656 | - $return .= '<option ' . $selected . 'value="' . $arrLP[$i]['id'] . '">' . get_lang('After') . ' "' . $arrLP[$i]['title'] . '"</option>'; |
|
6656 | + $return .= '<option '.$selected.'value="'.$arrLP[$i]['id'].'">'.get_lang('After').' "'.$arrLP[$i]['title'].'"</option>'; |
|
6657 | 6657 | } |
6658 | 6658 | } |
6659 | 6659 | $return .= '</select>'; |
@@ -6670,7 +6670,7 @@ discard block |
||
6670 | 6670 | } |
6671 | 6671 | } |
6672 | 6672 | } |
6673 | - $arrHide = array (); |
|
6673 | + $arrHide = array(); |
|
6674 | 6674 | for ($i = 0; $i < count($arrLP); $i++) { |
6675 | 6675 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
6676 | 6676 | if (is_array($extra_info)) { |
@@ -6716,27 +6716,27 @@ discard block |
||
6716 | 6716 | |
6717 | 6717 | $return .= '<tr>'; |
6718 | 6718 | if ($action == 'add') { |
6719 | - $return .= '<td> </td><td><button class="save" name="submit_button" type="submit">' . get_lang('AddExercise') . '</button></td>'; |
|
6719 | + $return .= '<td> </td><td><button class="save" name="submit_button" type="submit">'.get_lang('AddExercise').'</button></td>'; |
|
6720 | 6720 | } else { |
6721 | - $return .= '<td> </td><td><button class="save" name="submit_button" type="submit">' . get_lang('EditCurrentExecice') . '</button></td>'; |
|
6721 | + $return .= '<td> </td><td><button class="save" name="submit_button" type="submit">'.get_lang('EditCurrentExecice').'</button></td>'; |
|
6722 | 6722 | } |
6723 | 6723 | |
6724 | 6724 | $return .= '</tr>'; |
6725 | 6725 | $return .= '</table>'; |
6726 | 6726 | |
6727 | 6727 | if ($action == 'move') { |
6728 | - $return .= '<input name="title" type="hidden" value="' . $item_title . '" />'; |
|
6729 | - $return .= '<input name="description" type="hidden" value="' . $item_description . '" />'; |
|
6728 | + $return .= '<input name="title" type="hidden" value="'.$item_title.'" />'; |
|
6729 | + $return .= '<input name="description" type="hidden" value="'.$item_description.'" />'; |
|
6730 | 6730 | } |
6731 | 6731 | |
6732 | 6732 | if (is_numeric($extra_info)) { |
6733 | - $return .= '<input name="path" type="hidden" value="' . $extra_info . '" />'; |
|
6733 | + $return .= '<input name="path" type="hidden" value="'.$extra_info.'" />'; |
|
6734 | 6734 | } elseif (is_array($extra_info)) { |
6735 | - $return .= '<input name="path" type="hidden" value="' . $extra_info['path'] . '" />'; |
|
6735 | + $return .= '<input name="path" type="hidden" value="'.$extra_info['path'].'" />'; |
|
6736 | 6736 | } |
6737 | 6737 | |
6738 | - $return .= '<input name="type" type="hidden" value="' . TOOL_QUIZ . '" />'; |
|
6739 | - $return .= '<input name="post_time" type="hidden" value="' . time() . '" />'; |
|
6738 | + $return .= '<input name="type" type="hidden" value="'.TOOL_QUIZ.'" />'; |
|
6739 | + $return .= '<input name="post_time" type="hidden" value="'.time().'" />'; |
|
6740 | 6740 | |
6741 | 6741 | $return .= '</form>'; |
6742 | 6742 | $return .= '</div>'; |
@@ -6763,11 +6763,11 @@ discard block |
||
6763 | 6763 | } elseif (is_numeric($extra_info)) { |
6764 | 6764 | $TBL_DOCUMENT = Database :: get_course_table(TABLE_DOCUMENT); |
6765 | 6765 | |
6766 | - $sql = "SELECT * FROM " . $TBL_DOCUMENT . " |
|
6766 | + $sql = "SELECT * FROM ".$TBL_DOCUMENT." |
|
6767 | 6767 | WHERE |
6768 | 6768 | c_id = ".$course_id." AND |
6769 | - path LIKE '" . $uploadPath . "/%/%htm%' AND |
|
6770 | - id = " . (int) $extra_info . " |
|
6769 | + path LIKE '" . $uploadPath."/%/%htm%' AND |
|
6770 | + id = " . (int) $extra_info." |
|
6771 | 6771 | ORDER BY id ASC"; |
6772 | 6772 | |
6773 | 6773 | $res_hot = Database::query($sql); |
@@ -6791,11 +6791,11 @@ discard block |
||
6791 | 6791 | } |
6792 | 6792 | |
6793 | 6793 | $sql = "SELECT * FROM $tbl_lp_item |
6794 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
6794 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
6795 | 6795 | $result = Database::query($sql); |
6796 | - $arrLP = array (); |
|
6796 | + $arrLP = array(); |
|
6797 | 6797 | while ($row = Database :: fetch_array($result)) { |
6798 | - $arrLP[] = array ( |
|
6798 | + $arrLP[] = array( |
|
6799 | 6799 | 'id' => $row['id'], |
6800 | 6800 | 'item_type' => $row['item_type'], |
6801 | 6801 | 'title' => $row['title'], |
@@ -6820,7 +6820,7 @@ discard block |
||
6820 | 6820 | else |
6821 | 6821 | $legend .= get_lang('EditCurrentExecice'); |
6822 | 6822 | if (isset ($_GET['edit']) && $_GET['edit'] == 'true') { |
6823 | - $legend .= Display :: return_warning_message(get_lang('Warning') . ' ! ' . get_lang('WarningEditingDocument')); |
|
6823 | + $legend .= Display :: return_warning_message(get_lang('Warning').' ! '.get_lang('WarningEditingDocument')); |
|
6824 | 6824 | } |
6825 | 6825 | $legend .= '</legend>'; |
6826 | 6826 | |
@@ -6828,11 +6828,11 @@ discard block |
||
6828 | 6828 | $return .= $legend; |
6829 | 6829 | $return .= '<table cellpadding="0" cellspacing="0" class="lp_form">'; |
6830 | 6830 | $return .= '<tr>'; |
6831 | - $return .= '<td class="label"><label for="idParent">' . get_lang('Parent') . ' :</label></td>'; |
|
6831 | + $return .= '<td class="label"><label for="idParent">'.get_lang('Parent').' :</label></td>'; |
|
6832 | 6832 | $return .= '<td class="input">'; |
6833 | 6833 | $return .= '<select id="idParent" name="parent" onChange="javascript: load_cbo(this.value);" size="1">'; |
6834 | - $return .= '<option class="top" value="0">' . $this->name . '</option>'; |
|
6835 | - $arrHide = array ( |
|
6834 | + $return .= '<option class="top" value="0">'.$this->name.'</option>'; |
|
6835 | + $arrHide = array( |
|
6836 | 6836 | $id |
6837 | 6837 | ); |
6838 | 6838 | |
@@ -6840,13 +6840,13 @@ discard block |
||
6840 | 6840 | for ($i = 0; $i < count($arrLP); $i++) { |
6841 | 6841 | if ($action != 'add') { |
6842 | 6842 | 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)) { |
6843 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
6843 | + $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
6844 | 6844 | } else { |
6845 | 6845 | $arrHide[] = $arrLP[$i]['id']; |
6846 | 6846 | } |
6847 | 6847 | } else { |
6848 | 6848 | if ($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir') |
6849 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
6849 | + $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
6850 | 6850 | } |
6851 | 6851 | } |
6852 | 6852 | |
@@ -6857,10 +6857,10 @@ discard block |
||
6857 | 6857 | $return .= '</td>'; |
6858 | 6858 | $return .= '</tr>'; |
6859 | 6859 | $return .= '<tr>'; |
6860 | - $return .= '<td class="label"><label for="previous">' . get_lang('Position') . ' :</label></td>'; |
|
6860 | + $return .= '<td class="label"><label for="previous">'.get_lang('Position').' :</label></td>'; |
|
6861 | 6861 | $return .= '<td class="input">'; |
6862 | 6862 | $return .= '<select id="previous" name="previous" size="1">'; |
6863 | - $return .= '<option class="top" value="0">' . get_lang('FirstPosition') . '</option>'; |
|
6863 | + $return .= '<option class="top" value="0">'.get_lang('FirstPosition').'</option>'; |
|
6864 | 6864 | |
6865 | 6865 | for ($i = 0; $i < count($arrLP); $i++) { |
6866 | 6866 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
@@ -6870,7 +6870,7 @@ discard block |
||
6870 | 6870 | else |
6871 | 6871 | $selected = ''; |
6872 | 6872 | |
6873 | - $return .= '<option ' . $selected . 'value="' . $arrLP[$i]['id'] . '">' . get_lang('After') . ' "' . $arrLP[$i]['title'] . '"</option>'; |
|
6873 | + $return .= '<option '.$selected.'value="'.$arrLP[$i]['id'].'">'.get_lang('After').' "'.$arrLP[$i]['title'].'"</option>'; |
|
6874 | 6874 | } |
6875 | 6875 | } |
6876 | 6876 | |
@@ -6880,8 +6880,8 @@ discard block |
||
6880 | 6880 | |
6881 | 6881 | if ($action != 'move') { |
6882 | 6882 | $return .= '<tr>'; |
6883 | - $return .= '<td class="label"><label for="idTitle">' . get_lang('Title') . ' :</label></td>'; |
|
6884 | - $return .= '<td class="input"><input id="idTitle" name="title" type="text" value="' . $item_title . '" /></td>'; |
|
6883 | + $return .= '<td class="label"><label for="idTitle">'.get_lang('Title').' :</label></td>'; |
|
6884 | + $return .= '<td class="input"><input id="idTitle" name="title" type="text" value="'.$item_title.'" /></td>'; |
|
6885 | 6885 | $return .= '</tr>'; |
6886 | 6886 | $id_prerequisite = 0; |
6887 | 6887 | if (is_array($arrLP) && count($arrLP) > 0) { |
@@ -6892,7 +6892,7 @@ discard block |
||
6892 | 6892 | } |
6893 | 6893 | } |
6894 | 6894 | |
6895 | - $arrHide = array (); |
|
6895 | + $arrHide = array(); |
|
6896 | 6896 | for ($i = 0; $i < count($arrLP); $i++) { |
6897 | 6897 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
6898 | 6898 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
@@ -6906,22 +6906,22 @@ discard block |
||
6906 | 6906 | } |
6907 | 6907 | |
6908 | 6908 | $return .= '<tr>'; |
6909 | - $return .= '<td> </td><td><button class="save" name="submit_button" action="edit" type="submit">' . get_lang('SaveHotpotatoes') . '</button></td>'; |
|
6909 | + $return .= '<td> </td><td><button class="save" name="submit_button" action="edit" type="submit">'.get_lang('SaveHotpotatoes').'</button></td>'; |
|
6910 | 6910 | $return .= '</tr>'; |
6911 | 6911 | $return .= '</table>'; |
6912 | 6912 | |
6913 | 6913 | if ($action == 'move') { |
6914 | - $return .= '<input name="title" type="hidden" value="' . $item_title . '" />'; |
|
6915 | - $return .= '<input name="description" type="hidden" value="' . $item_description . '" />'; |
|
6914 | + $return .= '<input name="title" type="hidden" value="'.$item_title.'" />'; |
|
6915 | + $return .= '<input name="description" type="hidden" value="'.$item_description.'" />'; |
|
6916 | 6916 | } |
6917 | 6917 | |
6918 | 6918 | if (is_numeric($extra_info)) { |
6919 | - $return .= '<input name="path" type="hidden" value="' . $extra_info . '" />'; |
|
6919 | + $return .= '<input name="path" type="hidden" value="'.$extra_info.'" />'; |
|
6920 | 6920 | } elseif (is_array($extra_info)) { |
6921 | - $return .= '<input name="path" type="hidden" value="' . $extra_info['path'] . '" />'; |
|
6921 | + $return .= '<input name="path" type="hidden" value="'.$extra_info['path'].'" />'; |
|
6922 | 6922 | } |
6923 | - $return .= '<input name="type" type="hidden" value="' . TOOL_HOTPOTATOES . '" />'; |
|
6924 | - $return .= '<input name="post_time" type="hidden" value="' . time() . '" />'; |
|
6923 | + $return .= '<input name="type" type="hidden" value="'.TOOL_HOTPOTATOES.'" />'; |
|
6924 | + $return .= '<input name="post_time" type="hidden" value="'.time().'" />'; |
|
6925 | 6925 | $return .= '</form>'; |
6926 | 6926 | |
6927 | 6927 | return $return; |
@@ -6944,8 +6944,8 @@ discard block |
||
6944 | 6944 | $item_title = stripslashes($extra_info['title']); |
6945 | 6945 | } elseif (is_numeric($extra_info)) { |
6946 | 6946 | $sql = "SELECT forum_title as title, forum_comment as comment |
6947 | - FROM " . $tbl_forum . " |
|
6948 | - WHERE c_id = ".$course_id." AND forum_id = " . $extra_info; |
|
6947 | + FROM " . $tbl_forum." |
|
6948 | + WHERE c_id = ".$course_id." AND forum_id = ".$extra_info; |
|
6949 | 6949 | |
6950 | 6950 | $result = Database::query($sql); |
6951 | 6951 | $row = Database :: fetch_array($result); |
@@ -6965,7 +6965,7 @@ discard block |
||
6965 | 6965 | $parent = 0; |
6966 | 6966 | } |
6967 | 6967 | |
6968 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
6968 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
6969 | 6969 | WHERE |
6970 | 6970 | c_id = ".$course_id." AND |
6971 | 6971 | lp_id = " . $this->lp_id; |
@@ -6973,7 +6973,7 @@ discard block |
||
6973 | 6973 | $arrLP = array(); |
6974 | 6974 | |
6975 | 6975 | while ($row = Database :: fetch_array($result)) { |
6976 | - $arrLP[] = array ( |
|
6976 | + $arrLP[] = array( |
|
6977 | 6977 | 'id' => $row['id'], |
6978 | 6978 | 'item_type' => $row['item_type'], |
6979 | 6979 | 'title' => $row['title'], |
@@ -6995,10 +6995,10 @@ discard block |
||
6995 | 6995 | unset($this->arrMenu); |
6996 | 6996 | |
6997 | 6997 | if ($action == 'add') |
6998 | - $legend .= get_lang('CreateTheForum') . ' :'; |
|
6999 | - elseif ($action == 'move') $legend .= get_lang('MoveTheCurrentForum') . ' :'; |
|
6998 | + $legend .= get_lang('CreateTheForum').' :'; |
|
6999 | + elseif ($action == 'move') $legend .= get_lang('MoveTheCurrentForum').' :'; |
|
7000 | 7000 | else |
7001 | - $legend .= get_lang('EditCurrentForum') . ' :'; |
|
7001 | + $legend .= get_lang('EditCurrentForum').' :'; |
|
7002 | 7002 | |
7003 | 7003 | $legend .= '</legend>'; |
7004 | 7004 | $return = '<div class="sectioncomment">'; |
@@ -7008,16 +7008,16 @@ discard block |
||
7008 | 7008 | |
7009 | 7009 | if ($action != 'move') { |
7010 | 7010 | $return .= '<tr>'; |
7011 | - $return .= '<td class="label"><label for="idTitle">' . get_lang('Title') . '</label></td>'; |
|
7012 | - $return .= '<td class="input"><input id="idTitle" size="44" name="title" type="text" value="' . $item_title . '" class="learnpath_item_form" /></td>'; |
|
7011 | + $return .= '<td class="label"><label for="idTitle">'.get_lang('Title').'</label></td>'; |
|
7012 | + $return .= '<td class="input"><input id="idTitle" size="44" name="title" type="text" value="'.$item_title.'" class="learnpath_item_form" /></td>'; |
|
7013 | 7013 | $return .= '</tr>'; |
7014 | 7014 | } |
7015 | 7015 | |
7016 | 7016 | $return .= '<tr>'; |
7017 | - $return .= '<td class="label"><label for="idParent">' . get_lang('Parent') . '</label></td>'; |
|
7017 | + $return .= '<td class="label"><label for="idParent">'.get_lang('Parent').'</label></td>'; |
|
7018 | 7018 | $return .= '<td class="input">'; |
7019 | 7019 | $return .= '<select id="idParent" style="width:100%;" name="parent" onChange="javascript: load_cbo(this.value);" class="learnpath_item_form" size="1">'; |
7020 | - $return .= '<option class="top" value="0">' . $this->name . '</option>'; |
|
7020 | + $return .= '<option class="top" value="0">'.$this->name.'</option>'; |
|
7021 | 7021 | $arrHide = array( |
7022 | 7022 | $id |
7023 | 7023 | ); |
@@ -7025,13 +7025,13 @@ discard block |
||
7025 | 7025 | for ($i = 0; $i < count($arrLP); $i++) { |
7026 | 7026 | if ($action != 'add') { |
7027 | 7027 | 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)) { |
7028 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
7028 | + $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
7029 | 7029 | } else { |
7030 | 7030 | $arrHide[] = $arrLP[$i]['id']; |
7031 | 7031 | } |
7032 | 7032 | } else { |
7033 | 7033 | if ($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir') |
7034 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
7034 | + $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
7035 | 7035 | } |
7036 | 7036 | } |
7037 | 7037 | if (is_array($arrLP)) { |
@@ -7042,10 +7042,10 @@ discard block |
||
7042 | 7042 | $return .= '</td>'; |
7043 | 7043 | $return .= '</tr>'; |
7044 | 7044 | $return .= '<tr>'; |
7045 | - $return .= '<td class="label"><label for="previous">' . get_lang('Position') . '</label></td>'; |
|
7045 | + $return .= '<td class="label"><label for="previous">'.get_lang('Position').'</label></td>'; |
|
7046 | 7046 | $return .= '<td class="input">'; |
7047 | 7047 | $return .= '<select id="previous" name="previous" style="width:100%;" size="1" class="learnpath_item_form">'; |
7048 | - $return .= '<option class="top" value="0">' . get_lang('FirstPosition') . '</option>'; |
|
7048 | + $return .= '<option class="top" value="0">'.get_lang('FirstPosition').'</option>'; |
|
7049 | 7049 | |
7050 | 7050 | for ($i = 0; $i < count($arrLP); $i++) { |
7051 | 7051 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
@@ -7055,8 +7055,8 @@ discard block |
||
7055 | 7055 | else |
7056 | 7056 | $selected = ''; |
7057 | 7057 | |
7058 | - $return .= '<option ' . $selected . 'value="' . $arrLP[$i]['id'] . '">' . |
|
7059 | - get_lang('After') . ' "' . $arrLP[$i]['title'] . '"</option>'; |
|
7058 | + $return .= '<option '.$selected.'value="'.$arrLP[$i]['id'].'">'. |
|
7059 | + get_lang('After').' "'.$arrLP[$i]['title'].'"</option>'; |
|
7060 | 7060 | } |
7061 | 7061 | } |
7062 | 7062 | |
@@ -7090,25 +7090,25 @@ discard block |
||
7090 | 7090 | $return .= '<tr>'; |
7091 | 7091 | |
7092 | 7092 | if ($action == 'add') { |
7093 | - $return .= '<td> </td><td><button class="save" name="submit_button" type="submit"> ' . get_lang('AddForumToCourse') . ' </button></td>'; |
|
7093 | + $return .= '<td> </td><td><button class="save" name="submit_button" type="submit"> '.get_lang('AddForumToCourse').' </button></td>'; |
|
7094 | 7094 | } else { |
7095 | - $return .= '<td> </td><td><button class="save" name="submit_button" type="submit"> ' . get_lang('EditCurrentForum') . ' </button></td>'; |
|
7095 | + $return .= '<td> </td><td><button class="save" name="submit_button" type="submit"> '.get_lang('EditCurrentForum').' </button></td>'; |
|
7096 | 7096 | } |
7097 | 7097 | $return .= '</tr>'; |
7098 | 7098 | $return .= '</table>'; |
7099 | 7099 | |
7100 | 7100 | if ($action == 'move') { |
7101 | - $return .= '<input name="title" type="hidden" value="' . $item_title . '" />'; |
|
7102 | - $return .= '<input name="description" type="hidden" value="' . $item_description . '" />'; |
|
7101 | + $return .= '<input name="title" type="hidden" value="'.$item_title.'" />'; |
|
7102 | + $return .= '<input name="description" type="hidden" value="'.$item_description.'" />'; |
|
7103 | 7103 | } |
7104 | 7104 | |
7105 | 7105 | if (is_numeric($extra_info)) { |
7106 | - $return .= '<input name="path" type="hidden" value="' . $extra_info . '" />'; |
|
7106 | + $return .= '<input name="path" type="hidden" value="'.$extra_info.'" />'; |
|
7107 | 7107 | } elseif (is_array($extra_info)) { |
7108 | - $return .= '<input name="path" type="hidden" value="' . $extra_info['path'] . '" />'; |
|
7108 | + $return .= '<input name="path" type="hidden" value="'.$extra_info['path'].'" />'; |
|
7109 | 7109 | } |
7110 | - $return .= '<input name="type" type="hidden" value="' . TOOL_FORUM . '" />'; |
|
7111 | - $return .= '<input name="post_time" type="hidden" value="' . time() . '" />'; |
|
7110 | + $return .= '<input name="type" type="hidden" value="'.TOOL_FORUM.'" />'; |
|
7111 | + $return .= '<input name="post_time" type="hidden" value="'.time().'" />'; |
|
7112 | 7112 | $return .= '</form>'; |
7113 | 7113 | $return .= '</div>'; |
7114 | 7114 | |
@@ -7135,7 +7135,7 @@ discard block |
||
7135 | 7135 | $item_title = stripslashes($extra_info['title']); |
7136 | 7136 | } elseif (is_numeric($extra_info)) { |
7137 | 7137 | $sql = "SELECT thread_title as title FROM $tbl_forum |
7138 | - WHERE c_id = $course_id AND thread_id = " . $extra_info; |
|
7138 | + WHERE c_id = $course_id AND thread_id = ".$extra_info; |
|
7139 | 7139 | |
7140 | 7140 | $result = Database::query($sql); |
7141 | 7141 | $row = Database :: fetch_array($result); |
@@ -7155,15 +7155,15 @@ discard block |
||
7155 | 7155 | $parent = 0; |
7156 | 7156 | } |
7157 | 7157 | |
7158 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
7159 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
7158 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
7159 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
7160 | 7160 | |
7161 | 7161 | $result = Database::query($sql); |
7162 | 7162 | |
7163 | - $arrLP = array (); |
|
7163 | + $arrLP = array(); |
|
7164 | 7164 | |
7165 | 7165 | while ($row = Database :: fetch_array($result)) { |
7166 | - $arrLP[] = array ( |
|
7166 | + $arrLP[] = array( |
|
7167 | 7167 | 'id' => $row['id'], |
7168 | 7168 | 'item_type' => $row['item_type'], |
7169 | 7169 | 'title' => $row['title'], |
@@ -7186,31 +7186,31 @@ discard block |
||
7186 | 7186 | |
7187 | 7187 | $return .= '<form method="POST">'; |
7188 | 7188 | if ($action == 'add') |
7189 | - $return .= '<legend>' . get_lang('CreateTheForum') . '</legend>'; |
|
7190 | - elseif ($action == 'move') $return .= '<p class="lp_title">' . get_lang('MoveTheCurrentForum') . ' :</p>'; |
|
7189 | + $return .= '<legend>'.get_lang('CreateTheForum').'</legend>'; |
|
7190 | + elseif ($action == 'move') $return .= '<p class="lp_title">'.get_lang('MoveTheCurrentForum').' :</p>'; |
|
7191 | 7191 | else |
7192 | - $return .= '<legend>' . get_lang('EditCurrentForum') . '</legend>'; |
|
7192 | + $return .= '<legend>'.get_lang('EditCurrentForum').'</legend>'; |
|
7193 | 7193 | |
7194 | 7194 | $return .= '<table cellpadding="0" cellspacing="0" class="lp_form">'; |
7195 | 7195 | $return .= '<tr>'; |
7196 | - $return .= '<td class="label"><label for="idParent">' . get_lang('Parent') . '</label></td>'; |
|
7196 | + $return .= '<td class="label"><label for="idParent">'.get_lang('Parent').'</label></td>'; |
|
7197 | 7197 | $return .= '<td class="input">'; |
7198 | 7198 | $return .= '<select id="idParent" name="parent" onChange="javascript: load_cbo(this.value);" size="1">'; |
7199 | - $return .= '<option class="top" value="0">' . $this->name . '</option>'; |
|
7200 | - $arrHide = array ( |
|
7199 | + $return .= '<option class="top" value="0">'.$this->name.'</option>'; |
|
7200 | + $arrHide = array( |
|
7201 | 7201 | $id |
7202 | 7202 | ); |
7203 | 7203 | |
7204 | 7204 | for ($i = 0; $i < count($arrLP); $i++) { |
7205 | 7205 | if ($action != 'add') { |
7206 | 7206 | 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)) { |
7207 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
7207 | + $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
7208 | 7208 | } else { |
7209 | 7209 | $arrHide[] = $arrLP[$i]['id']; |
7210 | 7210 | } |
7211 | 7211 | } else { |
7212 | 7212 | if ($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir') |
7213 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
7213 | + $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
7214 | 7214 | } |
7215 | 7215 | } |
7216 | 7216 | |
@@ -7222,10 +7222,10 @@ discard block |
||
7222 | 7222 | $return .= '</td>'; |
7223 | 7223 | $return .= '</tr>'; |
7224 | 7224 | $return .= '<tr>'; |
7225 | - $return .= '<td class="label"><label for="previous">' . get_lang('Position') . '</label></td>'; |
|
7225 | + $return .= '<td class="label"><label for="previous">'.get_lang('Position').'</label></td>'; |
|
7226 | 7226 | $return .= '<td class="input">'; |
7227 | 7227 | $return .= '<select id="previous" name="previous" size="1">'; |
7228 | - $return .= '<option class="top" value="0">' . get_lang('FirstPosition') . '</option>'; |
|
7228 | + $return .= '<option class="top" value="0">'.get_lang('FirstPosition').'</option>'; |
|
7229 | 7229 | for ($i = 0; $i < count($arrLP); $i++) { |
7230 | 7230 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
7231 | 7231 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
@@ -7234,7 +7234,7 @@ discard block |
||
7234 | 7234 | else |
7235 | 7235 | $selected = ''; |
7236 | 7236 | |
7237 | - $return .= '<option ' . $selected . 'value="' . $arrLP[$i]['id'] . '">' . get_lang('After') . ' "' . $arrLP[$i]['title'] . '"</option>'; |
|
7237 | + $return .= '<option '.$selected.'value="'.$arrLP[$i]['id'].'">'.get_lang('After').' "'.$arrLP[$i]['title'].'"</option>'; |
|
7238 | 7238 | } |
7239 | 7239 | } |
7240 | 7240 | $return .= '</select>'; |
@@ -7242,8 +7242,8 @@ discard block |
||
7242 | 7242 | $return .= '</tr>'; |
7243 | 7243 | if ($action != 'move') { |
7244 | 7244 | $return .= '<tr>'; |
7245 | - $return .= '<td class="label"><label for="idTitle">' . get_lang('Title') . '</label></td>'; |
|
7246 | - $return .= '<td class="input"><input id="idTitle" name="title" type="text" value="' . $item_title . '" /></td>'; |
|
7245 | + $return .= '<td class="label"><label for="idTitle">'.get_lang('Title').'</label></td>'; |
|
7246 | + $return .= '<td class="input"><input id="idTitle" name="title" type="text" value="'.$item_title.'" /></td>'; |
|
7247 | 7247 | $return .= '</tr>'; |
7248 | 7248 | $return .= '<tr>'; |
7249 | 7249 | $return .= '</tr>'; |
@@ -7270,17 +7270,17 @@ discard block |
||
7270 | 7270 | } |
7271 | 7271 | |
7272 | 7272 | $return .= '<tr>'; |
7273 | - $return .= '<td class="label"><label for="idPrerequisites">' . get_lang('LearnpathPrerequisites') . '</label></td>'; |
|
7274 | - $return .= '<td class="input"><select name="prerequisites" id="prerequisites"><option value="0">' . get_lang('NoPrerequisites') . '</option>'; |
|
7273 | + $return .= '<td class="label"><label for="idPrerequisites">'.get_lang('LearnpathPrerequisites').'</label></td>'; |
|
7274 | + $return .= '<td class="input"><select name="prerequisites" id="prerequisites"><option value="0">'.get_lang('NoPrerequisites').'</option>'; |
|
7275 | 7275 | |
7276 | 7276 | foreach ($arrHide as $key => $value) { |
7277 | 7277 | if ($key == $s_selected_position && $action == 'add') { |
7278 | - $return .= '<option value="' . $key . '" selected="selected">' . $value['value'] . '</option>'; |
|
7278 | + $return .= '<option value="'.$key.'" selected="selected">'.$value['value'].'</option>'; |
|
7279 | 7279 | } |
7280 | 7280 | elseif ($key == $id_prerequisite && $action == 'edit') { |
7281 | - $return .= '<option value="' . $key . '" selected="selected">' . $value['value'] . '</option>'; |
|
7281 | + $return .= '<option value="'.$key.'" selected="selected">'.$value['value'].'</option>'; |
|
7282 | 7282 | } else { |
7283 | - $return .= '<option value="' . $key . '">' . $value['value'] . '</option>'; |
|
7283 | + $return .= '<option value="'.$key.'">'.$value['value'].'</option>'; |
|
7284 | 7284 | } |
7285 | 7285 | } |
7286 | 7286 | $return .= "</select></td>"; |
@@ -7294,19 +7294,19 @@ discard block |
||
7294 | 7294 | $return .= '</table>'; |
7295 | 7295 | |
7296 | 7296 | if ($action == 'move') { |
7297 | - $return .= '<input name="title" type="hidden" value="' . $item_title . '" />'; |
|
7298 | - $return .= '<input name="description" type="hidden" value="' . $item_description . '" />'; |
|
7297 | + $return .= '<input name="title" type="hidden" value="'.$item_title.'" />'; |
|
7298 | + $return .= '<input name="description" type="hidden" value="'.$item_description.'" />'; |
|
7299 | 7299 | } |
7300 | 7300 | |
7301 | 7301 | if (is_numeric($extra_info)) { |
7302 | - $return .= '<input name="path" type="hidden" value="' . $extra_info . '" />'; |
|
7302 | + $return .= '<input name="path" type="hidden" value="'.$extra_info.'" />'; |
|
7303 | 7303 | } |
7304 | 7304 | elseif (is_array($extra_info)) { |
7305 | - $return .= '<input name="path" type="hidden" value="' . $extra_info['path'] . '" />'; |
|
7305 | + $return .= '<input name="path" type="hidden" value="'.$extra_info['path'].'" />'; |
|
7306 | 7306 | } |
7307 | 7307 | |
7308 | - $return .= '<input name="type" type="hidden" value="' . TOOL_THREAD . '" />'; |
|
7309 | - $return .= '<input name="post_time" type="hidden" value="' . time() . '" />'; |
|
7308 | + $return .= '<input name="type" type="hidden" value="'.TOOL_THREAD.'" />'; |
|
7309 | + $return .= '<input name="post_time" type="hidden" value="'.time().'" />'; |
|
7310 | 7310 | $return .= '</form>'; |
7311 | 7311 | $return .= '</div>'; |
7312 | 7312 | |
@@ -7332,10 +7332,10 @@ discard block |
||
7332 | 7332 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
7333 | 7333 | |
7334 | 7334 | if ($id != 0 && is_array($extra_info)) { |
7335 | - $item_title = $extra_info['title']; |
|
7336 | - $item_description = $extra_info['description']; |
|
7337 | - $item_path = api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/scorm/' . $this->path . '/' . stripslashes($extra_info['path']); |
|
7338 | - $item_path_fck = '/scorm/' . $this->path . '/' . stripslashes($extra_info['path']); |
|
7335 | + $item_title = $extra_info['title']; |
|
7336 | + $item_description = $extra_info['description']; |
|
7337 | + $item_path = api_get_path(WEB_COURSE_PATH).$_course['path'].'/scorm/'.$this->path.'/'.stripslashes($extra_info['path']); |
|
7338 | + $item_path_fck = '/scorm/'.$this->path.'/'.stripslashes($extra_info['path']); |
|
7339 | 7339 | } else { |
7340 | 7340 | $item_title = ''; |
7341 | 7341 | $item_description = ''; |
@@ -7349,17 +7349,17 @@ discard block |
||
7349 | 7349 | } |
7350 | 7350 | |
7351 | 7351 | $id = intval($id); |
7352 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
7352 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
7353 | 7353 | WHERE |
7354 | 7354 | c_id = ".$course_id." AND |
7355 | - lp_id = " . $this->lp_id . " AND |
|
7355 | + lp_id = " . $this->lp_id." AND |
|
7356 | 7356 | id != $id"; |
7357 | 7357 | |
7358 | 7358 | if ($item_type == 'module') |
7359 | 7359 | $sql .= " AND parent_item_id = 0"; |
7360 | 7360 | |
7361 | 7361 | $result = Database::query($sql); |
7362 | - $arrLP = array (); |
|
7362 | + $arrLP = array(); |
|
7363 | 7363 | |
7364 | 7364 | while ($row = Database :: fetch_array($result)) { |
7365 | 7365 | $arrLP[] = array( |
@@ -7385,9 +7385,9 @@ discard block |
||
7385 | 7385 | |
7386 | 7386 | unset ($this->arrMenu); |
7387 | 7387 | |
7388 | - $url = api_get_self() . '?' .api_get_cidreq().'&action='.$action.'&type='.$item_type.'&lp_id='.$this->lp_id; |
|
7388 | + $url = api_get_self().'?'.api_get_cidreq().'&action='.$action.'&type='.$item_type.'&lp_id='.$this->lp_id; |
|
7389 | 7389 | |
7390 | - $form = new FormValidator('form', 'POST', $url); |
|
7390 | + $form = new FormValidator('form', 'POST', $url); |
|
7391 | 7391 | |
7392 | 7392 | $defaults['title'] = !empty($item_title) ? api_html_entity_decode($item_title, ENT_QUOTES, $charset) : ''; |
7393 | 7393 | $defaults['description'] = $item_description; |
@@ -7440,7 +7440,7 @@ discard block |
||
7440 | 7440 | ); |
7441 | 7441 | |
7442 | 7442 | foreach ($arrHide as $key => $value) { |
7443 | - $parent_select->addOption($value['value'], $key, 'style="padding-left:' . $value['padding'] . 'px;"'); |
|
7443 | + $parent_select->addOption($value['value'], $key, 'style="padding-left:'.$value['padding'].'px;"'); |
|
7444 | 7444 | } |
7445 | 7445 | if (!empty($s_selected_parent)) { |
7446 | 7446 | $parent_select->setSelected($s_selected_parent); |
@@ -7462,16 +7462,16 @@ discard block |
||
7462 | 7462 | $s_selected_position = $arrLP[$i]['id']; |
7463 | 7463 | } |
7464 | 7464 | |
7465 | - $arrHide[$arrLP[$i]['id']]['value'] = get_lang('After') . ' "' . $arrLP[$i]['title'] . '"'; |
|
7465 | + $arrHide[$arrLP[$i]['id']]['value'] = get_lang('After').' "'.$arrLP[$i]['title'].'"'; |
|
7466 | 7466 | } |
7467 | 7467 | } |
7468 | 7468 | |
7469 | 7469 | $position = $form->addElement('select', 'previous', get_lang('Position'), '', array('id' => 'previous')); |
7470 | 7470 | $padding = isset($value['padding']) ? $value['padding'] : 0; |
7471 | - $position->addOption(get_lang('FirstPosition'), 0, 'style="padding-left:' . $padding . 'px;"'); |
|
7471 | + $position->addOption(get_lang('FirstPosition'), 0, 'style="padding-left:'.$padding.'px;"'); |
|
7472 | 7472 | |
7473 | 7473 | foreach ($arrHide as $key => $value) { |
7474 | - $position->addOption($value['value'] . '"', $key, 'style="padding-left:' . $padding . 'px;"'); |
|
7474 | + $position->addOption($value['value'].'"', $key, 'style="padding-left:'.$padding.'px;"'); |
|
7475 | 7475 | } |
7476 | 7476 | |
7477 | 7477 | if (!empty ($s_selected_position)) { |
@@ -7500,10 +7500,10 @@ discard block |
||
7500 | 7500 | //assets can't be modified |
7501 | 7501 | |
7502 | 7502 | //$item_type == 'asset' || |
7503 | - if (( $item_type == 'sco') && ($extension == 'html' || $extension == 'htm')) { |
|
7503 | + if (($item_type == 'sco') && ($extension == 'html' || $extension == 'htm')) { |
|
7504 | 7504 | |
7505 | 7505 | if ($item_type == 'sco') { |
7506 | - $form->addElement('html', '<script type="text/javascript">alert("' . get_lang('WarningWhenEditingScorm') . '")</script>'); |
|
7506 | + $form->addElement('html', '<script type="text/javascript">alert("'.get_lang('WarningWhenEditingScorm').'")</script>'); |
|
7507 | 7507 | } |
7508 | 7508 | $renderer = $form->defaultRenderer(); |
7509 | 7509 | $renderer->setElementTemplate('<br /> {label}<br />{element}', 'content_lp'); |
@@ -7526,7 +7526,7 @@ discard block |
||
7526 | 7526 | $defaults['content_lp'] = file_get_contents($content_path); |
7527 | 7527 | } |
7528 | 7528 | |
7529 | - $form->addElement('hidden', 'type', 'dokeos_' . $item_type); |
|
7529 | + $form->addElement('hidden', 'type', 'dokeos_'.$item_type); |
|
7530 | 7530 | $form->addElement('hidden', 'post_time', time()); |
7531 | 7531 | $form->setDefaults($defaults); |
7532 | 7532 | return $form->return_form(); |
@@ -7564,8 +7564,8 @@ discard block |
||
7564 | 7564 | // We don't display the document form if it's not an editable document (html or txt file). |
7565 | 7565 | if ($action == "add") { |
7566 | 7566 | if (is_numeric($extra_info)) { |
7567 | - $sql_doc = "SELECT path FROM " . $tbl_doc . " |
|
7568 | - WHERE c_id = ".$course_id." AND id = " . intval($extra_info); |
|
7567 | + $sql_doc = "SELECT path FROM ".$tbl_doc." |
|
7568 | + WHERE c_id = ".$course_id." AND id = ".intval($extra_info); |
|
7569 | 7569 | $result = Database::query($sql_doc); |
7570 | 7570 | $path_file = Database :: result($result, 0, 0); |
7571 | 7571 | $path_parts = pathinfo($path_file); |
@@ -7583,13 +7583,13 @@ discard block |
||
7583 | 7583 | $item_title = stripslashes($path_parts['filename']); |
7584 | 7584 | } |
7585 | 7585 | } elseif (is_numeric($extra_info)) { |
7586 | - $sql_doc = "SELECT path, title FROM " . $tbl_doc . " |
|
7586 | + $sql_doc = "SELECT path, title FROM ".$tbl_doc." |
|
7587 | 7587 | WHERE |
7588 | 7588 | c_id = ".$course_id." AND |
7589 | 7589 | id = " . intval($extra_info); |
7590 | 7590 | |
7591 | 7591 | $result = Database::query($sql_doc); |
7592 | - $row = Database::fetch_array($result); |
|
7592 | + $row = Database::fetch_array($result); |
|
7593 | 7593 | $item_title = $row['title']; |
7594 | 7594 | $item_title = str_replace('_', ' ', $item_title); |
7595 | 7595 | if (empty ($item_title)) { |
@@ -7608,11 +7608,11 @@ discard block |
||
7608 | 7608 | $parent = 0; |
7609 | 7609 | } |
7610 | 7610 | |
7611 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
7612 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
7611 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
7612 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
7613 | 7613 | |
7614 | 7614 | $result = Database::query($sql); |
7615 | - $arrLP = array (); |
|
7615 | + $arrLP = array(); |
|
7616 | 7616 | while ($row = Database :: fetch_array($result)) { |
7617 | 7617 | $arrLP[] = array( |
7618 | 7618 | 'id' => $row['id'], |
@@ -7646,9 +7646,9 @@ discard block |
||
7646 | 7646 | $return .= '</legend>'; |
7647 | 7647 | |
7648 | 7648 | if (isset ($_GET['edit']) && $_GET['edit'] == 'true') { |
7649 | - $return .= Display :: return_warning_message('<strong>' . get_lang('Warning') . ' !</strong><br />' . get_lang('WarningEditingDocument'), false); |
|
7649 | + $return .= Display :: return_warning_message('<strong>'.get_lang('Warning').' !</strong><br />'.get_lang('WarningEditingDocument'), false); |
|
7650 | 7650 | } |
7651 | - $form = new FormValidator('form', 'POST', api_get_self() . '?' .$_SERVER['QUERY_STRING'], '', array('enctype'=> "multipart/form-data")); |
|
7651 | + $form = new FormValidator('form', 'POST', api_get_self().'?'.$_SERVER['QUERY_STRING'], '', array('enctype'=> "multipart/form-data")); |
|
7652 | 7652 | $defaults['title'] = Security :: remove_XSS($item_title); |
7653 | 7653 | if (empty($item_title)) { |
7654 | 7654 | $defaults['title'] = Security::remove_XSS($item_title); |
@@ -7704,15 +7704,15 @@ discard block |
||
7704 | 7704 | } |
7705 | 7705 | |
7706 | 7706 | $parent_select = $form->addElement('select', 'parent', get_lang('Parent'), '', 'class="form-control" id="idParent" " onchange="javascript: load_cbo(this.value);"'); |
7707 | - $my_count=0; |
|
7707 | + $my_count = 0; |
|
7708 | 7708 | foreach ($arrHide as $key => $value) { |
7709 | - if ($my_count!=0) { |
|
7709 | + if ($my_count != 0) { |
|
7710 | 7710 | // The LP name is also the first section and is not in the same charset like the other sections. |
7711 | 7711 | $value['value'] = Security :: remove_XSS($value['value']); |
7712 | - $parent_select->addOption($value['value'], $key, 'style="padding-left:' . $value['padding'] . 'px;"'); |
|
7712 | + $parent_select->addOption($value['value'], $key, 'style="padding-left:'.$value['padding'].'px;"'); |
|
7713 | 7713 | } else { |
7714 | 7714 | $value['value'] = Security :: remove_XSS($value['value']); |
7715 | - $parent_select->addOption($value['value'], $key, 'style="padding-left:' . $value['padding'] . 'px;"'); |
|
7715 | + $parent_select->addOption($value['value'], $key, 'style="padding-left:'.$value['padding'].'px;"'); |
|
7716 | 7716 | } |
7717 | 7717 | $my_count++; |
7718 | 7718 | } |
@@ -7737,7 +7737,7 @@ discard block |
||
7737 | 7737 | if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) |
7738 | 7738 | $s_selected_position = $arrLP[$i]['id']; |
7739 | 7739 | elseif ($action == 'add') $s_selected_position = $arrLP[$i]['id']; |
7740 | - $arrHide[$arrLP[$i]['id']]['value'] = get_lang('After') . ' "' . $arrLP[$i]['title'] . '"'; |
|
7740 | + $arrHide[$arrLP[$i]['id']]['value'] = get_lang('After').' "'.$arrLP[$i]['title'].'"'; |
|
7741 | 7741 | } |
7742 | 7742 | } |
7743 | 7743 | |
@@ -7745,8 +7745,8 @@ discard block |
||
7745 | 7745 | $position->addOption(get_lang('FirstPosition'), 0); |
7746 | 7746 | |
7747 | 7747 | foreach ($arrHide as $key => $value) { |
7748 | - $padding = isset($value['padding']) ? $value['padding']: 0; |
|
7749 | - $position->addOption($value['value'], $key, 'style="padding-left:' . $padding . 'px;"'); |
|
7748 | + $padding = isset($value['padding']) ? $value['padding'] : 0; |
|
7749 | + $position->addOption($value['value'], $key, 'style="padding-left:'.$padding.'px;"'); |
|
7750 | 7750 | } |
7751 | 7751 | $position->setSelected($s_selected_position); |
7752 | 7752 | |
@@ -7816,7 +7816,7 @@ discard block |
||
7816 | 7816 | $relative_path = array_slice($relative_path, 1, $cnt); |
7817 | 7817 | $relative_path = implode('/', $relative_path); |
7818 | 7818 | if (strlen($relative_path) > 0) { |
7819 | - $relative_path = $relative_path . '/'; |
|
7819 | + $relative_path = $relative_path.'/'; |
|
7820 | 7820 | } |
7821 | 7821 | } else { |
7822 | 7822 | $result = $this->generate_lp_folder($_course); |
@@ -7895,8 +7895,8 @@ discard block |
||
7895 | 7895 | $item_url = stripslashes($extra_info['url']); |
7896 | 7896 | } elseif (is_numeric($extra_info)) { |
7897 | 7897 | $extra_info = intval($extra_info); |
7898 | - $sql = "SELECT title, description, url FROM " . $tbl_link . " |
|
7899 | - WHERE c_id = ".$course_id." AND id = " . $extra_info; |
|
7898 | + $sql = "SELECT title, description, url FROM ".$tbl_link." |
|
7899 | + WHERE c_id = ".$course_id." AND id = ".$extra_info; |
|
7900 | 7900 | $result = Database::query($sql); |
7901 | 7901 | $row = Database :: fetch_array($result); |
7902 | 7902 | $item_title = $row['title']; |
@@ -7916,8 +7916,8 @@ discard block |
||
7916 | 7916 | $parent = 0; |
7917 | 7917 | } |
7918 | 7918 | |
7919 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
7920 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
7919 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
7920 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
7921 | 7921 | $result = Database::query($sql); |
7922 | 7922 | $arrLP = array(); |
7923 | 7923 | |
@@ -7944,10 +7944,10 @@ discard block |
||
7944 | 7944 | unset ($this->arrMenu); |
7945 | 7945 | |
7946 | 7946 | if ($action == 'add') |
7947 | - $legend .= get_lang('CreateTheLink') . ' :'; |
|
7948 | - elseif ($action == 'move') $legend .= get_lang('MoveCurrentLink') . ' :'; |
|
7947 | + $legend .= get_lang('CreateTheLink').' :'; |
|
7948 | + elseif ($action == 'move') $legend .= get_lang('MoveCurrentLink').' :'; |
|
7949 | 7949 | else |
7950 | - $legend .= get_lang('EditCurrentLink') . ' :'; |
|
7950 | + $legend .= get_lang('EditCurrentLink').' :'; |
|
7951 | 7951 | |
7952 | 7952 | $legend .= '</legend>'; |
7953 | 7953 | |
@@ -7958,16 +7958,16 @@ discard block |
||
7958 | 7958 | |
7959 | 7959 | if ($action != 'move') { |
7960 | 7960 | $return .= '<tr>'; |
7961 | - $return .= '<td class="label"><label for="idTitle">' . get_lang('Title') . '</label></td>'; |
|
7962 | - $return .= '<td class="input"><input id="idTitle" name="title" size="44" type="text" value="' . $item_title . '" class="learnpath_item_form"/></td>'; |
|
7961 | + $return .= '<td class="label"><label for="idTitle">'.get_lang('Title').'</label></td>'; |
|
7962 | + $return .= '<td class="input"><input id="idTitle" name="title" size="44" type="text" value="'.$item_title.'" class="learnpath_item_form"/></td>'; |
|
7963 | 7963 | $return .= '</tr>'; |
7964 | 7964 | } |
7965 | 7965 | |
7966 | 7966 | $return .= '<tr>'; |
7967 | - $return .= '<td class="label"><label for="idParent">' . get_lang('Parent') . '</label></td>'; |
|
7967 | + $return .= '<td class="label"><label for="idParent">'.get_lang('Parent').'</label></td>'; |
|
7968 | 7968 | $return .= '<td class="input">'; |
7969 | 7969 | $return .= '<select id="idParent" style="width:100%;" name="parent" onChange="javascript: load_cbo(this.value);" class="learnpath_item_form" size="1">'; |
7970 | - $return .= '<option class="top" value="0">' . $this->name . '</option>'; |
|
7970 | + $return .= '<option class="top" value="0">'.$this->name.'</option>'; |
|
7971 | 7971 | $arrHide = array( |
7972 | 7972 | $id |
7973 | 7973 | ); |
@@ -7977,13 +7977,13 @@ discard block |
||
7977 | 7977 | for ($i = 0; $i < count($arrLP); $i++) { |
7978 | 7978 | if ($action != 'add') { |
7979 | 7979 | 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)) { |
7980 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
7980 | + $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
7981 | 7981 | } else { |
7982 | 7982 | $arrHide[] = $arrLP[$i]['id']; |
7983 | 7983 | } |
7984 | 7984 | } else { |
7985 | 7985 | if ($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir') |
7986 | - $return .= '<option ' . (($parent_item_id == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
7986 | + $return .= '<option '.(($parent_item_id == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
7987 | 7987 | } |
7988 | 7988 | } |
7989 | 7989 | |
@@ -7995,11 +7995,11 @@ discard block |
||
7995 | 7995 | $return .= '</td>'; |
7996 | 7996 | $return .= '</tr>'; |
7997 | 7997 | $return .= '<tr>'; |
7998 | - $return .= '<td class="label"><label for="previous">' . get_lang('Position') . '</label></td>'; |
|
7998 | + $return .= '<td class="label"><label for="previous">'.get_lang('Position').'</label></td>'; |
|
7999 | 7999 | $return .= '<td class="input">'; |
8000 | 8000 | |
8001 | 8001 | $return .= '<select id="previous" name="previous" style="width:100%;" size="1" class="learnpath_item_form">'; |
8002 | - $return .= '<option class="top" value="0">' . get_lang('FirstPosition') . '</option>'; |
|
8002 | + $return .= '<option class="top" value="0">'.get_lang('FirstPosition').'</option>'; |
|
8003 | 8003 | for ($i = 0; $i < count($arrLP); $i++) { |
8004 | 8004 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
8005 | 8005 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
@@ -8009,7 +8009,7 @@ discard block |
||
8009 | 8009 | else |
8010 | 8010 | $selected = ''; |
8011 | 8011 | |
8012 | - $return .= '<option ' . $selected . 'value="' . $arrLP[$i]['id'] . '">' . get_lang('After') . ' "' . $arrLP[$i]['title'] . '"</option>'; |
|
8012 | + $return .= '<option '.$selected.'value="'.$arrLP[$i]['id'].'">'.get_lang('After').' "'.$arrLP[$i]['title'].'"</option>'; |
|
8013 | 8013 | } |
8014 | 8014 | } |
8015 | 8015 | $return .= '</select>'; |
@@ -8018,8 +8018,8 @@ discard block |
||
8018 | 8018 | |
8019 | 8019 | if ($action != 'move') { |
8020 | 8020 | $return .= '<tr>'; |
8021 | - $return .= '<td class="label"><label for="idURL">' . get_lang('Url') . '</label></td>'; |
|
8022 | - $return .= '<td class="input"><input' . (is_numeric($extra_info) ? ' disabled="disabled"' : '') . ' id="idURL" name="url" style="width:99%;" type="text" value="' . $item_url . '" class="learnpath_item_form" /></td>'; |
|
8021 | + $return .= '<td class="label"><label for="idURL">'.get_lang('Url').'</label></td>'; |
|
8022 | + $return .= '<td class="input"><input'.(is_numeric($extra_info) ? ' disabled="disabled"' : '').' id="idURL" name="url" style="width:99%;" type="text" value="'.$item_url.'" class="learnpath_item_form" /></td>'; |
|
8023 | 8023 | $return .= '</tr>'; |
8024 | 8024 | $id_prerequisite = 0; |
8025 | 8025 | if (is_array($arrLP)) { |
@@ -8046,25 +8046,25 @@ discard block |
||
8046 | 8046 | |
8047 | 8047 | $return .= '<tr>'; |
8048 | 8048 | if ($action == 'add') { |
8049 | - $return .= '<td> </td><td><button class="save" name="submit_button" type="submit">' . get_lang('AddLinkToCourse') . '</button></td>'; |
|
8049 | + $return .= '<td> </td><td><button class="save" name="submit_button" type="submit">'.get_lang('AddLinkToCourse').'</button></td>'; |
|
8050 | 8050 | } else { |
8051 | - $return .= '<td> </td><td><button class="save" name="submit_button" type="submit">' . get_lang('EditCurrentLink') . '</button></td>'; |
|
8051 | + $return .= '<td> </td><td><button class="save" name="submit_button" type="submit">'.get_lang('EditCurrentLink').'</button></td>'; |
|
8052 | 8052 | } |
8053 | 8053 | $return .= '</tr>'; |
8054 | 8054 | $return .= '</table>'; |
8055 | 8055 | |
8056 | 8056 | if ($action == 'move') { |
8057 | - $return .= '<input name="title" type="hidden" value="' . $item_title . '" />'; |
|
8058 | - $return .= '<input name="description" type="hidden" value="' . $item_description . '" />'; |
|
8057 | + $return .= '<input name="title" type="hidden" value="'.$item_title.'" />'; |
|
8058 | + $return .= '<input name="description" type="hidden" value="'.$item_description.'" />'; |
|
8059 | 8059 | } |
8060 | 8060 | |
8061 | 8061 | if (is_numeric($extra_info)) { |
8062 | - $return .= '<input name="path" type="hidden" value="' . $extra_info . '" />'; |
|
8062 | + $return .= '<input name="path" type="hidden" value="'.$extra_info.'" />'; |
|
8063 | 8063 | } elseif (is_array($extra_info)) { |
8064 | - $return .= '<input name="path" type="hidden" value="' . $extra_info['path'] . '" />'; |
|
8064 | + $return .= '<input name="path" type="hidden" value="'.$extra_info['path'].'" />'; |
|
8065 | 8065 | } |
8066 | - $return .= '<input name="type" type="hidden" value="' . TOOL_LINK . '" />'; |
|
8067 | - $return .= '<input name="post_time" type="hidden" value="' . time() . '" />'; |
|
8066 | + $return .= '<input name="type" type="hidden" value="'.TOOL_LINK.'" />'; |
|
8067 | + $return .= '<input name="post_time" type="hidden" value="'.time().'" />'; |
|
8068 | 8068 | $return .= '</form>'; |
8069 | 8069 | $return .= '</div>'; |
8070 | 8070 | |
@@ -8090,8 +8090,8 @@ discard block |
||
8090 | 8090 | } elseif (is_numeric($extra_info)) { |
8091 | 8091 | $extra_info = intval($extra_info); |
8092 | 8092 | $sql = "SELECT title, description |
8093 | - FROM " . $tbl_publication . " |
|
8094 | - WHERE c_id = ".$course_id." AND id = " . $extra_info; |
|
8093 | + FROM " . $tbl_publication." |
|
8094 | + WHERE c_id = ".$course_id." AND id = ".$extra_info; |
|
8095 | 8095 | |
8096 | 8096 | $result = Database::query($sql); |
8097 | 8097 | $row = Database :: fetch_array($result); |
@@ -8107,13 +8107,13 @@ discard block |
||
8107 | 8107 | $parent = 0; |
8108 | 8108 | } |
8109 | 8109 | |
8110 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
8111 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
8110 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
8111 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
8112 | 8112 | |
8113 | 8113 | $result = Database::query($sql); |
8114 | 8114 | $arrLP = array(); |
8115 | 8115 | while ($row = Database :: fetch_array($result)) { |
8116 | - $arrLP[] = array ( |
|
8116 | + $arrLP[] = array( |
|
8117 | 8117 | 'id' => $row['id'], |
8118 | 8118 | 'item_type' => $row['item_type'], |
8119 | 8119 | 'title' => $row['title'], |
@@ -8159,7 +8159,7 @@ discard block |
||
8159 | 8159 | ] |
8160 | 8160 | ); |
8161 | 8161 | |
8162 | - $arrHide = array ( |
|
8162 | + $arrHide = array( |
|
8163 | 8163 | $id |
8164 | 8164 | ); |
8165 | 8165 | |
@@ -8177,7 +8177,7 @@ discard block |
||
8177 | 8177 | $parentSelect->addOption( |
8178 | 8178 | $arrLP[$i]['title'], |
8179 | 8179 | $arrLP[$i]['id'], |
8180 | - ['style' => 'padding-left: ' . (($arrLP[$i]['depth'] * 10) + 20) . 'px;'] |
|
8180 | + ['style' => 'padding-left: '.(($arrLP[$i]['depth'] * 10) + 20).'px;'] |
|
8181 | 8181 | ); |
8182 | 8182 | |
8183 | 8183 | if ($parent == $arrLP[$i]['id']) { |
@@ -8194,7 +8194,7 @@ discard block |
||
8194 | 8194 | $parentSelect->addOption( |
8195 | 8195 | $arrLP[$i]['title'], |
8196 | 8196 | $arrLP[$i]['id'], |
8197 | - ['style' => 'padding-left: ' . (($arrLP[$i]['depth'] * 10) + 20) . 'px;'] |
|
8197 | + ['style' => 'padding-left: '.(($arrLP[$i]['depth'] * 10) + 20).'px;'] |
|
8198 | 8198 | ); |
8199 | 8199 | |
8200 | 8200 | if ($parent == $arrLP[$i]['id']) { |
@@ -8218,7 +8218,7 @@ discard block |
||
8218 | 8218 | for ($i = 0; $i < count($arrLP); $i++) { |
8219 | 8219 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
8220 | 8220 | $previousSelect->addOption( |
8221 | - get_lang('After') . ' "' . $arrLP[$i]['title'] . '"', |
|
8221 | + get_lang('After').' "'.$arrLP[$i]['title'].'"', |
|
8222 | 8222 | $arrLP[$i]['id'] |
8223 | 8223 | ); |
8224 | 8224 | |
@@ -8240,7 +8240,7 @@ discard block |
||
8240 | 8240 | } |
8241 | 8241 | } |
8242 | 8242 | } |
8243 | - $arrHide = array (); |
|
8243 | + $arrHide = array(); |
|
8244 | 8244 | for ($i = 0; $i < count($arrLP); $i++) { |
8245 | 8245 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dokeos_chapter') { |
8246 | 8246 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
@@ -8332,8 +8332,8 @@ discard block |
||
8332 | 8332 | |
8333 | 8333 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
8334 | 8334 | $item_id = intval($item_id); |
8335 | - $sql = "SELECT * FROM " . $tbl_lp_item . " as lp |
|
8336 | - WHERE lp.c_id = ".$course_id." AND lp.id = " . $item_id; |
|
8335 | + $sql = "SELECT * FROM ".$tbl_lp_item." as lp |
|
8336 | + WHERE lp.c_id = ".$course_id." AND lp.id = ".$item_id; |
|
8337 | 8337 | $result = Database::query($sql); |
8338 | 8338 | $row = Database::fetch_assoc($result); |
8339 | 8339 | |
@@ -8347,16 +8347,16 @@ discard block |
||
8347 | 8347 | $audio_player .= '<script> |
8348 | 8348 | var s1 = new SWFObject("../inc/lib/mediaplayer/player.swf","ply","250","20","9","#FFFFFF"); |
8349 | 8349 | s1.addParam("allowscriptaccess","always"); |
8350 | - s1.addParam("flashvars","file=../../courses/' . $_course['path'] . '/document/audio/' . $row['audio'] . '&autostart=true"); |
|
8350 | + s1.addParam("flashvars","file=../../courses/' . $_course['path'].'/document/audio/'.$row['audio'].'&autostart=true"); |
|
8351 | 8351 | s1.write("container"); |
8352 | 8352 | </script>'; |
8353 | 8353 | } |
8354 | 8354 | |
8355 | - $url = api_get_self().'?cidReq='.Security::remove_XSS($_GET['cidReq']).'&view=build&id='.$item_id .'&lp_id='.$this->lp_id; |
|
8355 | + $url = api_get_self().'?cidReq='.Security::remove_XSS($_GET['cidReq']).'&view=build&id='.$item_id.'&lp_id='.$this->lp_id; |
|
8356 | 8356 | |
8357 | 8357 | $return .= Display::url( |
8358 | 8358 | Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL), |
8359 | - $url.'&action=edit_item&path_item=' . $row['path'] |
|
8359 | + $url.'&action=edit_item&path_item='.$row['path'] |
|
8360 | 8360 | ); |
8361 | 8361 | |
8362 | 8362 | $return .= Display::url( |
@@ -8376,12 +8376,12 @@ discard block |
||
8376 | 8376 | $url.'&action=delete_item' |
8377 | 8377 | ); |
8378 | 8378 | |
8379 | - if ($item_type == TOOL_HOTPOTATOES ) { |
|
8379 | + if ($item_type == TOOL_HOTPOTATOES) { |
|
8380 | 8380 | $document_data = DocumentManager::get_document_data_by_id($row['path'], $course_code); |
8381 | 8381 | $return .= get_lang('File').': '.$document_data['absolute_path_from_document']; |
8382 | 8382 | } |
8383 | 8383 | |
8384 | - if ($item_type == TOOL_DOCUMENT ) { |
|
8384 | + if ($item_type == TOOL_DOCUMENT) { |
|
8385 | 8385 | $document_data = DocumentManager::get_document_data_by_id($row['path'], $course_code); |
8386 | 8386 | $return .= get_lang('File').': '.$document_data['absolute_path_from_document']; |
8387 | 8387 | } |
@@ -8402,13 +8402,13 @@ discard block |
||
8402 | 8402 | public function get_js_dropdown_array() |
8403 | 8403 | { |
8404 | 8404 | $course_id = api_get_course_int_id(); |
8405 | - $return = 'var child_name = new Array();' . "\n"; |
|
8406 | - $return .= 'var child_value = new Array();' . "\n\n"; |
|
8407 | - $return .= 'child_name[0] = new Array();' . "\n"; |
|
8408 | - $return .= 'child_value[0] = new Array();' . "\n\n"; |
|
8405 | + $return = 'var child_name = new Array();'."\n"; |
|
8406 | + $return .= 'var child_value = new Array();'."\n\n"; |
|
8407 | + $return .= 'child_name[0] = new Array();'."\n"; |
|
8408 | + $return .= 'child_value[0] = new Array();'."\n\n"; |
|
8409 | 8409 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
8410 | - $sql_zero = "SELECT * FROM " . $tbl_lp_item . " |
|
8411 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id . " AND parent_item_id = 0 |
|
8410 | + $sql_zero = "SELECT * FROM ".$tbl_lp_item." |
|
8411 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id." AND parent_item_id = 0 |
|
8412 | 8412 | ORDER BY display_order ASC"; |
8413 | 8413 | $res_zero = Database::query($sql_zero); |
8414 | 8414 | $i = 0; |
@@ -8418,28 +8418,28 @@ discard block |
||
8418 | 8418 | $row_zero['title'] = Exercise::get_formated_title_variable($row_zero['title']); |
8419 | 8419 | } |
8420 | 8420 | $js_var = json_encode(get_lang('After').' '.$row_zero['title']); |
8421 | - $return .= 'child_name[0][' . $i . '] = '.$js_var.' ;' . "\n"; |
|
8422 | - $return .= 'child_value[0][' . $i++ . '] = "' . $row_zero['id'] . '";' . "\n"; |
|
8421 | + $return .= 'child_name[0]['.$i.'] = '.$js_var.' ;'."\n"; |
|
8422 | + $return .= 'child_value[0]['.$i++.'] = "'.$row_zero['id'].'";'."\n"; |
|
8423 | 8423 | } |
8424 | 8424 | $return .= "\n"; |
8425 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
8426 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
8425 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
8426 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
8427 | 8427 | $res = Database::query($sql); |
8428 | 8428 | while ($row = Database :: fetch_array($res)) { |
8429 | - $sql_parent = "SELECT * FROM " . $tbl_lp_item . " |
|
8429 | + $sql_parent = "SELECT * FROM ".$tbl_lp_item." |
|
8430 | 8430 | WHERE |
8431 | 8431 | c_id = ".$course_id." AND |
8432 | - parent_item_id = " . $row['id'] . " |
|
8432 | + parent_item_id = " . $row['id']." |
|
8433 | 8433 | ORDER BY display_order ASC"; |
8434 | 8434 | $res_parent = Database::query($sql_parent); |
8435 | 8435 | $i = 0; |
8436 | - $return .= 'child_name[' . $row['id'] . '] = new Array();' . "\n"; |
|
8437 | - $return .= 'child_value[' . $row['id'] . '] = new Array();' . "\n\n"; |
|
8436 | + $return .= 'child_name['.$row['id'].'] = new Array();'."\n"; |
|
8437 | + $return .= 'child_value['.$row['id'].'] = new Array();'."\n\n"; |
|
8438 | 8438 | |
8439 | 8439 | while ($row_parent = Database :: fetch_array($res_parent)) { |
8440 | 8440 | $js_var = json_encode(get_lang('After').' '.$row_parent['title']); |
8441 | - $return .= 'child_name[' . $row['id'] . '][' . $i . '] = '.$js_var.' ;' . "\n"; |
|
8442 | - $return .= 'child_value[' . $row['id'] . '][' . $i++ . '] = "' . $row_parent['id'] . '";' . "\n"; |
|
8441 | + $return .= 'child_name['.$row['id'].']['.$i.'] = '.$js_var.' ;'."\n"; |
|
8442 | + $return .= 'child_value['.$row['id'].']['.$i++.'] = "'.$row_parent['id'].'";'."\n"; |
|
8443 | 8443 | } |
8444 | 8444 | $return .= "\n"; |
8445 | 8445 | } |
@@ -8460,8 +8460,8 @@ discard block |
||
8460 | 8460 | if (is_numeric($item_id)) { |
8461 | 8461 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
8462 | 8462 | |
8463 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
8464 | - WHERE c_id = ".$course_id." AND id = " . $item_id; |
|
8463 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
8464 | + WHERE c_id = ".$course_id." AND id = ".$item_id; |
|
8465 | 8465 | |
8466 | 8466 | $res = Database::query($sql); |
8467 | 8467 | $row = Database :: fetch_array($res); |
@@ -8520,7 +8520,7 @@ discard block |
||
8520 | 8520 | */ |
8521 | 8521 | public function display_item_small_form($item_type, $title = '', $data = array()) |
8522 | 8522 | { |
8523 | - $url = api_get_self() . '?' .api_get_cidreq().'&action=edit_item&lp_id='.$this->lp_id; |
|
8523 | + $url = api_get_self().'?'.api_get_cidreq().'&action=edit_item&lp_id='.$this->lp_id; |
|
8524 | 8524 | $form = new FormValidator('small_form', 'post', $url); |
8525 | 8525 | $form->addElement('header', $title); |
8526 | 8526 | $form->addElement('text', 'title', get_lang('Title')); |
@@ -8546,7 +8546,7 @@ discard block |
||
8546 | 8546 | $item_id = intval($item_id); |
8547 | 8547 | /* Current prerequisite */ |
8548 | 8548 | $sql = "SELECT * FROM $tbl_lp_item |
8549 | - WHERE c_id = $course_id AND id = " . $item_id; |
|
8549 | + WHERE c_id = $course_id AND id = ".$item_id; |
|
8550 | 8550 | $result = Database::query($sql); |
8551 | 8551 | $row = Database::fetch_array($result); |
8552 | 8552 | $prerequisiteId = $row['prerequisite']; |
@@ -8556,20 +8556,20 @@ discard block |
||
8556 | 8556 | $return .= '<form method="POST">'; |
8557 | 8557 | $return .= '<table class="data_table">'; |
8558 | 8558 | $return .= '<tr>'; |
8559 | - $return .= '<th height="24">' . get_lang('LearnpathPrerequisites') . '</th>'; |
|
8560 | - $return .= '<th width="70" >' . get_lang('Minimum') . '</th>'; |
|
8561 | - $return .= '<th width="70">' . get_lang('Maximum') . '</th>'; |
|
8559 | + $return .= '<th height="24">'.get_lang('LearnpathPrerequisites').'</th>'; |
|
8560 | + $return .= '<th width="70" >'.get_lang('Minimum').'</th>'; |
|
8561 | + $return .= '<th width="70">'.get_lang('Maximum').'</th>'; |
|
8562 | 8562 | $return .= '</tr>'; |
8563 | 8563 | |
8564 | 8564 | // Adding the none option to the prerequisites see http://www.chamilo.org/es/node/146 |
8565 | 8565 | $return .= '<tr >'; |
8566 | 8566 | $return .= '<td colspan="3" class="radio">'; |
8567 | 8567 | $return .= '<input checked="checked" id="idNone" name="prerequisites" style="margin-left:0px; margin-right:10px;" type="radio" />'; |
8568 | - $return .= '<label for="idNone">' . get_lang('None') . '</label>'; |
|
8568 | + $return .= '<label for="idNone">'.get_lang('None').'</label>'; |
|
8569 | 8569 | $return .= '</tr>'; |
8570 | 8570 | |
8571 | 8571 | $sql = "SELECT * FROM $tbl_lp_item |
8572 | - WHERE c_id = $course_id AND lp_id = " . $this->lp_id; |
|
8572 | + WHERE c_id = $course_id AND lp_id = ".$this->lp_id; |
|
8573 | 8573 | $result = Database::query($sql); |
8574 | 8574 | $arrLP = array(); |
8575 | 8575 | |
@@ -8612,25 +8612,25 @@ discard block |
||
8612 | 8612 | } |
8613 | 8613 | |
8614 | 8614 | $selectedMaxScoreValue = isset($selectedMaxScore[$item['id']]) ? $selectedMaxScore[$item['id']] : $item['max_score']; |
8615 | - $selectedMinScoreValue = isset($selectedMinScore[$item['id']]) ? $selectedMinScore[$item['id']]: 0; |
|
8615 | + $selectedMinScoreValue = isset($selectedMinScore[$item['id']]) ? $selectedMinScore[$item['id']] : 0; |
|
8616 | 8616 | |
8617 | 8617 | $return .= '<tr>'; |
8618 | - $return .= '<td class="radio"' . (($item['item_type'] != TOOL_QUIZ && $item['item_type'] != TOOL_HOTPOTATOES) ? ' colspan="3"' : '') . '>'; |
|
8619 | - $return .= '<label for="id' . $item['id'] . '">'; |
|
8620 | - $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'] . '" />'; |
|
8618 | + $return .= '<td class="radio"'.(($item['item_type'] != TOOL_QUIZ && $item['item_type'] != TOOL_HOTPOTATOES) ? ' colspan="3"' : '').'>'; |
|
8619 | + $return .= '<label for="id'.$item['id'].'">'; |
|
8620 | + $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'].'" />'; |
|
8621 | 8621 | $icon_name = str_replace(' ', '', $item['item_type']); |
8622 | 8622 | |
8623 | - if (file_exists('../img/lp_' . $icon_name . '.png')) { |
|
8624 | - $return .= Display::return_icon('lp_' . $icon_name . '.png'); |
|
8623 | + if (file_exists('../img/lp_'.$icon_name.'.png')) { |
|
8624 | + $return .= Display::return_icon('lp_'.$icon_name.'.png'); |
|
8625 | 8625 | } else { |
8626 | - if (file_exists('../img/lp_' . $icon_name . '.gif')) { |
|
8627 | - $return .= Display::return_icon('lp_' . $icon_name . '.gif'); |
|
8626 | + if (file_exists('../img/lp_'.$icon_name.'.gif')) { |
|
8627 | + $return .= Display::return_icon('lp_'.$icon_name.'.gif'); |
|
8628 | 8628 | } else { |
8629 | - $return .= Display::return_icon('folder_document.gif','',array('style'=>'margin-right:5px;')); |
|
8629 | + $return .= Display::return_icon('folder_document.gif', '', array('style'=>'margin-right:5px;')); |
|
8630 | 8630 | } |
8631 | 8631 | } |
8632 | 8632 | |
8633 | - $return .= $item['title'] . '</label>'; |
|
8633 | + $return .= $item['title'].'</label>'; |
|
8634 | 8634 | $return .= '</td>'; |
8635 | 8635 | |
8636 | 8636 | if ($item['item_type'] == TOOL_QUIZ) { |
@@ -8644,19 +8644,19 @@ discard block |
||
8644 | 8644 | $item['max_score'] = $tmp_obj_lp_item->max_score; |
8645 | 8645 | |
8646 | 8646 | $return .= '<td class="exercise">'; |
8647 | - $return .= '<input size="4" maxlength="3" name="min_' . $item['id'] . '" type="number" min="0" step="any" max="'.$item['max_score'].'" value="' . $selectedMinScoreValue. '" />'; |
|
8647 | + $return .= '<input size="4" maxlength="3" name="min_'.$item['id'].'" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMinScoreValue.'" />'; |
|
8648 | 8648 | $return .= '</td>'; |
8649 | 8649 | $return .= '<td class="exercise">'; |
8650 | - $return .= '<input size="4" maxlength="3" name="max_' . $item['id'] . '" type="number" min="0" step="any" max="'.$item['max_score'].'" value="' . $selectedMaxScoreValue . '" />'; |
|
8650 | + $return .= '<input size="4" maxlength="3" name="max_'.$item['id'].'" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMaxScoreValue.'" />'; |
|
8651 | 8651 | $return .= '</td>'; |
8652 | 8652 | } |
8653 | 8653 | |
8654 | 8654 | if ($item['item_type'] == TOOL_HOTPOTATOES) { |
8655 | 8655 | $return .= '<td class="exercise">'; |
8656 | - $return .= '<center><input size="4" maxlength="3" name="min_' . $item['id'] . '" type="number" min="0" step="any" max="'.$item['max_score'].'" value="' . $selectedMinScoreValue . '" /></center>'; |
|
8656 | + $return .= '<center><input size="4" maxlength="3" name="min_'.$item['id'].'" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMinScoreValue.'" /></center>'; |
|
8657 | 8657 | $return .= '</td>'; |
8658 | 8658 | $return .= '<td class="exercise"">'; |
8659 | - $return .= '<center><input size="4" maxlength="3" name="max_' . $item['id'] . '" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMaxScoreValue . '" /></center>'; |
|
8659 | + $return .= '<center><input size="4" maxlength="3" name="max_'.$item['id'].'" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMaxScoreValue.'" /></center>'; |
|
8660 | 8660 | $return .= '</td>'; |
8661 | 8661 | } |
8662 | 8662 | $return .= '</tr>'; |
@@ -8665,7 +8665,7 @@ discard block |
||
8665 | 8665 | $return .= '</tr>'; |
8666 | 8666 | $return .= '</table>'; |
8667 | 8667 | $return .= '<div style="padding-top:3px;">'; |
8668 | - $return .= '<button class="btn btn-primary" name="submit_button" type="submit">' . get_lang('ModifyPrerequisites') . '</button>'; |
|
8668 | + $return .= '<button class="btn btn-primary" name="submit_button" type="submit">'.get_lang('ModifyPrerequisites').'</button>'; |
|
8669 | 8669 | $return .= '</form>'; |
8670 | 8670 | |
8671 | 8671 | return $return; |
@@ -8701,7 +8701,7 @@ discard block |
||
8701 | 8701 | if ($row['id'] == $lp_id) { |
8702 | 8702 | continue; |
8703 | 8703 | } |
8704 | - $return .= '<option value="'.$row['id'].'" '.(($row['id']==$prerequisiteId)?' selected ' : '').'>'.$row['name'].'</option>'; |
|
8704 | + $return .= '<option value="'.$row['id'].'" '.(($row['id'] == $prerequisiteId) ? ' selected ' : '').'>'.$row['name'].'</option>'; |
|
8705 | 8705 | } |
8706 | 8706 | } |
8707 | 8707 | $return .= '</select>'; |
@@ -8809,8 +8809,8 @@ discard block |
||
8809 | 8809 | WHERE c_id = $course_id AND $activeCondition $condition_session |
8810 | 8810 | ORDER BY title ASC"; |
8811 | 8811 | |
8812 | - $sql_hot = "SELECT * FROM $tbl_doc |
|
8813 | - WHERE c_id = $course_id AND path LIKE '" . $uploadPath . "/%/%htm%' $condition_session |
|
8812 | + $sql_hot = "SELECT * FROM $tbl_doc |
|
8813 | + WHERE c_id = $course_id AND path LIKE '".$uploadPath."/%/%htm%' $condition_session |
|
8814 | 8814 | ORDER BY id ASC"; |
8815 | 8815 | |
8816 | 8816 | $res_quiz = Database::query($sql_quiz); |
@@ -8820,8 +8820,8 @@ discard block |
||
8820 | 8820 | |
8821 | 8821 | $return .= '<li class="lp_resource_element">'; |
8822 | 8822 | $return .= Display::return_icon('new_test_small.gif'); |
8823 | - $return .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'exercice/exercise_admin.php?'.api_get_cidreq().'&lp_id=' . $this->lp_id . '">' . |
|
8824 | - get_lang('NewExercise') . '</a>'; |
|
8823 | + $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercice/exercise_admin.php?'.api_get_cidreq().'&lp_id='.$this->lp_id.'">'. |
|
8824 | + get_lang('NewExercise').'</a>'; |
|
8825 | 8825 | $return .= '</li>'; |
8826 | 8826 | |
8827 | 8827 | // Display hotpotatoes |
@@ -8833,8 +8833,8 @@ discard block |
||
8833 | 8833 | $return .= '</a> '; |
8834 | 8834 | |
8835 | 8835 | $return .= Display::return_icon('hotpotatoes_s.png'); |
8836 | - $return .= '<a href="' . api_get_self() . '?' . api_get_cidreq().'&action=add_item&type=' . TOOL_HOTPOTATOES . '&file=' . $row_hot['id'] . '&lp_id=' . $this->lp_id . '">'. |
|
8837 | - ((!empty ($row_hot['comment'])) ? $row_hot['comment'] : Security :: remove_XSS($row_hot['title'])) . '</a>'; |
|
8836 | + $return .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_HOTPOTATOES.'&file='.$row_hot['id'].'&lp_id='.$this->lp_id.'">'. |
|
8837 | + ((!empty ($row_hot['comment'])) ? $row_hot['comment'] : Security :: remove_XSS($row_hot['title'])).'</a>'; |
|
8838 | 8838 | $return .= '</li>'; |
8839 | 8839 | } |
8840 | 8840 | |
@@ -8849,7 +8849,7 @@ discard block |
||
8849 | 8849 | array(), |
8850 | 8850 | ICON_SIZE_TINY |
8851 | 8851 | ); |
8852 | - $return .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&action=add_item&type=' . TOOL_QUIZ . '&file=' . $row_quiz['id'] . '&lp_id=' . $this->lp_id . '">' . |
|
8852 | + $return .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_QUIZ.'&file='.$row_quiz['id'].'&lp_id='.$this->lp_id.'">'. |
|
8853 | 8853 | Security :: remove_XSS(cut($row_quiz['title'], 80)). |
8854 | 8854 | '</a>'; |
8855 | 8855 | $return .= '</li>'; |
@@ -8931,7 +8931,7 @@ discard block |
||
8931 | 8931 | ['target' => '_blank'] |
8932 | 8932 | ); |
8933 | 8933 | |
8934 | - if (api_get_item_visibility($course, TOOL_LINK, $key, $session_id) != 2) { |
|
8934 | + if (api_get_item_visibility($course, TOOL_LINK, $key, $session_id) != 2) { |
|
8935 | 8935 | $linkNodes .= |
8936 | 8936 | '<li class="lp_resource_element" data_id="'.$key. |
8937 | 8937 | '" data_type="'.TOOL_LINK.'" title="'.$title.'" > |
@@ -8975,8 +8975,8 @@ discard block |
||
8975 | 8975 | $return = '<ul class="lp_resource" >'; |
8976 | 8976 | $return .= '<li class="lp_resource_element">'; |
8977 | 8977 | $return .= Display::return_icon('works_new.gif'); |
8978 | - $return .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=add_item&type=' . TOOL_STUDENTPUBLICATION . '&lp_id=' . $this->lp_id . '">' . |
|
8979 | - get_lang('AddAssignmentPage') . '</a>'; |
|
8978 | + $return .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_STUDENTPUBLICATION.'&lp_id='.$this->lp_id.'">'. |
|
8979 | + get_lang('AddAssignmentPage').'</a>'; |
|
8980 | 8980 | $return .= '</li>'; |
8981 | 8981 | $sessionId = api_get_session_id(); |
8982 | 8982 | |
@@ -8998,7 +8998,7 @@ discard block |
||
8998 | 8998 | $return .= '</a> '; |
8999 | 8999 | |
9000 | 9000 | $return .= Display::return_icon('works.gif'); |
9001 | - $return .= ' <a class="moved" href="' . api_get_self() . '?'.api_get_cidreq().'&action=add_item&type=' . TOOL_STUDENTPUBLICATION . '&file=' . $work['iid'] . '&lp_id=' . $this->lp_id . '">' . |
|
9001 | + $return .= ' <a class="moved" href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_STUDENTPUBLICATION.'&file='.$work['iid'].'&lp_id='.$this->lp_id.'">'. |
|
9002 | 9002 | Security :: remove_XSS(cut(strip_tags($work['title']), 80)).' '.$link.' |
9003 | 9003 | </a>'; |
9004 | 9004 | |
@@ -9035,7 +9035,7 @@ discard block |
||
9035 | 9035 | ); |
9036 | 9036 | $return .= Display::url( |
9037 | 9037 | get_lang('CreateANewForum'), |
9038 | - api_get_path(REL_CODE_PATH) . 'forum/index.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
9038 | + api_get_path(REL_CODE_PATH).'forum/index.php?'.api_get_cidreq().'&'.http_build_query([ |
|
9039 | 9039 | 'action' => 'add', |
9040 | 9040 | 'content' => 'forum', |
9041 | 9041 | 'lp_id' => $this->lp_id |
@@ -9071,15 +9071,15 @@ discard block |
||
9071 | 9071 | $return .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY); |
9072 | 9072 | $return .= ' </a>'; |
9073 | 9073 | $return .= Display::return_icon('lp_forum.png', '', array(), ICON_SIZE_TINY); |
9074 | - $return .= '<a style="cursor:hand" onclick="javascript: toggle_forum(' . $forum['forum_id'] . ')" style="vertical-align:middle"> |
|
9075 | - <img src="' . Display::returnIconPath('add.gif').'" id="forum_' . $forum['forum_id'] . '_opener" align="absbottom" /> |
|
9074 | + $return .= '<a style="cursor:hand" onclick="javascript: toggle_forum('.$forum['forum_id'].')" style="vertical-align:middle"> |
|
9075 | + <img src="' . Display::returnIconPath('add.gif').'" id="forum_'.$forum['forum_id'].'_opener" align="absbottom" /> |
|
9076 | 9076 | </a> |
9077 | - <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">' . |
|
9078 | - Security :: remove_XSS($forum['forum_title']) . '</a>'; |
|
9077 | + <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">'. |
|
9078 | + Security :: remove_XSS($forum['forum_title']).'</a>'; |
|
9079 | 9079 | |
9080 | 9080 | $return .= '</li>'; |
9081 | 9081 | |
9082 | - $return .= '<div style="display:none" id="forum_' . $forum['forum_id'] . '_content">'; |
|
9082 | + $return .= '<div style="display:none" id="forum_'.$forum['forum_id'].'_content">'; |
|
9083 | 9083 | $a_threads = get_threads($forum['forum_id']); |
9084 | 9084 | if (is_array($a_threads)) { |
9085 | 9085 | foreach ($a_threads as $thread) { |
@@ -9095,8 +9095,8 @@ discard block |
||
9095 | 9095 | $return .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY); |
9096 | 9096 | $return .= ' </a>'; |
9097 | 9097 | $return .= Display::return_icon('forumthread.png', get_lang('Thread'), array(), ICON_SIZE_TINY); |
9098 | - $return .= '<a class="moved" href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type=' . TOOL_THREAD . '&thread_id=' . $thread['thread_id'] . '&lp_id=' . $this->lp_id . '">' . |
|
9099 | - Security :: remove_XSS($thread['thread_title']) . ' '.$link.'</a>'; |
|
9098 | + $return .= '<a class="moved" href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_THREAD.'&thread_id='.$thread['thread_id'].'&lp_id='.$this->lp_id.'">'. |
|
9099 | + Security :: remove_XSS($thread['thread_title']).' '.$link.'</a>'; |
|
9100 | 9100 | $return .= '</li>'; |
9101 | 9101 | } |
9102 | 9102 | } |
@@ -9167,7 +9167,7 @@ discard block |
||
9167 | 9167 | if (is_dir($current_course_path.'/scorm/'.$this->path) && is_file($current_course_path.'/scorm/'.$this->path.'/imsmanifest.xml')) { |
9168 | 9168 | // Remove the possible . at the end of the path. |
9169 | 9169 | $dest_path_to_lp = substr($this->path, -1) == '.' ? substr($this->path, 0, -1) : $this->path; |
9170 | - $dest_path_to_scorm_folder = str_replace('//','/',$temp_zip_dir.'/scorm/'.$dest_path_to_lp); |
|
9170 | + $dest_path_to_scorm_folder = str_replace('//', '/', $temp_zip_dir.'/scorm/'.$dest_path_to_lp); |
|
9171 | 9171 | mkdir($dest_path_to_scorm_folder, api_get_permissions_for_new_directories(), true); |
9172 | 9172 | $zip_files_dist = copyr($current_course_path.'/scorm/'.$this->path, $dest_path_to_scorm_folder, array('imsmanifest'), $zip_files); |
9173 | 9173 | } |
@@ -9235,7 +9235,7 @@ discard block |
||
9235 | 9235 | if ($item->type == 'sco') { |
9236 | 9236 | $inc_docs = $item->get_resources_from_source( |
9237 | 9237 | null, |
9238 | - api_get_path(SYS_COURSE_PATH) . api_get_course_path() . '/' . 'scorm/' . $this->path . '/' . $item->get_path() |
|
9238 | + api_get_path(SYS_COURSE_PATH).api_get_course_path().'/'.'scorm/'.$this->path.'/'.$item->get_path() |
|
9239 | 9239 | ); |
9240 | 9240 | } else { |
9241 | 9241 | $inc_docs = $item->get_resources_from_source(); |
@@ -9451,7 +9451,7 @@ discard block |
||
9451 | 9451 | $file_path = substr($file_path, strlen($current_dir)); // We get the relative path. |
9452 | 9452 | $zip_files[] = $my_sub_dir.'/'.$file_path; |
9453 | 9453 | $link_updates[$my_file_path][] = array('orig' => $doc_info[0], 'dest' => $file_path); |
9454 | - $my_dep_file->setAttribute('href','document/'.$file_path); |
|
9454 | + $my_dep_file->setAttribute('href', 'document/'.$file_path); |
|
9455 | 9455 | $my_dep->setAttribute('xml:base', ''); |
9456 | 9456 | } |
9457 | 9457 | } |
@@ -9582,7 +9582,7 @@ discard block |
||
9582 | 9582 | //$my_item->appendChild($my_max_score); |
9583 | 9583 | // Give a child element <adlcp:prerequisites> to the <item> element. |
9584 | 9584 | $my_prereqs = $xmldoc->createElement('adlcp:prerequisites', $item->get_prereq_string()); |
9585 | - $my_prereqs->setAttribute('type','aicc_script'); |
|
9585 | + $my_prereqs->setAttribute('type', 'aicc_script'); |
|
9586 | 9586 | $my_item->appendChild($my_prereqs); |
9587 | 9587 | // Give a child element <adlcp:masteryscore> to the <item> element. |
9588 | 9588 | $my_masteryscore = $xmldoc->createElement('adlcp:masteryscore', $item->get_mastery_score()); |
@@ -9635,7 +9635,7 @@ discard block |
||
9635 | 9635 | $my_resource->appendChild($my_file); |
9636 | 9636 | |
9637 | 9637 | // Get included docs. |
9638 | - $inc_docs = $item->get_resources_from_source(null,$tmp_file_path); |
|
9638 | + $inc_docs = $item->get_resources_from_source(null, $tmp_file_path); |
|
9639 | 9639 | // Dependency to other files - not yet supported. |
9640 | 9640 | $i = 1; |
9641 | 9641 | foreach ($inc_docs as $doc_info) { |
@@ -9696,7 +9696,7 @@ discard block |
||
9696 | 9696 | $my_dep_file->setAttribute('href', $file_path); |
9697 | 9697 | $my_dep->setAttribute('xml:base', ''); |
9698 | 9698 | |
9699 | - if (strstr($file_path,$main_path) !== false) { |
|
9699 | + if (strstr($file_path, $main_path) !== false) { |
|
9700 | 9700 | // The calculated real path is really inside the chamilo root path. |
9701 | 9701 | // Reduce file path to what's under the DocumentRoot. |
9702 | 9702 | $file_path = substr($file_path, strlen($root_path)); |
@@ -9714,7 +9714,7 @@ discard block |
||
9714 | 9714 | $file_path = $_SERVER['DOCUMENT_ROOT'].$doc_info[0]; |
9715 | 9715 | $file_path = str_replace('//', '/', $file_path); |
9716 | 9716 | if (file_exists($file_path)) { |
9717 | - $file_path = substr($file_path,strlen($current_dir)); // We get the relative path. |
|
9717 | + $file_path = substr($file_path, strlen($current_dir)); // We get the relative path. |
|
9718 | 9718 | $zip_files[] = $my_sub_dir.'/'.$file_path; |
9719 | 9719 | $link_updates[$my_file_path][] = array('orig' => $doc_info[0], 'dest' => $file_path); |
9720 | 9720 | $my_dep_file->setAttribute('href', 'document/'.$file_path); |
@@ -9943,7 +9943,7 @@ discard block |
||
9943 | 9943 | if (strpos($extra_file, '.') === 0) |
9944 | 9944 | continue; |
9945 | 9945 | else { |
9946 | - $dest_file = $archive_path . $temp_dir_short . '/' . $extra_file; |
|
9946 | + $dest_file = $archive_path.$temp_dir_short.'/'.$extra_file; |
|
9947 | 9947 | $this->create_path($dest_file); |
9948 | 9948 | copy($main_code_path.$extra_file, $dest_file); |
9949 | 9949 | } |
@@ -9996,7 +9996,7 @@ discard block |
||
9996 | 9996 | } |
9997 | 9997 | $file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$file_data['path']; |
9998 | 9998 | if (file_exists($file_path)) { |
9999 | - $files_to_export[] = array('title'=>$item->get_title(),'path'=>$file_path); |
|
9999 | + $files_to_export[] = array('title'=>$item->get_title(), 'path'=>$file_path); |
|
10000 | 10000 | } |
10001 | 10001 | break; |
10002 | 10002 | case 'asset': //commes from a scorm package generated by chamilo |
@@ -10036,12 +10036,12 @@ discard block |
||
10036 | 10036 | |
10037 | 10037 | foreach ($path_bits as $bit) { |
10038 | 10038 | if (!empty ($bit)) { |
10039 | - $new_path = $path_built . $bit; |
|
10039 | + $new_path = $path_built.$bit; |
|
10040 | 10040 | if (is_dir($new_path)) { |
10041 | - $path_built = $new_path . '/'; |
|
10041 | + $path_built = $new_path.'/'; |
|
10042 | 10042 | } else { |
10043 | 10043 | mkdir($new_path, api_get_permissions_for_new_directories()); |
10044 | - $path_built = $new_path . '/'; |
|
10044 | + $path_built = $new_path.'/'; |
|
10045 | 10045 | } |
10046 | 10046 | } |
10047 | 10047 | } |
@@ -10085,9 +10085,9 @@ discard block |
||
10085 | 10085 | |
10086 | 10086 | if ($upload_ok) { |
10087 | 10087 | if ($has_attachment) { |
10088 | - $courseDir = api_get_course_path() . '/upload/learning_path/images'; |
|
10088 | + $courseDir = api_get_course_path().'/upload/learning_path/images'; |
|
10089 | 10089 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
10090 | - $updir = $sys_course_path . $courseDir; |
|
10090 | + $updir = $sys_course_path.$courseDir; |
|
10091 | 10091 | // Try to add an extension to the file if it hasn't one. |
10092 | 10092 | $new_file_name = add_ext_on_mime(stripslashes($image_array['name']), $image_array['type']); |
10093 | 10093 | |
@@ -10142,7 +10142,7 @@ discard block |
||
10142 | 10142 | //Setting my lp_id to autolaunch = 1 |
10143 | 10143 | $attributes['autolaunch'] = 1; |
10144 | 10144 | $where = array('id = ? AND session_id = ? AND c_id = ?'=> array($lp_id, api_get_session_id(), $course_id)); |
10145 | - Database::update($lp_table, $attributes, $where ); |
|
10145 | + Database::update($lp_table, $attributes, $where); |
|
10146 | 10146 | } |
10147 | 10147 | } |
10148 | 10148 | |
@@ -10161,13 +10161,13 @@ discard block |
||
10161 | 10161 | |
10162 | 10162 | // Get the max order of the items |
10163 | 10163 | $sql_max_order = "SELECT max(display_order) AS display_order FROM $table_lp_item |
10164 | - WHERE c_id = $course_id AND lp_id = '" . $this->lp_id . "'"; |
|
10164 | + WHERE c_id = $course_id AND lp_id = '".$this->lp_id."'"; |
|
10165 | 10165 | $rs_max_order = Database::query($sql_max_order); |
10166 | 10166 | $row_max_order = Database::fetch_object($rs_max_order); |
10167 | 10167 | $max_order = $row_max_order->display_order; |
10168 | 10168 | // Get the previous item ID |
10169 | 10169 | $sql = "SELECT id as previous FROM $table_lp_item |
10170 | - WHERE c_id = $course_id AND lp_id = '" . $this->lp_id . "' AND display_order = '".$max_order."' "; |
|
10170 | + WHERE c_id = $course_id AND lp_id = '".$this->lp_id."' AND display_order = '".$max_order."' "; |
|
10171 | 10171 | $rs_max = Database::query($sql); |
10172 | 10172 | $row_max = Database::fetch_object($rs_max); |
10173 | 10173 | |
@@ -10223,9 +10223,9 @@ discard block |
||
10223 | 10223 | $documents_total_space = DocumentManager::documents_total_space(); |
10224 | 10224 | $course_max_space = DocumentManager::get_course_quota(); |
10225 | 10225 | $total_size = filesize($s) + $documents_total_space; |
10226 | - if (filesize($s)>$post_max || filesize($s)>$upl_max || $total_size>$course_max_space ){ |
|
10226 | + if (filesize($s) > $post_max || filesize($s) > $upl_max || $total_size > $course_max_space) { |
|
10227 | 10227 | return true; |
10228 | - } else{ |
|
10228 | + } else { |
|
10229 | 10229 | return false; |
10230 | 10230 | } |
10231 | 10231 | } |
@@ -10565,7 +10565,7 @@ discard block |
||
10565 | 10565 | if ($this->debug > 0) { |
10566 | 10566 | error_log('New LP - In learnpath::set_subscribe_users()', 0); |
10567 | 10567 | } |
10568 | - $this->subscribeUsers = intval($value);; |
|
10568 | + $this->subscribeUsers = intval($value); ; |
|
10569 | 10569 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
10570 | 10570 | $lp_id = $this->get_id(); |
10571 | 10571 | $sql = "UPDATE $lp_table SET subscribe_users = ".$this->subscribeUsers." |
@@ -10997,8 +10997,8 @@ discard block |
||
10997 | 10997 | if (!empty($id)) { |
10998 | 10998 | $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
10999 | 10999 | $sql = "SELECT * FROM $TBL_EXERCICES WHERE c_id = $course_id AND id=$id"; |
11000 | - $result= Database::query($sql); |
|
11001 | - $myrow=Database::fetch_array($result); |
|
11000 | + $result = Database::query($sql); |
|
11001 | + $myrow = Database::fetch_array($result); |
|
11002 | 11002 | if ($row_item['title'] != '') { |
11003 | 11003 | $myrow['title'] = $row_item['title']; |
11004 | 11004 | } |
@@ -11010,8 +11010,8 @@ discard block |
||
11010 | 11010 | $result = Database::query("SELECT * FROM ".$TBL_DOCUMENT." WHERE c_id = $course_id AND id=$id"); |
11011 | 11011 | $myrow = Database::fetch_array($result); |
11012 | 11012 | $path = $myrow['path']; |
11013 | - $link .= $main_dir_path.'exercice/showinframes.php?file='.$path.'' . |
|
11014 | - '&origin='.$origin.'&cid='.$course_code.'&uid='.api_get_user_id().'' . |
|
11013 | + $link .= $main_dir_path.'exercice/showinframes.php?file='.$path.''. |
|
11014 | + '&origin='.$origin.'&cid='.$course_code.'&uid='.api_get_user_id().''. |
|
11015 | 11015 | '&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$id_in_path.'&lp_view_id='.$lpViewId; |
11016 | 11016 | break; |
11017 | 11017 | case TOOL_FORUM: |
@@ -11023,7 +11023,7 @@ discard block |
||
11023 | 11023 | $sql = "SELECT * FROM $tbl_topics WHERE c_id = $course_id AND thread_id=$id"; |
11024 | 11024 | $result = Database::query($sql); |
11025 | 11025 | $myrow = Database::fetch_array($result); |
11026 | - $link .= $main_dir_path.'forum/viewthread.php?origin=learnpath&thread='.$id.'' . |
|
11026 | + $link .= $main_dir_path.'forum/viewthread.php?origin=learnpath&thread='.$id.''. |
|
11027 | 11027 | '&forum='.$myrow['forum_id'].'&lp=true'; |
11028 | 11028 | } |
11029 | 11029 | break; |
@@ -11039,8 +11039,8 @@ discard block |
||
11039 | 11039 | $posttitle = $title; |
11040 | 11040 | $posttext = str_replace('"', "'", $posttext); |
11041 | 11041 | |
11042 | - $link .= $main_dir_path.'forum/viewthread.php?post='.$id.'' . |
|
11043 | - '&thread='.$myrow['thread_id'].'&forum='.$myrow['forum_id'].'' . |
|
11042 | + $link .= $main_dir_path.'forum/viewthread.php?post='.$id.''. |
|
11043 | + '&thread='.$myrow['thread_id'].'&forum='.$myrow['forum_id'].''. |
|
11044 | 11044 | '&lp=true'; |
11045 | 11045 | break; |
11046 | 11046 | case TOOL_DOCUMENT: |
@@ -11056,16 +11056,16 @@ discard block |
||
11056 | 11056 | $showDirectUrl = !in_array($documentPathInfo['extension'], $jplayer_supported_files); |
11057 | 11057 | |
11058 | 11058 | if ($showDirectUrl) { |
11059 | - $link = $documentInfo['direct_url'] . '?'; |
|
11059 | + $link = $documentInfo['direct_url'].'?'; |
|
11060 | 11060 | $link .= http_build_query(['cidReq' => $course_code, 'id_session' => $session_id]); |
11061 | 11061 | } else { |
11062 | - $link = $documentInfo['url'] . '&' . http_build_query(['origin' => 'learnpathitem']); |
|
11062 | + $link = $documentInfo['url'].'&'.http_build_query(['origin' => 'learnpathitem']); |
|
11063 | 11063 | } |
11064 | 11064 | |
11065 | 11065 | $openmethod = 2; |
11066 | 11066 | $officedoc = false; |
11067 | - Session::write('openmethod',$openmethod); |
|
11068 | - Session::write('officedoc',$officedoc); |
|
11067 | + Session::write('openmethod', $openmethod); |
|
11068 | + Session::write('officedoc', $officedoc); |
|
11069 | 11069 | break; |
11070 | 11070 | case 'assignments': |
11071 | 11071 | $link .= $main_dir_path.'work/work.php?origin='.$origin; |
@@ -11190,8 +11190,8 @@ discard block |
||
11190 | 11190 | $result = Database::query("SELECT * FROM $tbl_doc WHERE c_id = $course_id AND id=$id"); |
11191 | 11191 | $myrow = Database::fetch_array($result); |
11192 | 11192 | $pathname = explode('/', $myrow['path']); // Making a correct name for the link. |
11193 | - $last = count($pathname) - 1; // Making a correct name for the link. |
|
11194 | - $filename = $pathname[$last]; // Making a correct name for the link. |
|
11193 | + $last = count($pathname) - 1; // Making a correct name for the link. |
|
11194 | + $filename = $pathname[$last]; // Making a correct name for the link. |
|
11195 | 11195 | $image = choose_image($filename); |
11196 | 11196 | $ext = explode('.', $filename); |
11197 | 11197 | $ext = strtolower($ext[sizeof($ext) - 1]); |