@@ -15,8 +15,6 @@ discard block |
||
| 15 | 15 | This file has two large sections. |
| 16 | 16 | 1. code that belongs in document.php, but to avoid clutter I put the code here |
| 17 | 17 | 2. the function resize_image that handles the image resizing |
| 18 | - |
|
| 19 | - |
|
| 20 | 18 | * @author Patrick Cool |
| 21 | 19 | * @package chamilo.document |
| 22 | 20 | * @todo convert comments to be understandable to phpDocumentor |
@@ -34,16 +32,16 @@ discard block |
||
| 34 | 32 | * view is also possible when you choose not to resize the source images |
| 35 | 33 | */ |
| 36 | 34 | function resize_image($image, $target_width, $target_height, $slideshow = 0) { |
| 37 | - // Modifications by Ivan Tcholakov, 04-MAY-2009. |
|
| 38 | - $result = array(); |
|
| 39 | - if ( (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing']== 'resizing') or $slideshow == 1) { |
|
| 40 | - $new_sizes = api_resize_image($image, $target_width, $target_height); |
|
| 41 | - $result[] = $new_sizes['height']; |
|
| 42 | - $result[] = $new_sizes['width']; |
|
| 43 | - } else { |
|
| 35 | + // Modifications by Ivan Tcholakov, 04-MAY-2009. |
|
| 36 | + $result = array(); |
|
| 37 | + if ( (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing']== 'resizing') or $slideshow == 1) { |
|
| 38 | + $new_sizes = api_resize_image($image, $target_width, $target_height); |
|
| 39 | + $result[] = $new_sizes['height']; |
|
| 40 | + $result[] = $new_sizes['width']; |
|
| 41 | + } else { |
|
| 44 | 42 | $size = api_getimagesize($image); |
| 45 | - $result[] = $size['height']; |
|
| 46 | - $result[] = $size['width']; |
|
| 47 | - } |
|
| 48 | - return $result; |
|
| 43 | + $result[] = $size['height']; |
|
| 44 | + $result[] = $size['width']; |
|
| 45 | + } |
|
| 46 | + return $result; |
|
| 49 | 47 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | function resize_image($image, $target_width, $target_height, $slideshow = 0) { |
| 37 | 37 | // Modifications by Ivan Tcholakov, 04-MAY-2009. |
| 38 | 38 | $result = array(); |
| 39 | - if ( (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing']== 'resizing') or $slideshow == 1) { |
|
| 39 | + if ((isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] == 'resizing') or $slideshow == 1) { |
|
| 40 | 40 | $new_sizes = api_resize_image($image, $target_width, $target_height); |
| 41 | 41 | $result[] = $new_sizes['height']; |
| 42 | 42 | $result[] = $new_sizes['width']; |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | $session = array(); |
| 33 | 33 | $user_name = $user_info['complete_name']; |
| 34 | 34 | |
| 35 | -$course_list = SessionManager::get_course_list_by_session_id ($session_id); |
|
| 35 | +$course_list = SessionManager::get_course_list_by_session_id($session_id); |
|
| 36 | 36 | $session_list = SessionManager::get_session_by_course($course_id); |
| 37 | 37 | $total_quota_bytes = DocumentManager::get_course_quota(); |
| 38 | -$quota_bytes = DocumentManager::documents_total_space($course_id, 0 , 0); |
|
| 39 | -$quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100; |
|
| 38 | +$quota_bytes = DocumentManager::documents_total_space($course_id, 0, 0); |
|
| 39 | +$quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100; |
|
| 40 | 40 | |
| 41 | 41 | $session[] = array(get_lang('Course').' ('.format_file_size($quota_bytes).')', $quota_percentage); |
| 42 | 42 | |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | foreach ($session_list as $session_data) { |
| 47 | 47 | $quota_percentage = 0; |
| 48 | 48 | $quota_bytes = intval(DocumentManager::documents_total_space($course_id, null, $session_data['id'])); |
| 49 | - if (!empty($quota_bytes)) { |
|
| 50 | - $quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100; |
|
| 49 | + if (!empty($quota_bytes)) { |
|
| 50 | + $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100; |
|
| 51 | 51 | } |
| 52 | 52 | if ($session_id == $session_data['id']) { |
| 53 | - $session_data['name'] = $session_data['name'] . ' * '; |
|
| 53 | + $session_data['name'] = $session_data['name'].' * '; |
|
| 54 | 54 | } |
| 55 | 55 | $used_quota_bytes += $quota_bytes; |
| 56 | 56 | $session[] = array( |
@@ -66,11 +66,11 @@ discard block |
||
| 66 | 66 | $quota_percentage = 0; |
| 67 | 67 | $my_group_id = $group_data['id']; |
| 68 | 68 | $quota_bytes = intval(DocumentManager::documents_total_space($course_id, $my_group_id, 0)); |
| 69 | - if (!empty($quota_bytes)) { |
|
| 70 | - $quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100; |
|
| 69 | + if (!empty($quota_bytes)) { |
|
| 70 | + $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100; |
|
| 71 | 71 | } |
| 72 | 72 | if ($group_id == $my_group_id) { |
| 73 | - $group_data['name'] = $group_data['name'] . ' * '; |
|
| 73 | + $group_data['name'] = $group_data['name'].' * '; |
|
| 74 | 74 | } |
| 75 | 75 | $used_quota_bytes += $quota_bytes; |
| 76 | 76 | $session[] = array(addslashes(get_lang('Group').': '.$group_data['name']).' ('.format_file_size($quota_bytes).')', $quota_percentage); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | if ($quota_bytes != 0) { |
| 88 | - $quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100; |
|
| 88 | + $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | $session[] = array(addslashes(get_lang('Teacher').': '.$user_name).' ('.format_file_size($quota_bytes).')', $quota_percentage); |
@@ -98,15 +98,15 @@ discard block |
||
| 98 | 98 | $total_quota_bytes += DocumentManager::get_course_quota($course_data['id']); |
| 99 | 99 | } |
| 100 | 100 | if ($quota_bytes != 0) { |
| 101 | - $quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100; |
|
| 101 | + $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100; |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | - $session[] = array(addslashes(sprintf(get_lang('TeacherXInSession'),$user_name)), $quota_percentage); |
|
| 104 | + $session[] = array(addslashes(sprintf(get_lang('TeacherXInSession'), $user_name)), $quota_percentage); |
|
| 105 | 105 | |
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | -$quota_percentage = round(($total_quota_bytes - $used_quota_bytes)/$total_quota_bytes, 2)*100; |
|
| 109 | +$quota_percentage = round(($total_quota_bytes - $used_quota_bytes) / $total_quota_bytes, 2) * 100; |
|
| 110 | 110 | $session[] = array(addslashes(get_lang('ShowCourseQuotaUse')).' ('.format_file_size($total_quota_bytes - $used_quota_bytes).') ', $quota_percentage); |
| 111 | 111 | $quota_data = json_encode($session); |
| 112 | 112 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | if ($quota_bytes != 0) { |
| 88 | - $quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100; |
|
| 88 | + $quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | $session[] = array(addslashes(get_lang('Teacher').': '.$user_name).' ('.format_file_size($quota_bytes).')', $quota_percentage); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | } |
| 104 | 104 | $session[] = array(addslashes(sprintf(get_lang('TeacherXInSession'),$user_name)), $quota_percentage); |
| 105 | 105 | |
| 106 | - } |
|
| 106 | + } |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | $quota_percentage = round(($total_quota_bytes - $used_quota_bytes)/$total_quota_bytes, 2)*100; |
@@ -69,8 +69,7 @@ discard block |
||
| 69 | 69 | if (api_is_allowed_to_edit()) |
| 70 | 70 | { |
| 71 | 71 | $visibility="ip.visibility<>'2'"; |
| 72 | - } |
|
| 73 | - else |
|
| 72 | + } else |
|
| 74 | 73 | { |
| 75 | 74 | $visibility="ip.visibility='1'"; |
| 76 | 75 | } |
@@ -96,8 +95,7 @@ discard block |
||
| 96 | 95 | if (file_or_folder($row['path'])) |
| 97 | 96 | { |
| 98 | 97 | echo '<img src="../img/file.gif" align="middle" />'; |
| 99 | - } |
|
| 100 | - else |
|
| 98 | + } else |
|
| 101 | 99 | { |
| 102 | 100 | $image = choose_image($row['path']); |
| 103 | 101 | echo "<img src=\"../img/$image\" align=\"middle\" />"; |
@@ -108,16 +106,14 @@ discard block |
||
| 108 | 106 | { |
| 109 | 107 | echo "<a href='".api_get_self()."?content=Document"; |
| 110 | 108 | echo "&folder=".substr($row['path'],1)."&source_id=$source_id&source_forum=".$_GET['source_forum']."&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".substr($row['path'],1).'</a><br />'; |
| 111 | - } |
|
| 112 | - else |
|
| 109 | + } else |
|
| 113 | 110 | { |
| 114 | 111 | echo substr($row['path'],1).' '; |
| 115 | 112 | echo showorhide_addresourcelink('Document',$row['id']); |
| 116 | 113 | echo '<br />'; |
| 117 | 114 | } |
| 118 | 115 | } |
| 119 | - } |
|
| 120 | - else |
|
| 116 | + } else |
|
| 121 | 117 | { |
| 122 | 118 | // we calculate the level we are in by using the $folder in the url |
| 123 | 119 | // we put +1 because it does not start with an / and in the database it does |
@@ -156,8 +152,7 @@ discard block |
||
| 156 | 152 | if (file_or_folder($path)) |
| 157 | 153 | { |
| 158 | 154 | echo '<img src="../img/file.gif" align="middle" />'; |
| 159 | - } |
|
| 160 | - else |
|
| 155 | + } else |
|
| 161 | 156 | { |
| 162 | 157 | $image = choose_image($path); |
| 163 | 158 | echo "<img src=\"../img/$image\" align=\"middle\" />"; |
@@ -172,8 +167,7 @@ discard block |
||
| 172 | 167 | //using the correct name of the folder |
| 173 | 168 | $folder_name=str_replace($folder.'/','',$path); |
| 174 | 169 | echo "<a href='$newuri'>".$folder_name.'</a><br />'; |
| 175 | - } |
|
| 176 | - else |
|
| 170 | + } else |
|
| 177 | 171 | { |
| 178 | 172 | echo str_replace("/$folder/", '',$path).' '; |
| 179 | 173 | echo showorhide_addresourcelink('Document',$good_ids[$good_key]); |
@@ -349,9 +343,14 @@ discard block |
||
| 349 | 343 | |
| 350 | 344 | $length = ((($builder == 'builder') and ($icon == 'nolink')) ? 65 : 32); |
| 351 | 345 | |
| 352 | - if ($builder != 'builder') $origin = 'learnpath'; //origin = learnpath in student view |
|
| 346 | + if ($builder != 'builder') { |
|
| 347 | + $origin = 'learnpath'; |
|
| 348 | + } |
|
| 349 | + //origin = learnpath in student view |
|
| 353 | 350 | $linktype = $type; |
| 354 | - if (($type == 'Link _self') or ($type == 'Link _blank')) $type = 'Link'; |
|
| 351 | + if (($type == 'Link _self') or ($type == 'Link _blank')) { |
|
| 352 | + $type = 'Link'; |
|
| 353 | + } |
|
| 355 | 354 | |
| 356 | 355 | switch ($type) |
| 357 | 356 | { |
@@ -371,7 +370,7 @@ discard block |
||
| 371 | 370 | { |
| 372 | 371 | if ($completed=='completed') { |
| 373 | 372 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 374 | - } else { |
|
| 373 | + } else { |
|
| 375 | 374 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 376 | 375 | //echo " "; |
| 377 | 376 | } |
@@ -391,14 +390,12 @@ discard block |
||
| 391 | 390 | if ($icon != 'wrap') |
| 392 | 391 | { |
| 393 | 392 | echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
| 394 | - } |
|
| 395 | - else |
|
| 393 | + } else |
|
| 396 | 394 | { |
| 397 | 395 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
| 398 | 396 | } |
| 399 | 397 | } |
| 400 | - } |
|
| 401 | - else |
|
| 398 | + } else |
|
| 402 | 399 | { |
| 403 | 400 | echo "<a href=\"../calendar/agenda.php?origin=$origin&agenda_id=$agenda_id\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
| 404 | 401 | } |
@@ -426,7 +423,7 @@ discard block |
||
| 426 | 423 | { |
| 427 | 424 | if ($completed=='completed') { |
| 428 | 425 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 429 | - } else { |
|
| 426 | + } else { |
|
| 430 | 427 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 431 | 428 | //echo " "; |
| 432 | 429 | } |
@@ -450,14 +447,12 @@ discard block |
||
| 450 | 447 | if ($icon != 'wrap') |
| 451 | 448 | { |
| 452 | 449 | echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
| 453 | - } |
|
| 454 | - else |
|
| 450 | + } else |
|
| 455 | 451 | { |
| 456 | 452 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
| 457 | 453 | } |
| 458 | 454 | } |
| 459 | - } |
|
| 460 | - else |
|
| 455 | + } else |
|
| 461 | 456 | { |
| 462 | 457 | echo "<a href=\"../announcements/announcements.php?origin=$origin&ann_id=$ann_id\" class='$completed' target='_blank'>".shorten($title,($length-3*$level))."</a>"; |
| 463 | 458 | } |
@@ -479,7 +474,7 @@ discard block |
||
| 479 | 474 | { |
| 480 | 475 | if ($completed=='completed') { |
| 481 | 476 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 482 | - } else { |
|
| 477 | + } else { |
|
| 483 | 478 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 484 | 479 | //echo " "; |
| 485 | 480 | } |
@@ -495,8 +490,7 @@ discard block |
||
| 495 | 490 | if ($icon == 'nolink') { return(shorten($myrow["title"],$length)); } |
| 496 | 491 | if ($icon == 'icon') |
| 497 | 492 | { |
| 498 | - if ($linktype=='Link _self') { echo "<img src='../img/links.gif' align=\"absmiddle\" alt='links'>"; } |
|
| 499 | - else { echo "<img src='../img/link_blank.gif' align=\"absmiddle\" alt='blank links'>"; } |
|
| 493 | + if ($linktype=='Link _self') { echo "<img src='../img/links.gif' align=\"absmiddle\" alt='links'>"; } else { echo "<img src='../img/link_blank.gif' align=\"absmiddle\" alt='blank links'>"; } |
|
| 500 | 494 | } |
| 501 | 495 | $thelink=$myrow["url"]; |
| 502 | 496 | if ($builder != 'builder') |
@@ -508,14 +502,12 @@ discard block |
||
| 508 | 502 | if ($icon != 'wrap') |
| 509 | 503 | { |
| 510 | 504 | echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
| 511 | - } |
|
| 512 | - else |
|
| 505 | + } else |
|
| 513 | 506 | { |
| 514 | 507 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
| 515 | 508 | } |
| 516 | 509 | } |
| 517 | - } |
|
| 518 | - else |
|
| 510 | + } else |
|
| 519 | 511 | { |
| 520 | 512 | echo "<a href=\"$thelink\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
| 521 | 513 | } |
@@ -540,7 +532,7 @@ discard block |
||
| 540 | 532 | { |
| 541 | 533 | if ($completed=='completed') { |
| 542 | 534 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 543 | - } else { |
|
| 535 | + } else { |
|
| 544 | 536 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 545 | 537 | //echo " "; |
| 546 | 538 | } |
@@ -563,14 +555,12 @@ discard block |
||
| 563 | 555 | if ($icon != 'wrap') |
| 564 | 556 | { |
| 565 | 557 | echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
| 566 | - } |
|
| 567 | - else |
|
| 558 | + } else |
|
| 568 | 559 | { |
| 569 | 560 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
| 570 | 561 | } |
| 571 | 562 | } |
| 572 | - } |
|
| 573 | - else |
|
| 563 | + } else |
|
| 574 | 564 | { |
| 575 | 565 | echo "<a href=\"../exercice/exercise_submit.php?origin=$origin&exerciseId=".$myrow["id"]."\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
| 576 | 566 | } |
@@ -598,7 +588,7 @@ discard block |
||
| 598 | 588 | { |
| 599 | 589 | if ($completed=='completed') { |
| 600 | 590 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 601 | - } else { |
|
| 591 | + } else { |
|
| 602 | 592 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 603 | 593 | //echo " "; |
| 604 | 594 | } |
@@ -621,14 +611,12 @@ discard block |
||
| 621 | 611 | if ($icon != 'wrap') |
| 622 | 612 | { |
| 623 | 613 | echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
| 624 | - } |
|
| 625 | - else |
|
| 614 | + } else |
|
| 626 | 615 | { |
| 627 | 616 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
| 628 | 617 | } |
| 629 | 618 | } |
| 630 | - } |
|
| 631 | - else |
|
| 619 | + } else |
|
| 632 | 620 | { |
| 633 | 621 | echo " <a href=\"../exercice/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
| 634 | 622 | } |
@@ -650,7 +638,7 @@ discard block |
||
| 650 | 638 | { |
| 651 | 639 | if ($completed=='completed') { |
| 652 | 640 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 653 | - } else { |
|
| 641 | + } else { |
|
| 654 | 642 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 655 | 643 | //echo " "; |
| 656 | 644 | } |
@@ -671,14 +659,12 @@ discard block |
||
| 671 | 659 | if ($icon != 'wrap') |
| 672 | 660 | { |
| 673 | 661 | echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
| 674 | - } |
|
| 675 | - else |
|
| 662 | + } else |
|
| 676 | 663 | { |
| 677 | 664 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
| 678 | 665 | } |
| 679 | 666 | } |
| 680 | - } |
|
| 681 | - else |
|
| 667 | + } else |
|
| 682 | 668 | { |
| 683 | 669 | echo "<a href=\"../phpbb/viewforum.php?$forumparameters\" class='$completed' target='_blank'>".shorten($myrow["forum_name"],($length-3*$level))."</a>"; |
| 684 | 670 | } |
@@ -704,7 +690,7 @@ discard block |
||
| 704 | 690 | { |
| 705 | 691 | if ($completed=='completed') { |
| 706 | 692 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 707 | - } else { |
|
| 693 | + } else { |
|
| 708 | 694 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 709 | 695 | //echo " "; |
| 710 | 696 | } |
@@ -724,14 +710,12 @@ discard block |
||
| 724 | 710 | if ($icon != 'wrap') |
| 725 | 711 | { |
| 726 | 712 | echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
| 727 | - } |
|
| 728 | - else |
|
| 713 | + } else |
|
| 729 | 714 | { |
| 730 | 715 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
| 731 | 716 | } |
| 732 | 717 | } |
| 733 | - } |
|
| 734 | - else |
|
| 718 | + } else |
|
| 735 | 719 | { |
| 736 | 720 | echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow["topic_title"],($length-3*$level))."</a>"; |
| 737 | 721 | } |
@@ -765,7 +749,7 @@ discard block |
||
| 765 | 749 | { |
| 766 | 750 | if ($completed=='completed') { |
| 767 | 751 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 768 | - } else { |
|
| 752 | + } else { |
|
| 769 | 753 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 770 | 754 | //echo " "; |
| 771 | 755 | } |
@@ -788,14 +772,12 @@ discard block |
||
| 788 | 772 | if ($icon != 'wrap') |
| 789 | 773 | { |
| 790 | 774 | echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
| 791 | - } |
|
| 792 | - else |
|
| 775 | + } else |
|
| 793 | 776 | { |
| 794 | 777 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
| 795 | 778 | } |
| 796 | 779 | } |
| 797 | - } |
|
| 798 | - else |
|
| 780 | + } else |
|
| 799 | 781 | { |
| 800 | 782 | echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow_titel["post_title"],($length-3*$level))."</a>"; |
| 801 | 783 | } |
@@ -816,7 +798,7 @@ discard block |
||
| 816 | 798 | if ($icon != 'nolink') { |
| 817 | 799 | if ($completed=='completed') { |
| 818 | 800 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 819 | - } else { |
|
| 801 | + } else { |
|
| 820 | 802 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 821 | 803 | //echo " "; |
| 822 | 804 | } |
@@ -844,22 +826,19 @@ discard block |
||
| 844 | 826 | if ($icon != 'wrap') |
| 845 | 827 | { |
| 846 | 828 | echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
| 847 | - } |
|
| 848 | - else |
|
| 829 | + } else |
|
| 849 | 830 | { |
| 850 | 831 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
| 851 | 832 | } |
| 852 | 833 | } $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path"; |
| 853 | - } |
|
| 854 | - else |
|
| 834 | + } else |
|
| 855 | 835 | { |
| 856 | 836 | $enableDocumentParsing='yes'; |
| 857 | 837 | if (!$enableDocumentParsing) |
| 858 | 838 | { //this is the solution for the non-parsing version in the builder |
| 859 | 839 | $file=urlencode($myrow["path"]); |
| 860 | 840 | echo "<a href='../document/showinframes.php?file=$file' class='$completed' $hyperlink_target_parameter>".shorten($filename,($length-3*$level))."</a>"; |
| 861 | - } |
|
| 862 | - else |
|
| 841 | + } else |
|
| 863 | 842 | { |
| 864 | 843 | echo "<a href=\"../document/download.php?doc_url=".$myrow["path"]."\" class='$completed' $hyperlink_target_parameter>".shorten($filename,($length-3*$level))."</a>"; |
| 865 | 844 | } |
@@ -879,7 +858,7 @@ discard block |
||
| 879 | 858 | { |
| 880 | 859 | if ($completed=='completed') { |
| 881 | 860 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 882 | - } else { |
|
| 861 | + } else { |
|
| 883 | 862 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 884 | 863 | //echo " "; |
| 885 | 864 | } |
@@ -901,14 +880,12 @@ discard block |
||
| 901 | 880 | if ($icon != 'wrap') |
| 902 | 881 | { |
| 903 | 882 | echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
| 904 | - } |
|
| 905 | - else |
|
| 883 | + } else |
|
| 906 | 884 | { |
| 907 | 885 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
| 908 | 886 | } |
| 909 | 887 | } |
| 910 | - } |
|
| 911 | - else |
|
| 888 | + } else |
|
| 912 | 889 | { |
| 913 | 890 | echo "<a href=\"../work/work.php\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
| 914 | 891 | } |
@@ -925,7 +902,7 @@ discard block |
||
| 925 | 902 | if ($icon != 'nolink') { |
| 926 | 903 | if ($completed=='completed') { |
| 927 | 904 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 928 | - } else { |
|
| 905 | + } else { |
|
| 929 | 906 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 930 | 907 | //echo " "; |
| 931 | 908 | } |
@@ -942,8 +919,7 @@ discard block |
||
| 942 | 919 | echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path"; |
| 943 | 920 | if ($desc != '') { |
| 944 | 921 | if ($icon != 'wrap') { |
| 945 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 946 | - else { |
|
| 922 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } else { |
|
| 947 | 923 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
| 948 | 924 | } |
| 949 | 925 | } else { |
@@ -962,7 +938,7 @@ discard block |
||
| 962 | 938 | if ($icon != 'nolink') { |
| 963 | 939 | if ($completed=='completed') { |
| 964 | 940 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 965 | - } else { |
|
| 941 | + } else { |
|
| 966 | 942 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 967 | 943 | //echo " "; |
| 968 | 944 | } |
@@ -980,8 +956,7 @@ discard block |
||
| 980 | 956 | $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path"; |
| 981 | 957 | if ($desc != '') { |
| 982 | 958 | if ($icon != 'wrap') { |
| 983 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 984 | - else { |
|
| 959 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } else { |
|
| 985 | 960 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
| 986 | 961 | } |
| 987 | 962 | } else { |
@@ -1001,7 +976,7 @@ discard block |
||
| 1001 | 976 | if ($icon != 'nolink') { |
| 1002 | 977 | if ($completed=='completed') { |
| 1003 | 978 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 1004 | - } else { |
|
| 979 | + } else { |
|
| 1005 | 980 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 1006 | 981 | //echo " "; |
| 1007 | 982 | } |
@@ -1018,8 +993,7 @@ discard block |
||
| 1018 | 993 | echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path"; |
| 1019 | 994 | if ($desc != '') { |
| 1020 | 995 | if ($icon != 'wrap') { |
| 1021 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 1022 | - else { |
|
| 996 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } else { |
|
| 1023 | 997 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
| 1024 | 998 | } |
| 1025 | 999 | } else { |
@@ -1039,7 +1013,7 @@ discard block |
||
| 1039 | 1013 | if ($icon != 'nolink') { |
| 1040 | 1014 | if ($completed=='completed') { |
| 1041 | 1015 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 1042 | - } else { |
|
| 1016 | + } else { |
|
| 1043 | 1017 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 1044 | 1018 | //echo " "; |
| 1045 | 1019 | } |
@@ -1056,8 +1030,7 @@ discard block |
||
| 1056 | 1030 | echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path"; |
| 1057 | 1031 | if ($desc != '') { |
| 1058 | 1032 | if ($icon != 'wrap') { |
| 1059 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 1060 | - else { |
|
| 1033 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } else { |
|
| 1061 | 1034 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
| 1062 | 1035 | } |
| 1063 | 1036 | } else { |
@@ -1076,7 +1049,7 @@ discard block |
||
| 1076 | 1049 | if ($icon != 'nolink') { |
| 1077 | 1050 | if ($completed=='completed') { |
| 1078 | 1051 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 1079 | - } else { |
|
| 1052 | + } else { |
|
| 1080 | 1053 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 1081 | 1054 | //echo " "; |
| 1082 | 1055 | } |
@@ -1093,8 +1066,7 @@ discard block |
||
| 1093 | 1066 | echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path"; |
| 1094 | 1067 | if ($desc != '') { |
| 1095 | 1068 | if ($icon != 'wrap') { |
| 1096 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 1097 | - else { |
|
| 1069 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } else { |
|
| 1098 | 1070 | echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
| 1099 | 1071 | } |
| 1100 | 1072 | } else { |
@@ -1144,8 +1116,7 @@ discard block |
||
| 1144 | 1116 | if ($builder != 'builder') |
| 1145 | 1117 | { |
| 1146 | 1118 | $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path"; |
| 1147 | - } |
|
| 1148 | - else |
|
| 1119 | + } else |
|
| 1149 | 1120 | { |
| 1150 | 1121 | $link .= "../calendar/agenda.php?origin=$origin&agenda_id=$agenda_id"; |
| 1151 | 1122 | } |
@@ -1159,8 +1130,7 @@ discard block |
||
| 1159 | 1130 | if ($builder != 'builder') |
| 1160 | 1131 | { |
| 1161 | 1132 | $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$id#$id_in_path"; |
| 1162 | - } |
|
| 1163 | - else |
|
| 1133 | + } else |
|
| 1164 | 1134 | { |
| 1165 | 1135 | $link .= "../announcements/announcements.php?origin=$origin&ann_id=$id"; |
| 1166 | 1136 | } |
@@ -1178,8 +1148,7 @@ discard block |
||
| 1178 | 1148 | if ($builder != 'builder') |
| 1179 | 1149 | { |
| 1180 | 1150 | $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path"; |
| 1181 | - } |
|
| 1182 | - else |
|
| 1151 | + } else |
|
| 1183 | 1152 | { |
| 1184 | 1153 | $link .= $thelink; |
| 1185 | 1154 | } |
@@ -1200,8 +1169,7 @@ discard block |
||
| 1200 | 1169 | if ($builder != 'builder') |
| 1201 | 1170 | { |
| 1202 | 1171 | $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path"; |
| 1203 | - } |
|
| 1204 | - else |
|
| 1172 | + } else |
|
| 1205 | 1173 | { |
| 1206 | 1174 | $link .= "../exercice/exercise_submit.php?origin=$origin&exerciseId=".$myrow["id"]; |
| 1207 | 1175 | } |
@@ -1222,8 +1190,7 @@ discard block |
||
| 1222 | 1190 | if ($builder != 'builder') |
| 1223 | 1191 | { |
| 1224 | 1192 | $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path"; |
| 1225 | - } |
|
| 1226 | - else |
|
| 1193 | + } else |
|
| 1227 | 1194 | { |
| 1228 | 1195 | $link .= "../exercice/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id'].""; |
| 1229 | 1196 | } |
@@ -1247,8 +1214,7 @@ discard block |
||
| 1247 | 1214 | if ($builder != 'builder') |
| 1248 | 1215 | { |
| 1249 | 1216 | $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path"; |
| 1250 | - } |
|
| 1251 | - else |
|
| 1217 | + } else |
|
| 1252 | 1218 | { |
| 1253 | 1219 | $link .= "../phpbb/viewforum.php?$forumparameters"; |
| 1254 | 1220 | } |
@@ -1269,8 +1235,7 @@ discard block |
||
| 1269 | 1235 | if ($builder != 'builder') |
| 1270 | 1236 | { |
| 1271 | 1237 | $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path"; |
| 1272 | - } |
|
| 1273 | - else |
|
| 1238 | + } else |
|
| 1274 | 1239 | { |
| 1275 | 1240 | $link .= "../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]; |
| 1276 | 1241 | } |
@@ -1326,16 +1291,14 @@ discard block |
||
| 1326 | 1291 | { |
| 1327 | 1292 | $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path"; |
| 1328 | 1293 | |
| 1329 | - } |
|
| 1330 | - else |
|
| 1294 | + } else |
|
| 1331 | 1295 | { |
| 1332 | 1296 | $enableDocumentParsing='yes'; |
| 1333 | 1297 | if (!$enableDocumentParsing) |
| 1334 | 1298 | { //this is the solution for the non-parsing version in the builder |
| 1335 | 1299 | $file=urlencode($myrow["path"]); |
| 1336 | 1300 | $link .= "../document/showinframes.php?file=$file"; |
| 1337 | - } |
|
| 1338 | - else |
|
| 1301 | + } else |
|
| 1339 | 1302 | { |
| 1340 | 1303 | $link .= "../document/download.php?doc_url=".$myrow["path"]; |
| 1341 | 1304 | } |
@@ -1346,8 +1309,7 @@ discard block |
||
| 1346 | 1309 | if ($builder != 'builder') |
| 1347 | 1310 | { |
| 1348 | 1311 | $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path"; |
| 1349 | - } |
|
| 1350 | - else |
|
| 1312 | + } else |
|
| 1351 | 1313 | { |
| 1352 | 1314 | $link .= "../work/work.php"; |
| 1353 | 1315 | } |
@@ -1472,11 +1434,12 @@ discard block |
||
| 1472 | 1434 | $sql="SELECT * FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'"; |
| 1473 | 1435 | $result=Database::query($sql); |
| 1474 | 1436 | $number_added=Database::num_rows($result); |
| 1475 | - if ($number_added<>0) |
|
| 1476 | - return true; |
|
| 1477 | - else |
|
| 1478 | - return false; |
|
| 1479 | -} |
|
| 1437 | + if ($number_added<>0) { |
|
| 1438 | + return true; |
|
| 1439 | + } else { |
|
| 1440 | + return false; |
|
| 1441 | + } |
|
| 1442 | + } |
|
| 1480 | 1443 | |
| 1481 | 1444 | |
| 1482 | 1445 | /** |
@@ -1540,8 +1503,7 @@ discard block |
||
| 1540 | 1503 | if ($origin != 'learnpath') |
| 1541 | 1504 | { |
| 1542 | 1505 | display_addedresource_link($row['resource_type'], $row['resource_id'], $style) ; |
| 1543 | - } |
|
| 1544 | - else |
|
| 1506 | + } else |
|
| 1545 | 1507 | { |
| 1546 | 1508 | display_addedresource_link_in_learnpath($row['resource_type'], $row['resource_id'],'agendaitems','','builder','icon') ; echo "<br>"; |
| 1547 | 1509 | } |
@@ -1616,8 +1578,7 @@ discard block |
||
| 1616 | 1578 | //$_SESSION['edit']==''; |
| 1617 | 1579 | } |
| 1618 | 1580 | echo '</table>'; |
| 1619 | - } |
|
| 1620 | - else // it is a string |
|
| 1581 | + } else // it is a string |
|
| 1621 | 1582 | { |
| 1622 | 1583 | echo ''; |
| 1623 | 1584 | } |
@@ -1661,14 +1622,12 @@ discard block |
||
| 1661 | 1622 | if ($type=="Document") |
| 1662 | 1623 | { |
| 1663 | 1624 | echo "<a href=".api_get_self()."?content=".$type."&folder=".$folder."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no>".$lang_add_it_or_resource."</a>"; |
| 1664 | - } |
|
| 1665 | - else |
|
| 1625 | + } else |
|
| 1666 | 1626 | { |
| 1667 | 1627 | echo "<a href='".api_get_self()."?content=".$type."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no&target=$target'>".$lang_add_it_or_resource."</a>"; |
| 1668 | 1628 | } |
| 1669 | 1629 | } |
| 1670 | - } |
|
| 1671 | - else // if it is not an array, it is a string |
|
| 1630 | + } else // if it is not an array, it is a string |
|
| 1672 | 1631 | { |
| 1673 | 1632 | if ($_SESSION['addedresource']!==$type or $_SESSION['addedresourceid']!==$id) |
| 1674 | 1633 | { |
@@ -205,8 +205,8 @@ discard block |
||
| 205 | 205 | /** |
| 206 | 206 | * Inserts a resource into the database |
| 207 | 207 | * |
| 208 | - * @param $source_type |
|
| 209 | - * @param $source_id |
|
| 208 | + * @param string $source_type |
|
| 209 | + * @param integer $source_id |
|
| 210 | 210 | */ |
| 211 | 211 | function store_resources($source_type, $source_id) |
| 212 | 212 | { |
@@ -338,6 +338,10 @@ discard block |
||
| 338 | 338 | * @param icon - if ="icon" then the small icon will appear |
| 339 | 339 | * if ="wrap" then wrapped settings are used (and no icon is displayed) |
| 340 | 340 | * if ="nolink" then only the name is returned with no href and no icon (note:only in this case, the result is not displayed, but returned) |
| 341 | +* @param string $completed |
|
| 342 | +* @param string $id_in_path |
|
| 343 | +* @param string $builder |
|
| 344 | +* @param string $icon |
|
| 341 | 345 | * @todo this function is too long, rewrite |
| 342 | 346 | */ |
| 343 | 347 | function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_path, $builder, $icon, $level = 0) |
@@ -24,10 +24,10 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | 26 | function unset_session_resources() { |
| 27 | - $_SESSION['addedresource']=''; |
|
| 28 | - $_SESSION['addedresourceid']=''; |
|
| 29 | - Session::erase('addedresource'); |
|
| 30 | - Session::erase('addedresourceid'); |
|
| 27 | + $_SESSION['addedresource']=''; |
|
| 28 | + $_SESSION['addedresourceid']=''; |
|
| 29 | + Session::erase('addedresource'); |
|
| 30 | + Session::erase('addedresourceid'); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -35,24 +35,24 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | function show_folder_up() |
| 37 | 37 | { |
| 38 | - global $folder; |
|
| 39 | - global $source_id, $action, $learnpath_id, $chapter_id, $originalresource; |
|
| 40 | - |
|
| 41 | - $level = get_levels($folder); |
|
| 42 | - |
|
| 43 | - if ($level == 1) |
|
| 44 | - { |
|
| 45 | - echo "<a href='".api_get_self()."?content=Document&source_forum=".$_GET['source_forum']."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'><img src='../img/folder_up.gif' border='0' />".get_lang('LevelUp')."</a>"; |
|
| 46 | - } |
|
| 47 | - if ($level and $level != 0 and $level != 1) |
|
| 48 | - { |
|
| 49 | - $folder_up=$folder; |
|
| 50 | - $folder_temp=explode('/',$folder); |
|
| 51 | - $last=count($folder_temp)-1; |
|
| 52 | - unset($folder_temp[$last]); |
|
| 53 | - $folder_up=implode('/',$folder_temp); |
|
| 54 | - echo "<a href='".api_get_self()."?content=Document&source_forum=".$_GET['source_forum']."&folder=$folder_up&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'><img src='../img/folder_up.gif' border='0' />".get_lang('LevelUp')."</a>"; |
|
| 55 | - } |
|
| 38 | + global $folder; |
|
| 39 | + global $source_id, $action, $learnpath_id, $chapter_id, $originalresource; |
|
| 40 | + |
|
| 41 | + $level = get_levels($folder); |
|
| 42 | + |
|
| 43 | + if ($level == 1) |
|
| 44 | + { |
|
| 45 | + echo "<a href='".api_get_self()."?content=Document&source_forum=".$_GET['source_forum']."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'><img src='../img/folder_up.gif' border='0' />".get_lang('LevelUp')."</a>"; |
|
| 46 | + } |
|
| 47 | + if ($level and $level != 0 and $level != 1) |
|
| 48 | + { |
|
| 49 | + $folder_up=$folder; |
|
| 50 | + $folder_temp=explode('/',$folder); |
|
| 51 | + $last=count($folder_temp)-1; |
|
| 52 | + unset($folder_temp[$last]); |
|
| 53 | + $folder_up=implode('/',$folder_temp); |
|
| 54 | + echo "<a href='".api_get_self()."?content=Document&source_forum=".$_GET['source_forum']."&folder=$folder_up&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'><img src='../img/folder_up.gif' border='0' />".get_lang('LevelUp')."</a>"; |
|
| 55 | + } |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -61,23 +61,23 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | function show_documents($folder) |
| 63 | 63 | { |
| 64 | - global $_course; |
|
| 65 | - global $source_id, $action, $learnpath_id, $chapter_id, $originalresource; |
|
| 66 | - |
|
| 67 | - // documents are a special case: the teacher can add an invisible document (it will be viewable by the user) |
|
| 68 | - // other tools do not have this feature. This only counts |
|
| 69 | - if (api_is_allowed_to_edit()) |
|
| 70 | - { |
|
| 71 | - $visibility="ip.visibility<>'2'"; |
|
| 72 | - } |
|
| 73 | - else |
|
| 74 | - { |
|
| 75 | - $visibility="ip.visibility='1'"; |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - $item_property_table = Database::get_course_table(TABLE_ITEM_PROPERTY); |
|
| 79 | - $document_table = Database::get_course_table(TABLE_DOCUMENT); |
|
| 80 | - $sql = "SELECT * from $document_table docs, $item_property_table ip |
|
| 64 | + global $_course; |
|
| 65 | + global $source_id, $action, $learnpath_id, $chapter_id, $originalresource; |
|
| 66 | + |
|
| 67 | + // documents are a special case: the teacher can add an invisible document (it will be viewable by the user) |
|
| 68 | + // other tools do not have this feature. This only counts |
|
| 69 | + if (api_is_allowed_to_edit()) |
|
| 70 | + { |
|
| 71 | + $visibility="ip.visibility<>'2'"; |
|
| 72 | + } |
|
| 73 | + else |
|
| 74 | + { |
|
| 75 | + $visibility="ip.visibility='1'"; |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + $item_property_table = Database::get_course_table(TABLE_ITEM_PROPERTY); |
|
| 79 | + $document_table = Database::get_course_table(TABLE_DOCUMENT); |
|
| 80 | + $sql = "SELECT * from $document_table docs, $item_property_table ip |
|
| 81 | 81 | WHERE |
| 82 | 82 | docs.id=ip.ref AND |
| 83 | 83 | ip.tool = '".TOOL_DOCUMENT."' AND |
@@ -85,104 +85,104 @@ discard block |
||
| 85 | 85 | (ip.to_group_id = 0 OR i.to_group_id IS NULL) AND |
| 86 | 86 | ip.to_user_id IS NULL |
| 87 | 87 | ORDER BY docs.path ASC"; |
| 88 | - $result=Database::query($sql); |
|
| 89 | - while ($row=Database::fetch_array($result)) |
|
| 90 | - { |
|
| 91 | - if (!$folder) |
|
| 92 | - { |
|
| 93 | - if (get_levels($row['path'])-1==1) |
|
| 94 | - { |
|
| 95 | - // showing the right icon |
|
| 96 | - if (file_or_folder($row['path'])) |
|
| 97 | - { |
|
| 98 | - echo '<img src="../img/file.gif" align="middle" />'; |
|
| 99 | - } |
|
| 100 | - else |
|
| 101 | - { |
|
| 102 | - $image = choose_image($row['path']); |
|
| 103 | - echo "<img src=\"../img/$image\" align=\"middle\" />"; |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - // folders should be clickable |
|
| 107 | - if (file_or_folder($row['path'])) |
|
| 108 | - { |
|
| 109 | - echo "<a href='".api_get_self()."?content=Document"; |
|
| 110 | - echo "&folder=".substr($row['path'],1)."&source_id=$source_id&source_forum=".$_GET['source_forum']."&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".substr($row['path'],1).'</a><br />'; |
|
| 111 | - } |
|
| 112 | - else |
|
| 113 | - { |
|
| 114 | - echo substr($row['path'],1).' '; |
|
| 115 | - echo showorhide_addresourcelink('Document',$row['id']); |
|
| 116 | - echo '<br />'; |
|
| 117 | - } |
|
| 118 | - } |
|
| 119 | - } |
|
| 120 | - else |
|
| 121 | - { |
|
| 122 | - // we calculate the level we are in by using the $folder in the url |
|
| 123 | - // we put +1 because it does not start with an / and in the database it does |
|
| 124 | - $level=get_levels($folder)+1; |
|
| 125 | - |
|
| 126 | - // we calculate each level of the database entry |
|
| 127 | - $file_level=get_levels($row['path'])-1; |
|
| 128 | - // if the level of the database entry is equal to the level we ar in, we put it into an array |
|
| 129 | - // as this is a potential good entry |
|
| 130 | - if ($file_level==$level) |
|
| 131 | - { |
|
| 132 | - $good_paths[]=$row['path']; |
|
| 133 | - $good_ids[]=$row['id']; |
|
| 134 | - } |
|
| 135 | - //$haystack=$row['path']; |
|
| 136 | - //$conform_folder=strstr($haystack, $folder); |
|
| 137 | - //if (str_replace($folder.'/','',$conform_folder)!==$folder) |
|
| 138 | - // { |
|
| 139 | - // $good_folders[]=$row['path']; |
|
| 140 | - //echo str_replace($folder.'/','',$conform_folder); |
|
| 141 | - // echo '<br />'; |
|
| 142 | - // }// if (str_replace($folder.'/','',$conform_folder)!==$folder) |
|
| 143 | - } // else (if (!$folder)) |
|
| 144 | - } //while ($row=Database::fetch_array($result)) |
|
| 145 | - |
|
| 146 | - // this is code for the case that we are in a subfolder |
|
| 147 | - if ($good_paths) |
|
| 148 | - { |
|
| 149 | - // we have all the potential good database entries, the good ones are those that start with $folder |
|
| 150 | - foreach ($good_paths as $path) |
|
| 151 | - { |
|
| 152 | - if (strstr($path,$folder)) |
|
| 153 | - { |
|
| 154 | - $good_key=key($good_paths); |
|
| 155 | - // showing the right icon |
|
| 156 | - if (file_or_folder($path)) |
|
| 157 | - { |
|
| 158 | - echo '<img src="../img/file.gif" align="middle" />'; |
|
| 159 | - } |
|
| 160 | - else |
|
| 161 | - { |
|
| 162 | - $image = choose_image($path); |
|
| 163 | - echo "<img src=\"../img/$image\" align=\"middle\" />"; |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - // folders should be clickable |
|
| 167 | - if (file_or_folder($path)) |
|
| 168 | - { |
|
| 169 | - $path=substr($path,1); // remove the first / in folder_up |
|
| 170 | - $uri=str_replace($folder,$path,$_SERVER['REQUEST_URI']); |
|
| 171 | - $newuri=str_replace('add=','addnot=',$uri); |
|
| 172 | - //using the correct name of the folder |
|
| 173 | - $folder_name=str_replace($folder.'/','',$path); |
|
| 174 | - echo "<a href='$newuri'>".$folder_name.'</a><br />'; |
|
| 175 | - } |
|
| 176 | - else |
|
| 177 | - { |
|
| 178 | - echo str_replace("/$folder/", '',$path).' '; |
|
| 179 | - echo showorhide_addresourcelink('Document',$good_ids[$good_key]); |
|
| 180 | - echo '<br />'; |
|
| 181 | - } |
|
| 182 | - } |
|
| 183 | - next($good_paths); |
|
| 184 | - } |
|
| 185 | - } |
|
| 88 | + $result=Database::query($sql); |
|
| 89 | + while ($row=Database::fetch_array($result)) |
|
| 90 | + { |
|
| 91 | + if (!$folder) |
|
| 92 | + { |
|
| 93 | + if (get_levels($row['path'])-1==1) |
|
| 94 | + { |
|
| 95 | + // showing the right icon |
|
| 96 | + if (file_or_folder($row['path'])) |
|
| 97 | + { |
|
| 98 | + echo '<img src="../img/file.gif" align="middle" />'; |
|
| 99 | + } |
|
| 100 | + else |
|
| 101 | + { |
|
| 102 | + $image = choose_image($row['path']); |
|
| 103 | + echo "<img src=\"../img/$image\" align=\"middle\" />"; |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + // folders should be clickable |
|
| 107 | + if (file_or_folder($row['path'])) |
|
| 108 | + { |
|
| 109 | + echo "<a href='".api_get_self()."?content=Document"; |
|
| 110 | + echo "&folder=".substr($row['path'],1)."&source_id=$source_id&source_forum=".$_GET['source_forum']."&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".substr($row['path'],1).'</a><br />'; |
|
| 111 | + } |
|
| 112 | + else |
|
| 113 | + { |
|
| 114 | + echo substr($row['path'],1).' '; |
|
| 115 | + echo showorhide_addresourcelink('Document',$row['id']); |
|
| 116 | + echo '<br />'; |
|
| 117 | + } |
|
| 118 | + } |
|
| 119 | + } |
|
| 120 | + else |
|
| 121 | + { |
|
| 122 | + // we calculate the level we are in by using the $folder in the url |
|
| 123 | + // we put +1 because it does not start with an / and in the database it does |
|
| 124 | + $level=get_levels($folder)+1; |
|
| 125 | + |
|
| 126 | + // we calculate each level of the database entry |
|
| 127 | + $file_level=get_levels($row['path'])-1; |
|
| 128 | + // if the level of the database entry is equal to the level we ar in, we put it into an array |
|
| 129 | + // as this is a potential good entry |
|
| 130 | + if ($file_level==$level) |
|
| 131 | + { |
|
| 132 | + $good_paths[]=$row['path']; |
|
| 133 | + $good_ids[]=$row['id']; |
|
| 134 | + } |
|
| 135 | + //$haystack=$row['path']; |
|
| 136 | + //$conform_folder=strstr($haystack, $folder); |
|
| 137 | + //if (str_replace($folder.'/','',$conform_folder)!==$folder) |
|
| 138 | + // { |
|
| 139 | + // $good_folders[]=$row['path']; |
|
| 140 | + //echo str_replace($folder.'/','',$conform_folder); |
|
| 141 | + // echo '<br />'; |
|
| 142 | + // }// if (str_replace($folder.'/','',$conform_folder)!==$folder) |
|
| 143 | + } // else (if (!$folder)) |
|
| 144 | + } //while ($row=Database::fetch_array($result)) |
|
| 145 | + |
|
| 146 | + // this is code for the case that we are in a subfolder |
|
| 147 | + if ($good_paths) |
|
| 148 | + { |
|
| 149 | + // we have all the potential good database entries, the good ones are those that start with $folder |
|
| 150 | + foreach ($good_paths as $path) |
|
| 151 | + { |
|
| 152 | + if (strstr($path,$folder)) |
|
| 153 | + { |
|
| 154 | + $good_key=key($good_paths); |
|
| 155 | + // showing the right icon |
|
| 156 | + if (file_or_folder($path)) |
|
| 157 | + { |
|
| 158 | + echo '<img src="../img/file.gif" align="middle" />'; |
|
| 159 | + } |
|
| 160 | + else |
|
| 161 | + { |
|
| 162 | + $image = choose_image($path); |
|
| 163 | + echo "<img src=\"../img/$image\" align=\"middle\" />"; |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + // folders should be clickable |
|
| 167 | + if (file_or_folder($path)) |
|
| 168 | + { |
|
| 169 | + $path=substr($path,1); // remove the first / in folder_up |
|
| 170 | + $uri=str_replace($folder,$path,$_SERVER['REQUEST_URI']); |
|
| 171 | + $newuri=str_replace('add=','addnot=',$uri); |
|
| 172 | + //using the correct name of the folder |
|
| 173 | + $folder_name=str_replace($folder.'/','',$path); |
|
| 174 | + echo "<a href='$newuri'>".$folder_name.'</a><br />'; |
|
| 175 | + } |
|
| 176 | + else |
|
| 177 | + { |
|
| 178 | + echo str_replace("/$folder/", '',$path).' '; |
|
| 179 | + echo showorhide_addresourcelink('Document',$good_ids[$good_key]); |
|
| 180 | + echo '<br />'; |
|
| 181 | + } |
|
| 182 | + } |
|
| 183 | + next($good_paths); |
|
| 184 | + } |
|
| 185 | + } |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | /** |
@@ -193,13 +193,13 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | function file_or_folder($filefolder) |
| 195 | 195 | { |
| 196 | - global $_course; |
|
| 197 | - global $baseServDir; |
|
| 196 | + global $_course; |
|
| 197 | + global $baseServDir; |
|
| 198 | 198 | |
| 199 | - $courseDir = $_course['path'].'/document'; |
|
| 200 | - $baseWorkDir = api_get_path(SYS_COURSE_PATH).$courseDir; |
|
| 199 | + $courseDir = $_course['path'].'/document'; |
|
| 200 | + $baseWorkDir = api_get_path(SYS_COURSE_PATH).$courseDir; |
|
| 201 | 201 | |
| 202 | - return (is_dir($baseWorkDir.$filefolder) ? 1 : 0); |
|
| 202 | + return (is_dir($baseWorkDir.$filefolder) ? 1 : 0); |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | /** |
@@ -210,23 +210,23 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | function store_resources($source_type, $source_id) |
| 212 | 212 | { |
| 213 | - global $_course; |
|
| 214 | - $resource_table = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 215 | - |
|
| 216 | - $addedresource = $_SESSION['addedresource']; |
|
| 217 | - $addedresourceid = $_SESSION['addedresourceid']; |
|
| 218 | - if ($_SESSION['addedresource']) |
|
| 219 | - { |
|
| 220 | - foreach ($addedresource as $resource_type) |
|
| 221 | - { |
|
| 222 | - $sql="INSERT INTO $resource_table (source_type, source_id, resource_type, resource_id) VALUES ('$source_type', '$source_id', '$resource_type', '".$addedresourceid[key($addedresource)]."')"; |
|
| 223 | - Database::query($sql); |
|
| 224 | - $i=key($addedresource); |
|
| 225 | - next($addedresource); |
|
| 226 | - } |
|
| 227 | - $_SESSION['addedresource']=''; |
|
| 228 | - $_SESSION['addedresourceid']=''; |
|
| 229 | - } |
|
| 213 | + global $_course; |
|
| 214 | + $resource_table = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 215 | + |
|
| 216 | + $addedresource = $_SESSION['addedresource']; |
|
| 217 | + $addedresourceid = $_SESSION['addedresourceid']; |
|
| 218 | + if ($_SESSION['addedresource']) |
|
| 219 | + { |
|
| 220 | + foreach ($addedresource as $resource_type) |
|
| 221 | + { |
|
| 222 | + $sql="INSERT INTO $resource_table (source_type, source_id, resource_type, resource_id) VALUES ('$source_type', '$source_id', '$resource_type', '".$addedresourceid[key($addedresource)]."')"; |
|
| 223 | + Database::query($sql); |
|
| 224 | + $i=key($addedresource); |
|
| 225 | + next($addedresource); |
|
| 226 | + } |
|
| 227 | + $_SESSION['addedresource']=''; |
|
| 228 | + $_SESSION['addedresourceid']=''; |
|
| 229 | + } |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | /** |
@@ -240,87 +240,87 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | function display_addedresource_link($type, $id, $style='') |
| 242 | 242 | { |
| 243 | - global $_course; |
|
| 243 | + global $_course; |
|
| 244 | 244 | |
| 245 | - // styling the link of the added resource |
|
| 246 | - if ($style <> '') |
|
| 247 | - { |
|
| 248 | - $styling = ' class="'.$style.'"'; |
|
| 249 | - } |
|
| 245 | + // styling the link of the added resource |
|
| 246 | + if ($style <> '') |
|
| 247 | + { |
|
| 248 | + $styling = ' class="'.$style.'"'; |
|
| 249 | + } |
|
| 250 | 250 | |
| 251 | 251 | $course_id = api_get_course_int_id(); |
| 252 | 252 | |
| 253 | - switch ($type) |
|
| 254 | - { |
|
| 255 | - case 'Agenda': |
|
| 256 | - $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA); |
|
| 257 | - $result = Database::query("SELECT * FROM $TABLEAGENDA WHERE c_id = $course_id AND id=$id"); |
|
| 258 | - $myrow = Database::fetch_array($result); |
|
| 259 | - echo '<img src="../img/agenda.gif" align="middle" /> <a href="../calendar/agenda.php"'.$styling.'>'.$myrow['title']."</a><br />\n"; |
|
| 260 | - break; |
|
| 261 | - case 'Ad_Valvas': |
|
| 262 | - $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT); |
|
| 263 | - $result = Database::query("SELECT * FROM $tbl_announcement WHERE c_id = $course_id AND id=$id"); |
|
| 264 | - $myrow = Database::fetch_array($result); |
|
| 265 | - echo '<img src="../img/valves.gif" align="middle" /> <a href="../announcements/announcements.php"'.$styling.'>'.$myrow['title']."</a><br />\n"; |
|
| 266 | - break; |
|
| 267 | - case 'Link':Database::get_course_table(TABLE_LINK); |
|
| 268 | - $result = Database::query("SELECT * FROM $TABLETOOLLINK WHERE c_id = $course_id AND id=$id"); |
|
| 269 | - $myrow = Database::fetch_array($result); |
|
| 270 | - echo '<img src="../img/links.gif" align="middle" /> <a href="#" onclick="javascript:window.open(\'../link/link_goto.php?link_id='.$myrow['id'].'&link_url='.urlencode($myrow['url'])."','MyWindow','width=500,height=400,top='+((screen.height-400)/2)+',left='+((screen.width-500)/2)+',scrollbars=1,resizable=1,menubar=1'); return false;\"".$styling.'>'.$myrow['title']."</a><br />\n"; |
|
| 271 | - break; |
|
| 272 | - case 'Exercise': |
|
| 273 | - $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
|
| 274 | - $result = Database::query("SELECT * FROM $TBL_EXERCICES WHERE c_id = $course_id AND id=$id"); |
|
| 275 | - $myrow = Database::fetch_array($result); |
|
| 276 | - echo '<img src="../img/quiz.gif" align="middle" /> <a href="../exercise/exercise_submit.php?exerciseId='.$myrow['id'].'"'.$styling.'>'.$myrow['title']."</a><br />\n"; |
|
| 277 | - break; |
|
| 278 | - case 'Forum': |
|
| 279 | - $TBL_FORUMS = Database::get_course_table(TABLE_FORUM); |
|
| 280 | - $result = Database::query("SELECT * FROM $TBL_FORUMS WHERE c_id = $course_id AND forum_id=$id"); |
|
| 281 | - $myrow = Database::fetch_array($result); |
|
| 282 | - echo '<img src="../img/forum.gif" align="middle" /> <a href="../forum/viewforum.php?forum='.$myrow['forum_id'].'&md5='.$myrow['md5'].'"'.$styling.'>'.$myrow['forum_name']."</a><br />\n"; |
|
| 283 | - break; |
|
| 284 | - case 'Thread': //=topics |
|
| 253 | + switch ($type) |
|
| 254 | + { |
|
| 255 | + case 'Agenda': |
|
| 256 | + $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA); |
|
| 257 | + $result = Database::query("SELECT * FROM $TABLEAGENDA WHERE c_id = $course_id AND id=$id"); |
|
| 258 | + $myrow = Database::fetch_array($result); |
|
| 259 | + echo '<img src="../img/agenda.gif" align="middle" /> <a href="../calendar/agenda.php"'.$styling.'>'.$myrow['title']."</a><br />\n"; |
|
| 260 | + break; |
|
| 261 | + case 'Ad_Valvas': |
|
| 262 | + $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT); |
|
| 263 | + $result = Database::query("SELECT * FROM $tbl_announcement WHERE c_id = $course_id AND id=$id"); |
|
| 264 | + $myrow = Database::fetch_array($result); |
|
| 265 | + echo '<img src="../img/valves.gif" align="middle" /> <a href="../announcements/announcements.php"'.$styling.'>'.$myrow['title']."</a><br />\n"; |
|
| 266 | + break; |
|
| 267 | + case 'Link':Database::get_course_table(TABLE_LINK); |
|
| 268 | + $result = Database::query("SELECT * FROM $TABLETOOLLINK WHERE c_id = $course_id AND id=$id"); |
|
| 269 | + $myrow = Database::fetch_array($result); |
|
| 270 | + echo '<img src="../img/links.gif" align="middle" /> <a href="#" onclick="javascript:window.open(\'../link/link_goto.php?link_id='.$myrow['id'].'&link_url='.urlencode($myrow['url'])."','MyWindow','width=500,height=400,top='+((screen.height-400)/2)+',left='+((screen.width-500)/2)+',scrollbars=1,resizable=1,menubar=1'); return false;\"".$styling.'>'.$myrow['title']."</a><br />\n"; |
|
| 271 | + break; |
|
| 272 | + case 'Exercise': |
|
| 273 | + $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
|
| 274 | + $result = Database::query("SELECT * FROM $TBL_EXERCICES WHERE c_id = $course_id AND id=$id"); |
|
| 275 | + $myrow = Database::fetch_array($result); |
|
| 276 | + echo '<img src="../img/quiz.gif" align="middle" /> <a href="../exercise/exercise_submit.php?exerciseId='.$myrow['id'].'"'.$styling.'>'.$myrow['title']."</a><br />\n"; |
|
| 277 | + break; |
|
| 278 | + case 'Forum': |
|
| 279 | + $TBL_FORUMS = Database::get_course_table(TABLE_FORUM); |
|
| 280 | + $result = Database::query("SELECT * FROM $TBL_FORUMS WHERE c_id = $course_id AND forum_id=$id"); |
|
| 281 | + $myrow = Database::fetch_array($result); |
|
| 282 | + echo '<img src="../img/forum.gif" align="middle" /> <a href="../forum/viewforum.php?forum='.$myrow['forum_id'].'&md5='.$myrow['md5'].'"'.$styling.'>'.$myrow['forum_name']."</a><br />\n"; |
|
| 283 | + break; |
|
| 284 | + case 'Thread': //=topics |
|
| 285 | 285 | //deprecated |
| 286 | - $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
|
| 287 | - $tbl_posts_text = $_course['dbNameGlu'].'bb_posts_text'; |
|
| 288 | - $TBL_FORUMS = $_course['dbNameGlu'].'bb_forums'; |
|
| 289 | - $result = Database::query("SELECT * FROM $tbl_posts posts, $TBL_FORUMS forum WHERE forum.forum_id=posts.forum_id and post_id=$id"); |
|
| 290 | - $myrow = Database::fetch_array($result); |
|
| 291 | - // grabbing the title of the post |
|
| 292 | - $sql_title = "SELECT * FROM $tbl_posts_text WHERE post_id=".$myrow["post_id"]; |
|
| 293 | - $result_title = Database::query($sql_title); |
|
| 294 | - $myrow_title = Database::fetch_array($result_title); |
|
| 295 | - echo '<img src="../img/forum.gif" align="middle" /> <a href="../forum/viewtopic.php?topic='.$myrow['topic_id'].'&forum='.$myrow['forum_id'].'&md5='.$myrow['md5'].'"'.$styling.'>'.$myrow_title['post_title']."</a><br />\n"; |
|
| 296 | - break; |
|
| 297 | - case 'Post': |
|
| 286 | + $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
|
| 287 | + $tbl_posts_text = $_course['dbNameGlu'].'bb_posts_text'; |
|
| 288 | + $TBL_FORUMS = $_course['dbNameGlu'].'bb_forums'; |
|
| 289 | + $result = Database::query("SELECT * FROM $tbl_posts posts, $TBL_FORUMS forum WHERE forum.forum_id=posts.forum_id and post_id=$id"); |
|
| 290 | + $myrow = Database::fetch_array($result); |
|
| 291 | + // grabbing the title of the post |
|
| 292 | + $sql_title = "SELECT * FROM $tbl_posts_text WHERE post_id=".$myrow["post_id"]; |
|
| 293 | + $result_title = Database::query($sql_title); |
|
| 294 | + $myrow_title = Database::fetch_array($result_title); |
|
| 295 | + echo '<img src="../img/forum.gif" align="middle" /> <a href="../forum/viewtopic.php?topic='.$myrow['topic_id'].'&forum='.$myrow['forum_id'].'&md5='.$myrow['md5'].'"'.$styling.'>'.$myrow_title['post_title']."</a><br />\n"; |
|
| 296 | + break; |
|
| 297 | + case 'Post': |
|
| 298 | 298 | //deprecated |
| 299 | - $tbl_post = Database::get_course_table(TABLE_FORUM_POST); |
|
| 300 | - $tbl_post_text = Database::get_course_table(TOOL_FORUM_POST_TEXT_TABLE); |
|
| 301 | - $sql = "SELECT * FROM $tbl_post p, $tbl_post_text t WHERE p.post_id = t.post_id AND p.post_id = $id"; |
|
| 302 | - $result = Database::query($sql); |
|
| 303 | - $post = Database::fetch_object($result); |
|
| 304 | - echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewtopic.php?topic='.$post->topic_id.'&forum='.$post->forum_id.'"'.$styling.'>'.$post->post_title."</a><br />\n"; |
|
| 305 | - break; |
|
| 306 | - case 'Document': |
|
| 307 | - $dbTable = Database::get_course_table(TABLE_DOCUMENT); |
|
| 308 | - $result = Database::query("SELECT * FROM $dbTable WHERE c_id = $course_id AND id=$id"); |
|
| 309 | - $myrow = Database::fetch_array($result); |
|
| 310 | - $pathname = explode('/',$myrow['path']); // making a correct name for the link |
|
| 311 | - $last = count($pathname) - 1; // making a correct name for the link |
|
| 312 | - $filename = $pathname[$last]; // making a correct name for the link |
|
| 313 | - $image = choose_image($filename); |
|
| 314 | - $ext = explode('.',$filename); |
|
| 315 | - $ext = strtolower($ext[sizeof($ext)-1]); |
|
| 316 | - $myrow['path'] = rawurlencode($myrow['path']); |
|
| 317 | - $in_frames = in_array($ext, array('htm','html','gif','jpg','jpeg','png')); |
|
| 318 | - echo '<img src="../img/'.$image.'" align="middle" /> <a href="../document/'.($in_frames ? 'showinframes.php?file=' : 'download.php?doc_url=').$myrow['path'].'"'.$styling.'>'.$filename."</a><br />\n"; |
|
| 319 | - break; |
|
| 320 | - case 'Externallink': |
|
| 321 | - echo '<img src="../img/links.gif" align="middle" /> <a href="'.$id.'"'.$styling.'>'.$id."</a><br />\n"; |
|
| 322 | - break; |
|
| 323 | - } |
|
| 299 | + $tbl_post = Database::get_course_table(TABLE_FORUM_POST); |
|
| 300 | + $tbl_post_text = Database::get_course_table(TOOL_FORUM_POST_TEXT_TABLE); |
|
| 301 | + $sql = "SELECT * FROM $tbl_post p, $tbl_post_text t WHERE p.post_id = t.post_id AND p.post_id = $id"; |
|
| 302 | + $result = Database::query($sql); |
|
| 303 | + $post = Database::fetch_object($result); |
|
| 304 | + echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewtopic.php?topic='.$post->topic_id.'&forum='.$post->forum_id.'"'.$styling.'>'.$post->post_title."</a><br />\n"; |
|
| 305 | + break; |
|
| 306 | + case 'Document': |
|
| 307 | + $dbTable = Database::get_course_table(TABLE_DOCUMENT); |
|
| 308 | + $result = Database::query("SELECT * FROM $dbTable WHERE c_id = $course_id AND id=$id"); |
|
| 309 | + $myrow = Database::fetch_array($result); |
|
| 310 | + $pathname = explode('/',$myrow['path']); // making a correct name for the link |
|
| 311 | + $last = count($pathname) - 1; // making a correct name for the link |
|
| 312 | + $filename = $pathname[$last]; // making a correct name for the link |
|
| 313 | + $image = choose_image($filename); |
|
| 314 | + $ext = explode('.',$filename); |
|
| 315 | + $ext = strtolower($ext[sizeof($ext)-1]); |
|
| 316 | + $myrow['path'] = rawurlencode($myrow['path']); |
|
| 317 | + $in_frames = in_array($ext, array('htm','html','gif','jpg','jpeg','png')); |
|
| 318 | + echo '<img src="../img/'.$image.'" align="middle" /> <a href="../document/'.($in_frames ? 'showinframes.php?file=' : 'download.php?doc_url=').$myrow['path'].'"'.$styling.'>'.$filename."</a><br />\n"; |
|
| 319 | + break; |
|
| 320 | + case 'Externallink': |
|
| 321 | + echo '<img src="../img/links.gif" align="middle" /> <a href="'.$id.'"'.$styling.'>'.$id."</a><br />\n"; |
|
| 322 | + break; |
|
| 323 | + } |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | /** |
@@ -342,766 +342,766 @@ discard block |
||
| 342 | 342 | */ |
| 343 | 343 | function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_path, $builder, $icon, $level = 0) |
| 344 | 344 | { |
| 345 | - global $learnpath_id, $tbl_learnpath_item, $items; |
|
| 346 | - global $_course, $curDirPath, $_configuration, $enableDocumentParsing, $_user, $_cid; |
|
| 347 | - |
|
| 348 | - $hyperlink_target_parameter = ''; //or e.g. 'target="_blank"' |
|
| 349 | - |
|
| 350 | - $length = ((($builder == 'builder') and ($icon == 'nolink')) ? 65 : 32); |
|
| 351 | - |
|
| 352 | - if ($builder != 'builder') $origin = 'learnpath'; //origin = learnpath in student view |
|
| 353 | - $linktype = $type; |
|
| 354 | - if (($type == 'Link _self') or ($type == 'Link _blank')) $type = 'Link'; |
|
| 355 | - |
|
| 356 | - switch ($type) |
|
| 357 | - { |
|
| 358 | - case "Agenda": |
|
| 359 | - $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA); |
|
| 360 | - $result = Database::query("SELECT * FROM $TABLEAGENDA WHERE id=$id"); |
|
| 361 | - $myrow=Database::fetch_array($result); |
|
| 362 | - |
|
| 363 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 364 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 365 | - if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 366 | - $desc=$row['description']; |
|
| 367 | - $agenda_id=$row['item_id']; |
|
| 368 | - echo str_repeat(" >",$level); |
|
| 369 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 370 | - if ($icon != 'nolink') |
|
| 371 | - { |
|
| 372 | - if ($completed=='completed') { |
|
| 373 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 374 | - } else { |
|
| 375 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 376 | - //echo " "; |
|
| 377 | - } |
|
| 378 | - } |
|
| 379 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 380 | - |
|
| 381 | - if ($myrow["title"]=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 382 | - |
|
| 383 | - if ($icon == 'nolink') { return(shorten($myrow["title"],$length)); } |
|
| 384 | - if ($icon == 'icon') { echo "<img src='../img/agenda.gif' align=\"absmiddle\" alt='agenda'>"; } |
|
| 385 | - if ($builder != 'builder') |
|
| 386 | - { |
|
| 387 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path\" class='$completed'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 388 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path"; |
|
| 389 | - if ($desc != '') |
|
| 390 | - { |
|
| 391 | - if ($icon != 'wrap') |
|
| 392 | - { |
|
| 393 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 394 | - } |
|
| 395 | - else |
|
| 396 | - { |
|
| 397 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 398 | - } |
|
| 399 | - } |
|
| 400 | - } |
|
| 401 | - else |
|
| 402 | - { |
|
| 403 | - echo "<a href=\"../calendar/agenda.php?origin=$origin&agenda_id=$agenda_id\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 404 | - } |
|
| 405 | - break; |
|
| 406 | - |
|
| 407 | - case "Ad_Valvas": |
|
| 408 | - $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT); |
|
| 409 | - $result = Database::query("SELECT * FROM $tbl_announcement WHERE id=$id"); |
|
| 410 | - $myrow=Database::fetch_array($result); |
|
| 411 | - |
|
| 412 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 413 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 414 | - if ($row['title'] != '') { $myrow["content"]=$row['title']; } |
|
| 415 | - $desc=$row['description']; |
|
| 416 | - $ann_id=$row['item_id']; |
|
| 417 | - echo str_repeat(" >",$level); |
|
| 418 | - |
|
| 419 | - // the title and the text are in the content field and we only want to display the title |
|
| 420 | - list($title, $text)=split('<br>',$myrow['content']); |
|
| 421 | - if ($title=='') { $title=$myrow['content']; } |
|
| 422 | - $title=$myrow['title']; |
|
| 423 | - $text=$myrow['content']; |
|
| 424 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 425 | - if ($icon != 'nolink') |
|
| 426 | - { |
|
| 427 | - if ($completed=='completed') { |
|
| 428 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 429 | - } else { |
|
| 430 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 431 | - //echo " "; |
|
| 432 | - } |
|
| 433 | - } |
|
| 434 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 435 | - |
|
| 436 | - if ($title=='') { |
|
| 437 | - $type="Announcement"; |
|
| 438 | - echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; |
|
| 439 | - return(true); |
|
| 440 | - } |
|
| 441 | - |
|
| 442 | - if ($icon == 'nolink') { return(shorten($title,$length)); } |
|
| 443 | - if ($icon == 'icon') { echo "<img src='../img/valves.gif' align=\"absmiddle\" alt='ad valvas'>"; } |
|
| 444 | - if ($builder != 'builder') |
|
| 445 | - { |
|
| 446 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$ann_id#$id_in_path\" class='$completed'>".shorten($title,($length-3*$level))."</a>"; |
|
| 447 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$ann_id#$id_in_path"; |
|
| 448 | - if ($desc != '') |
|
| 449 | - { |
|
| 450 | - if ($icon != 'wrap') |
|
| 451 | - { |
|
| 452 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 453 | - } |
|
| 454 | - else |
|
| 455 | - { |
|
| 456 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 457 | - } |
|
| 458 | - } |
|
| 459 | - } |
|
| 460 | - else |
|
| 461 | - { |
|
| 462 | - echo "<a href=\"../announcements/announcements.php?origin=$origin&ann_id=$ann_id\" class='$completed' target='_blank'>".shorten($title,($length-3*$level))."</a>"; |
|
| 463 | - } |
|
| 464 | - break; |
|
| 465 | - |
|
| 466 | - case "Link" : |
|
| 467 | - $TABLETOOLLINK = Database::get_course_table(TABLE_LINK); |
|
| 468 | - $result= Database::query("SELECT * FROM $TABLETOOLLINK WHERE id=$id"); |
|
| 469 | - $myrow=Database::fetch_array($result); |
|
| 470 | - |
|
| 471 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 472 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 473 | - if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 474 | - $desc=$row['description']; |
|
| 475 | - echo str_repeat(" >",$level); |
|
| 476 | - |
|
| 477 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 478 | - if ($icon != 'nolink') |
|
| 479 | - { |
|
| 480 | - if ($completed=='completed') { |
|
| 481 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 482 | - } else { |
|
| 483 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 484 | - //echo " "; |
|
| 485 | - } |
|
| 486 | - } |
|
| 487 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 488 | - |
|
| 489 | - if ($myrow["title"]=='') |
|
| 490 | - { |
|
| 491 | - echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; |
|
| 492 | - return(true); |
|
| 493 | - } |
|
| 494 | - |
|
| 495 | - if ($icon == 'nolink') { return(shorten($myrow["title"],$length)); } |
|
| 496 | - if ($icon == 'icon') |
|
| 497 | - { |
|
| 498 | - if ($linktype=='Link _self') { echo "<img src='../img/links.gif' align=\"absmiddle\" alt='links'>"; } |
|
| 499 | - else { echo "<img src='../img/link_blank.gif' align=\"absmiddle\" alt='blank links'>"; } |
|
| 500 | - } |
|
| 501 | - $thelink=$myrow["url"]; |
|
| 502 | - if ($builder != 'builder') |
|
| 503 | - { |
|
| 504 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path\" class='$completed'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 505 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path"; |
|
| 506 | - if ($desc != '') |
|
| 507 | - { |
|
| 508 | - if ($icon != 'wrap') |
|
| 509 | - { |
|
| 510 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 511 | - } |
|
| 512 | - else |
|
| 513 | - { |
|
| 514 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 515 | - } |
|
| 516 | - } |
|
| 517 | - } |
|
| 518 | - else |
|
| 519 | - { |
|
| 520 | - echo "<a href=\"$thelink\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 521 | - } |
|
| 522 | - break; |
|
| 523 | - |
|
| 524 | - case "Exercise": |
|
| 525 | - $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
|
| 526 | - $result= Database::query("SELECT * FROM $TBL_EXERCICES WHERE id=$id"); |
|
| 527 | - $myrow=Database::fetch_array($result); |
|
| 528 | - |
|
| 529 | - if ($builder=='builder') { $origin='builder'; } |
|
| 530 | - //this is needed for the exercise_submit.php can delete the session info about tests |
|
| 531 | - |
|
| 532 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 533 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 534 | - if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 535 | - $desc=$row['description']; |
|
| 536 | - echo str_repeat(" >",$level); |
|
| 537 | - |
|
| 538 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 539 | - if ($icon != 'nolink') |
|
| 540 | - { |
|
| 541 | - if ($completed=='completed') { |
|
| 542 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 543 | - } else { |
|
| 544 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 545 | - //echo " "; |
|
| 546 | - } |
|
| 547 | - } |
|
| 548 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 549 | - |
|
| 550 | - if ($myrow["title"]=='') { |
|
| 551 | - echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; |
|
| 552 | - return(true); |
|
| 553 | - } |
|
| 554 | - |
|
| 555 | - if ($icon == 'nolink') { return(shorten($myrow["title"],$length)); } |
|
| 556 | - if ($icon == 'icon') { echo "<img src='../img/quiz.gif' align=\"absmiddle\" alt='quizz'>"; } |
|
| 557 | - if ($builder != 'builder') |
|
| 558 | - { |
|
| 559 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path\" class='$completed'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 560 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path"; |
|
| 561 | - if ($desc != '') |
|
| 562 | - { |
|
| 563 | - if ($icon != 'wrap') |
|
| 564 | - { |
|
| 565 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 566 | - } |
|
| 567 | - else |
|
| 568 | - { |
|
| 569 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 570 | - } |
|
| 571 | - } |
|
| 572 | - } |
|
| 573 | - else |
|
| 574 | - { |
|
| 575 | - echo "<a href=\"../exercise/exercise_submit.php?origin=$origin&exerciseId=".$myrow["id"]."\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 576 | - } |
|
| 577 | - break; |
|
| 578 | - |
|
| 579 | - case "HotPotatoes": |
|
| 580 | - $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT); |
|
| 581 | - $documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
|
| 582 | - $result = Database::query("SELECT * FROM ".$TBL_DOCUMENT." WHERE id=$id"); |
|
| 583 | - $myrow= Database::fetch_array($result); |
|
| 584 | - $path=$myrow["path"]; |
|
| 585 | - $name=GetQuizName($path,$documentPath); |
|
| 586 | - |
|
| 587 | - if ($builder=='builder') { $origin='builder'; } |
|
| 588 | - //this is needed for the exercise_submit.php can delete the session info about tests |
|
| 589 | - |
|
| 590 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 591 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 592 | - if ($row['title'] != '') { $name=$row['title']; } |
|
| 593 | - $desc=$row['description']; |
|
| 594 | - echo str_repeat(" >",$level); |
|
| 595 | - |
|
| 596 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 597 | - if ($icon != 'nolink') |
|
| 598 | - { |
|
| 599 | - if ($completed=='completed') { |
|
| 600 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 601 | - } else { |
|
| 602 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 603 | - //echo " "; |
|
| 604 | - } |
|
| 605 | - } |
|
| 606 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 607 | - |
|
| 608 | - if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 609 | - |
|
| 610 | - if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 611 | - if ($icon == 'icon') { echo "<img src='../img/jqz.gif' align=\"absmiddle\" alt='hot potatoes'>"; } |
|
| 612 | - |
|
| 613 | - $cid = $_course['official_code']; |
|
| 614 | - |
|
| 615 | - if ($builder != 'builder') |
|
| 616 | - { |
|
| 617 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; |
|
| 618 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path"; |
|
| 619 | - if ($desc != '') |
|
| 620 | - { |
|
| 621 | - if ($icon != 'wrap') |
|
| 622 | - { |
|
| 623 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 624 | - } |
|
| 625 | - else |
|
| 626 | - { |
|
| 627 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 628 | - } |
|
| 629 | - } |
|
| 630 | - } |
|
| 631 | - else |
|
| 632 | - { |
|
| 633 | - echo " <a href=\"../exercise/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 634 | - } |
|
| 635 | - break; |
|
| 636 | - |
|
| 637 | - case "Forum": |
|
| 638 | - $TBL_FORUMS = Database::get_course_table(TABLE_FORUM); |
|
| 639 | - $result= Database::query("SELECT * FROM $TBL_FORUMS WHERE forum_id=$id"); |
|
| 640 | - $myrow=Database::fetch_array($result); |
|
| 641 | - |
|
| 642 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 643 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 644 | - if ($row['title'] != '') { $myrow["forum_name"]=$row['title']; } |
|
| 645 | - $desc=$row['description']; |
|
| 646 | - echo str_repeat(" >",$level); |
|
| 647 | - |
|
| 648 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 649 | - if ($icon != 'nolink') |
|
| 650 | - { |
|
| 651 | - if ($completed=='completed') { |
|
| 652 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 653 | - } else { |
|
| 654 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 655 | - //echo " "; |
|
| 656 | - } |
|
| 657 | - } |
|
| 658 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 659 | - |
|
| 660 | - if ($myrow["forum_name"]=='') { $type="Forum"; echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 661 | - |
|
| 662 | - if ($icon == 'nolink') { return(shorten($myrow["forum_name"],$length)); } |
|
| 663 | - if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; } |
|
| 664 | - $forumparameters="forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]; |
|
| 665 | - if ($builder != 'builder') |
|
| 666 | - { |
|
| 667 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path\" class='$completed'>".shorten($myrow["forum_name"],($length-3*$level))."</a>"; |
|
| 668 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path"; |
|
| 669 | - if ($desc != '') |
|
| 670 | - { |
|
| 671 | - if ($icon != 'wrap') |
|
| 672 | - { |
|
| 673 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 674 | - } |
|
| 675 | - else |
|
| 676 | - { |
|
| 677 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 678 | - } |
|
| 679 | - } |
|
| 680 | - } |
|
| 681 | - else |
|
| 682 | - { |
|
| 683 | - echo "<a href=\"../phpbb/viewforum.php?$forumparameters\" class='$completed' target='_blank'>".shorten($myrow["forum_name"],($length-3*$level))."</a>"; |
|
| 684 | - } |
|
| 685 | - break; |
|
| 686 | - |
|
| 687 | - case "Thread": //forum post |
|
| 345 | + global $learnpath_id, $tbl_learnpath_item, $items; |
|
| 346 | + global $_course, $curDirPath, $_configuration, $enableDocumentParsing, $_user, $_cid; |
|
| 347 | + |
|
| 348 | + $hyperlink_target_parameter = ''; //or e.g. 'target="_blank"' |
|
| 349 | + |
|
| 350 | + $length = ((($builder == 'builder') and ($icon == 'nolink')) ? 65 : 32); |
|
| 351 | + |
|
| 352 | + if ($builder != 'builder') $origin = 'learnpath'; //origin = learnpath in student view |
|
| 353 | + $linktype = $type; |
|
| 354 | + if (($type == 'Link _self') or ($type == 'Link _blank')) $type = 'Link'; |
|
| 355 | + |
|
| 356 | + switch ($type) |
|
| 357 | + { |
|
| 358 | + case "Agenda": |
|
| 359 | + $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA); |
|
| 360 | + $result = Database::query("SELECT * FROM $TABLEAGENDA WHERE id=$id"); |
|
| 361 | + $myrow=Database::fetch_array($result); |
|
| 362 | + |
|
| 363 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 364 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 365 | + if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 366 | + $desc=$row['description']; |
|
| 367 | + $agenda_id=$row['item_id']; |
|
| 368 | + echo str_repeat(" >",$level); |
|
| 369 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 370 | + if ($icon != 'nolink') |
|
| 371 | + { |
|
| 372 | + if ($completed=='completed') { |
|
| 373 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 374 | + } else { |
|
| 375 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 376 | + //echo " "; |
|
| 377 | + } |
|
| 378 | + } |
|
| 379 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 380 | + |
|
| 381 | + if ($myrow["title"]=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 382 | + |
|
| 383 | + if ($icon == 'nolink') { return(shorten($myrow["title"],$length)); } |
|
| 384 | + if ($icon == 'icon') { echo "<img src='../img/agenda.gif' align=\"absmiddle\" alt='agenda'>"; } |
|
| 385 | + if ($builder != 'builder') |
|
| 386 | + { |
|
| 387 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path\" class='$completed'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 388 | + $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path"; |
|
| 389 | + if ($desc != '') |
|
| 390 | + { |
|
| 391 | + if ($icon != 'wrap') |
|
| 392 | + { |
|
| 393 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 394 | + } |
|
| 395 | + else |
|
| 396 | + { |
|
| 397 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 398 | + } |
|
| 399 | + } |
|
| 400 | + } |
|
| 401 | + else |
|
| 402 | + { |
|
| 403 | + echo "<a href=\"../calendar/agenda.php?origin=$origin&agenda_id=$agenda_id\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 404 | + } |
|
| 405 | + break; |
|
| 406 | + |
|
| 407 | + case "Ad_Valvas": |
|
| 408 | + $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT); |
|
| 409 | + $result = Database::query("SELECT * FROM $tbl_announcement WHERE id=$id"); |
|
| 410 | + $myrow=Database::fetch_array($result); |
|
| 411 | + |
|
| 412 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 413 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 414 | + if ($row['title'] != '') { $myrow["content"]=$row['title']; } |
|
| 415 | + $desc=$row['description']; |
|
| 416 | + $ann_id=$row['item_id']; |
|
| 417 | + echo str_repeat(" >",$level); |
|
| 418 | + |
|
| 419 | + // the title and the text are in the content field and we only want to display the title |
|
| 420 | + list($title, $text)=split('<br>',$myrow['content']); |
|
| 421 | + if ($title=='') { $title=$myrow['content']; } |
|
| 422 | + $title=$myrow['title']; |
|
| 423 | + $text=$myrow['content']; |
|
| 424 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 425 | + if ($icon != 'nolink') |
|
| 426 | + { |
|
| 427 | + if ($completed=='completed') { |
|
| 428 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 429 | + } else { |
|
| 430 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 431 | + //echo " "; |
|
| 432 | + } |
|
| 433 | + } |
|
| 434 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 435 | + |
|
| 436 | + if ($title=='') { |
|
| 437 | + $type="Announcement"; |
|
| 438 | + echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; |
|
| 439 | + return(true); |
|
| 440 | + } |
|
| 441 | + |
|
| 442 | + if ($icon == 'nolink') { return(shorten($title,$length)); } |
|
| 443 | + if ($icon == 'icon') { echo "<img src='../img/valves.gif' align=\"absmiddle\" alt='ad valvas'>"; } |
|
| 444 | + if ($builder != 'builder') |
|
| 445 | + { |
|
| 446 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$ann_id#$id_in_path\" class='$completed'>".shorten($title,($length-3*$level))."</a>"; |
|
| 447 | + $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$ann_id#$id_in_path"; |
|
| 448 | + if ($desc != '') |
|
| 449 | + { |
|
| 450 | + if ($icon != 'wrap') |
|
| 451 | + { |
|
| 452 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 453 | + } |
|
| 454 | + else |
|
| 455 | + { |
|
| 456 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 457 | + } |
|
| 458 | + } |
|
| 459 | + } |
|
| 460 | + else |
|
| 461 | + { |
|
| 462 | + echo "<a href=\"../announcements/announcements.php?origin=$origin&ann_id=$ann_id\" class='$completed' target='_blank'>".shorten($title,($length-3*$level))."</a>"; |
|
| 463 | + } |
|
| 464 | + break; |
|
| 465 | + |
|
| 466 | + case "Link" : |
|
| 467 | + $TABLETOOLLINK = Database::get_course_table(TABLE_LINK); |
|
| 468 | + $result= Database::query("SELECT * FROM $TABLETOOLLINK WHERE id=$id"); |
|
| 469 | + $myrow=Database::fetch_array($result); |
|
| 470 | + |
|
| 471 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 472 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 473 | + if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 474 | + $desc=$row['description']; |
|
| 475 | + echo str_repeat(" >",$level); |
|
| 476 | + |
|
| 477 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 478 | + if ($icon != 'nolink') |
|
| 479 | + { |
|
| 480 | + if ($completed=='completed') { |
|
| 481 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 482 | + } else { |
|
| 483 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 484 | + //echo " "; |
|
| 485 | + } |
|
| 486 | + } |
|
| 487 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 488 | + |
|
| 489 | + if ($myrow["title"]=='') |
|
| 490 | + { |
|
| 491 | + echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; |
|
| 492 | + return(true); |
|
| 493 | + } |
|
| 494 | + |
|
| 495 | + if ($icon == 'nolink') { return(shorten($myrow["title"],$length)); } |
|
| 496 | + if ($icon == 'icon') |
|
| 497 | + { |
|
| 498 | + if ($linktype=='Link _self') { echo "<img src='../img/links.gif' align=\"absmiddle\" alt='links'>"; } |
|
| 499 | + else { echo "<img src='../img/link_blank.gif' align=\"absmiddle\" alt='blank links'>"; } |
|
| 500 | + } |
|
| 501 | + $thelink=$myrow["url"]; |
|
| 502 | + if ($builder != 'builder') |
|
| 503 | + { |
|
| 504 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path\" class='$completed'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 505 | + $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path"; |
|
| 506 | + if ($desc != '') |
|
| 507 | + { |
|
| 508 | + if ($icon != 'wrap') |
|
| 509 | + { |
|
| 510 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 511 | + } |
|
| 512 | + else |
|
| 513 | + { |
|
| 514 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 515 | + } |
|
| 516 | + } |
|
| 517 | + } |
|
| 518 | + else |
|
| 519 | + { |
|
| 520 | + echo "<a href=\"$thelink\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 521 | + } |
|
| 522 | + break; |
|
| 523 | + |
|
| 524 | + case "Exercise": |
|
| 525 | + $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
|
| 526 | + $result= Database::query("SELECT * FROM $TBL_EXERCICES WHERE id=$id"); |
|
| 527 | + $myrow=Database::fetch_array($result); |
|
| 528 | + |
|
| 529 | + if ($builder=='builder') { $origin='builder'; } |
|
| 530 | + //this is needed for the exercise_submit.php can delete the session info about tests |
|
| 531 | + |
|
| 532 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 533 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 534 | + if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 535 | + $desc=$row['description']; |
|
| 536 | + echo str_repeat(" >",$level); |
|
| 537 | + |
|
| 538 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 539 | + if ($icon != 'nolink') |
|
| 540 | + { |
|
| 541 | + if ($completed=='completed') { |
|
| 542 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 543 | + } else { |
|
| 544 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 545 | + //echo " "; |
|
| 546 | + } |
|
| 547 | + } |
|
| 548 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 549 | + |
|
| 550 | + if ($myrow["title"]=='') { |
|
| 551 | + echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; |
|
| 552 | + return(true); |
|
| 553 | + } |
|
| 554 | + |
|
| 555 | + if ($icon == 'nolink') { return(shorten($myrow["title"],$length)); } |
|
| 556 | + if ($icon == 'icon') { echo "<img src='../img/quiz.gif' align=\"absmiddle\" alt='quizz'>"; } |
|
| 557 | + if ($builder != 'builder') |
|
| 558 | + { |
|
| 559 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path\" class='$completed'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 560 | + $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path"; |
|
| 561 | + if ($desc != '') |
|
| 562 | + { |
|
| 563 | + if ($icon != 'wrap') |
|
| 564 | + { |
|
| 565 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 566 | + } |
|
| 567 | + else |
|
| 568 | + { |
|
| 569 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 570 | + } |
|
| 571 | + } |
|
| 572 | + } |
|
| 573 | + else |
|
| 574 | + { |
|
| 575 | + echo "<a href=\"../exercise/exercise_submit.php?origin=$origin&exerciseId=".$myrow["id"]."\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 576 | + } |
|
| 577 | + break; |
|
| 578 | + |
|
| 579 | + case "HotPotatoes": |
|
| 580 | + $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT); |
|
| 581 | + $documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
|
| 582 | + $result = Database::query("SELECT * FROM ".$TBL_DOCUMENT." WHERE id=$id"); |
|
| 583 | + $myrow= Database::fetch_array($result); |
|
| 584 | + $path=$myrow["path"]; |
|
| 585 | + $name=GetQuizName($path,$documentPath); |
|
| 586 | + |
|
| 587 | + if ($builder=='builder') { $origin='builder'; } |
|
| 588 | + //this is needed for the exercise_submit.php can delete the session info about tests |
|
| 589 | + |
|
| 590 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 591 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 592 | + if ($row['title'] != '') { $name=$row['title']; } |
|
| 593 | + $desc=$row['description']; |
|
| 594 | + echo str_repeat(" >",$level); |
|
| 595 | + |
|
| 596 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 597 | + if ($icon != 'nolink') |
|
| 598 | + { |
|
| 599 | + if ($completed=='completed') { |
|
| 600 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 601 | + } else { |
|
| 602 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 603 | + //echo " "; |
|
| 604 | + } |
|
| 605 | + } |
|
| 606 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 607 | + |
|
| 608 | + if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 609 | + |
|
| 610 | + if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 611 | + if ($icon == 'icon') { echo "<img src='../img/jqz.gif' align=\"absmiddle\" alt='hot potatoes'>"; } |
|
| 612 | + |
|
| 613 | + $cid = $_course['official_code']; |
|
| 614 | + |
|
| 615 | + if ($builder != 'builder') |
|
| 616 | + { |
|
| 617 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; |
|
| 618 | + $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path"; |
|
| 619 | + if ($desc != '') |
|
| 620 | + { |
|
| 621 | + if ($icon != 'wrap') |
|
| 622 | + { |
|
| 623 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 624 | + } |
|
| 625 | + else |
|
| 626 | + { |
|
| 627 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 628 | + } |
|
| 629 | + } |
|
| 630 | + } |
|
| 631 | + else |
|
| 632 | + { |
|
| 633 | + echo " <a href=\"../exercise/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 634 | + } |
|
| 635 | + break; |
|
| 636 | + |
|
| 637 | + case "Forum": |
|
| 638 | + $TBL_FORUMS = Database::get_course_table(TABLE_FORUM); |
|
| 639 | + $result= Database::query("SELECT * FROM $TBL_FORUMS WHERE forum_id=$id"); |
|
| 640 | + $myrow=Database::fetch_array($result); |
|
| 641 | + |
|
| 642 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 643 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 644 | + if ($row['title'] != '') { $myrow["forum_name"]=$row['title']; } |
|
| 645 | + $desc=$row['description']; |
|
| 646 | + echo str_repeat(" >",$level); |
|
| 647 | + |
|
| 648 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 649 | + if ($icon != 'nolink') |
|
| 650 | + { |
|
| 651 | + if ($completed=='completed') { |
|
| 652 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 653 | + } else { |
|
| 654 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 655 | + //echo " "; |
|
| 656 | + } |
|
| 657 | + } |
|
| 658 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 659 | + |
|
| 660 | + if ($myrow["forum_name"]=='') { $type="Forum"; echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 661 | + |
|
| 662 | + if ($icon == 'nolink') { return(shorten($myrow["forum_name"],$length)); } |
|
| 663 | + if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; } |
|
| 664 | + $forumparameters="forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]; |
|
| 665 | + if ($builder != 'builder') |
|
| 666 | + { |
|
| 667 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path\" class='$completed'>".shorten($myrow["forum_name"],($length-3*$level))."</a>"; |
|
| 668 | + $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path"; |
|
| 669 | + if ($desc != '') |
|
| 670 | + { |
|
| 671 | + if ($icon != 'wrap') |
|
| 672 | + { |
|
| 673 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 674 | + } |
|
| 675 | + else |
|
| 676 | + { |
|
| 677 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 678 | + } |
|
| 679 | + } |
|
| 680 | + } |
|
| 681 | + else |
|
| 682 | + { |
|
| 683 | + echo "<a href=\"../phpbb/viewforum.php?$forumparameters\" class='$completed' target='_blank'>".shorten($myrow["forum_name"],($length-3*$level))."</a>"; |
|
| 684 | + } |
|
| 685 | + break; |
|
| 686 | + |
|
| 687 | + case "Thread": //forum post |
|
| 688 | 688 | //deprecated |
| 689 | - $tbl_topics = $_course['dbNameGlu'].'bb_topics'; |
|
| 690 | - $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
|
| 691 | - $TBL_FORUMS = $_course['dbNameGlu']."bb_forums"; |
|
| 692 | - $sql="SELECT * FROM $tbl_topics where topic_id=$id"; |
|
| 693 | - $result= Database::query($sql); |
|
| 694 | - $myrow=Database::fetch_array($result); |
|
| 695 | - |
|
| 696 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 697 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 698 | - if ($row['title'] != '') { $myrow["topic_title"]=$row['title']; } |
|
| 699 | - $desc=$row['description']; |
|
| 700 | - echo str_repeat(" >",$level); |
|
| 701 | - |
|
| 702 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 703 | - if ($icon != 'nolink') |
|
| 704 | - { |
|
| 705 | - if ($completed=='completed') { |
|
| 706 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 707 | - } else { |
|
| 708 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 709 | - //echo " "; |
|
| 710 | - } |
|
| 711 | - } |
|
| 712 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 713 | - |
|
| 714 | - if ($myrow["topic_title"]=='') { $type="Forum Post"; echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 715 | - |
|
| 716 | - if ($icon == 'nolink') { return(shorten($myrow["topic_title"],$length)); } |
|
| 717 | - if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; } |
|
| 718 | - if ($builder != 'builder') |
|
| 719 | - { |
|
| 720 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path\" class='$completed'>".shorten($myrow["topic_title"],($length-3*$level))."</a>"; |
|
| 721 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path"; |
|
| 722 | - if ($desc != '') |
|
| 723 | - { |
|
| 724 | - if ($icon != 'wrap') |
|
| 725 | - { |
|
| 726 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 727 | - } |
|
| 728 | - else |
|
| 729 | - { |
|
| 730 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 731 | - } |
|
| 732 | - } |
|
| 733 | - } |
|
| 734 | - else |
|
| 735 | - { |
|
| 736 | - echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow["topic_title"],($length-3*$level))."</a>"; |
|
| 737 | - } |
|
| 738 | - break; |
|
| 739 | - |
|
| 740 | - case "Post": |
|
| 689 | + $tbl_topics = $_course['dbNameGlu'].'bb_topics'; |
|
| 690 | + $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
|
| 691 | + $TBL_FORUMS = $_course['dbNameGlu']."bb_forums"; |
|
| 692 | + $sql="SELECT * FROM $tbl_topics where topic_id=$id"; |
|
| 693 | + $result= Database::query($sql); |
|
| 694 | + $myrow=Database::fetch_array($result); |
|
| 695 | + |
|
| 696 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 697 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 698 | + if ($row['title'] != '') { $myrow["topic_title"]=$row['title']; } |
|
| 699 | + $desc=$row['description']; |
|
| 700 | + echo str_repeat(" >",$level); |
|
| 701 | + |
|
| 702 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 703 | + if ($icon != 'nolink') |
|
| 704 | + { |
|
| 705 | + if ($completed=='completed') { |
|
| 706 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 707 | + } else { |
|
| 708 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 709 | + //echo " "; |
|
| 710 | + } |
|
| 711 | + } |
|
| 712 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 713 | + |
|
| 714 | + if ($myrow["topic_title"]=='') { $type="Forum Post"; echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 715 | + |
|
| 716 | + if ($icon == 'nolink') { return(shorten($myrow["topic_title"],$length)); } |
|
| 717 | + if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; } |
|
| 718 | + if ($builder != 'builder') |
|
| 719 | + { |
|
| 720 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path\" class='$completed'>".shorten($myrow["topic_title"],($length-3*$level))."</a>"; |
|
| 721 | + $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path"; |
|
| 722 | + if ($desc != '') |
|
| 723 | + { |
|
| 724 | + if ($icon != 'wrap') |
|
| 725 | + { |
|
| 726 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 727 | + } |
|
| 728 | + else |
|
| 729 | + { |
|
| 730 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 731 | + } |
|
| 732 | + } |
|
| 733 | + } |
|
| 734 | + else |
|
| 735 | + { |
|
| 736 | + echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow["topic_title"],($length-3*$level))."</a>"; |
|
| 737 | + } |
|
| 738 | + break; |
|
| 739 | + |
|
| 740 | + case "Post": |
|
| 741 | 741 | //deprecated |
| 742 | - $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
|
| 743 | - $tbl_posts_text = $_course['dbNameGlu'].'bb_posts_text'; |
|
| 744 | - $TBL_FORUMS = $_course['dbNameGlu']."bb_forums"; |
|
| 745 | - $result= Database::query("SELECT * FROM $tbl_posts where post_id=$id"); |
|
| 746 | - $myrow=Database::fetch_array($result); |
|
| 747 | - // grabbing the title of the post |
|
| 748 | - $sql_titel="SELECT * FROM $tbl_posts_text WHERE post_id=".$myrow["post_id"]; |
|
| 749 | - $result_titel=Database::query($sql_titel); |
|
| 750 | - $myrow_titel=Database::fetch_array($result_titel); |
|
| 751 | - |
|
| 752 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 753 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 754 | - if ($row['title'] != '') { $myrow_titel["post_title"]=$row['title']; } |
|
| 755 | - $desc=$row['description']; |
|
| 756 | - echo str_repeat(" >",$level); |
|
| 757 | - |
|
| 758 | - $posternom=$myrow['nom']; $posterprenom=$myrow['prenom']; |
|
| 759 | - $posttime=$myrow['post_time']; $posttext=$myrow_titel['post_text']; |
|
| 760 | - $posttitle=$myrow_titel['post_title']; |
|
| 761 | - $posttext = str_replace('"',"'",$posttext); |
|
| 762 | - |
|
| 763 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 764 | - if ($icon != 'nolink') |
|
| 765 | - { |
|
| 766 | - if ($completed=='completed') { |
|
| 767 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 768 | - } else { |
|
| 769 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 770 | - //echo " "; |
|
| 771 | - } |
|
| 772 | - } |
|
| 773 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 774 | - |
|
| 775 | - if ($myrow_titel["post_title"]=='') |
|
| 776 | - { |
|
| 777 | - $type="Forum"; |
|
| 778 | - echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); |
|
| 779 | - } |
|
| 780 | - |
|
| 781 | - if ($icon == 'nolink') { return(shorten($myrow_titel["post_title"],$length)); } |
|
| 782 | - if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; } |
|
| 783 | - if ($builder != 'builder') |
|
| 784 | - { |
|
| 785 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Post&origin=$origin&posternom=$posternom&posterprenom=$posterprenom&posttime=$posttime&posttext=$posttext&posttitle=$posttitle#$id_in_path\" class='$completed'>".shorten($myrow_titel["post_title"],($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Post&origin=$origin&posternom=$posternom&posterprenom=$posterprenom&posttime=$posttime&posttext=$posttext&posttitle=$posttitle#$id_in_path"; |
|
| 786 | - if ($desc != '') |
|
| 787 | - { |
|
| 788 | - if ($icon != 'wrap') |
|
| 789 | - { |
|
| 790 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 791 | - } |
|
| 792 | - else |
|
| 793 | - { |
|
| 794 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 795 | - } |
|
| 796 | - } |
|
| 797 | - } |
|
| 798 | - else |
|
| 799 | - { |
|
| 800 | - echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow_titel["post_title"],($length-3*$level))."</a>"; |
|
| 801 | - } |
|
| 802 | - break; |
|
| 803 | - |
|
| 804 | - case "Document": |
|
| 805 | - $dbTable = Database::get_course_table(TABLE_DOCUMENT); |
|
| 806 | - $result=Database::query("SELECT * FROM $dbTable WHERE id=$id"); |
|
| 807 | - $myrow=Database::fetch_array($result); |
|
| 808 | - |
|
| 809 | - $pathname=explode("/",$myrow["path"]); // making a correct name for the link |
|
| 810 | - $last=count($pathname)-1; // making a correct name for the link |
|
| 811 | - $filename=$pathname[$last]; // making a correct name for the link |
|
| 812 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 813 | - |
|
| 814 | - echo str_repeat(" >",$level); |
|
| 815 | - |
|
| 816 | - if ($icon != 'nolink') { |
|
| 817 | - if ($completed=='completed') { |
|
| 818 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 819 | - } else { |
|
| 820 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 821 | - //echo " "; |
|
| 822 | - } |
|
| 823 | - } |
|
| 824 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 825 | - $image=choose_image($filename); |
|
| 826 | - |
|
| 827 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 828 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 829 | - if ($row['title'] != '') { $filename=$row['title']; } |
|
| 830 | - $desc=$row['description']; |
|
| 831 | - |
|
| 832 | - if (($myrow["path"]=='') and ($filename=='')) { |
|
| 833 | - echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; |
|
| 834 | - return(true); |
|
| 835 | - } |
|
| 836 | - |
|
| 837 | - if ($icon == 'nolink') { return(shorten($filename,$length)); } |
|
| 838 | - if ($icon == 'icon') { echo "<img src='../img/$image' align=\"absmiddle\" alt='$image'>"; } |
|
| 839 | - if ($builder != 'builder') |
|
| 840 | - { |
|
| 841 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path\" class='$completed'>".shorten($filename,($length-3*$level))."</a>"; |
|
| 842 | - if ($desc != '') |
|
| 843 | - { |
|
| 844 | - if ($icon != 'wrap') |
|
| 845 | - { |
|
| 846 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 847 | - } |
|
| 848 | - else |
|
| 849 | - { |
|
| 850 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 851 | - } |
|
| 852 | - } $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path"; |
|
| 853 | - } |
|
| 854 | - else |
|
| 855 | - { |
|
| 856 | - $enableDocumentParsing='yes'; |
|
| 857 | - if (!$enableDocumentParsing) |
|
| 858 | - { //this is the solution for the non-parsing version in the builder |
|
| 859 | - $file=urlencode($myrow["path"]); |
|
| 860 | - echo "<a href='../document/showinframes.php?file=$file' class='$completed' $hyperlink_target_parameter>".shorten($filename,($length-3*$level))."</a>"; |
|
| 861 | - } |
|
| 862 | - else |
|
| 863 | - { |
|
| 864 | - echo "<a href=\"../document/download.php?doc_url=".$myrow["path"]."\" class='$completed' $hyperlink_target_parameter>".shorten($filename,($length-3*$level))."</a>"; |
|
| 865 | - } |
|
| 866 | - } |
|
| 867 | - break; |
|
| 868 | - |
|
| 869 | - case "Assignments": |
|
| 870 | - $name=get_lang('Assignments'); |
|
| 871 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 872 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 873 | - if ($row['title'] != '') { $name=$row['title']; } |
|
| 874 | - $desc=$row['description']; |
|
| 875 | - echo str_repeat(" >",$level); |
|
| 876 | - |
|
| 877 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 878 | - if ($icon != 'nolink') |
|
| 879 | - { |
|
| 880 | - if ($completed=='completed') { |
|
| 881 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 882 | - } else { |
|
| 883 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 884 | - //echo " "; |
|
| 885 | - } |
|
| 886 | - } |
|
| 887 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 888 | - |
|
| 889 | - if ($name=='') |
|
| 890 | - { |
|
| 891 | - echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); |
|
| 892 | - } |
|
| 893 | - |
|
| 894 | - if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 895 | - if ($icon == 'icon') { echo "<img src='../img/works.gif' align=\"absmiddle\">"; } |
|
| 896 | - if ($builder != 'builder') |
|
| 897 | - { |
|
| 898 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path"; |
|
| 899 | - if ($desc != '') |
|
| 900 | - { |
|
| 901 | - if ($icon != 'wrap') |
|
| 902 | - { |
|
| 903 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 904 | - } |
|
| 905 | - else |
|
| 906 | - { |
|
| 907 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 908 | - } |
|
| 909 | - } |
|
| 910 | - } |
|
| 911 | - else |
|
| 912 | - { |
|
| 913 | - echo "<a href=\"../work/work.php\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 914 | - } |
|
| 915 | - break; |
|
| 916 | - case "Dropbox": |
|
| 917 | - $name=get_lang('Dropbox'); |
|
| 918 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 919 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 920 | - if ($row['title'] != '') { $name=$row['title']; } |
|
| 921 | - $desc=$row['description']; |
|
| 922 | - echo str_repeat(" >",$level); |
|
| 923 | - |
|
| 924 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 925 | - if ($icon != 'nolink') { |
|
| 926 | - if ($completed=='completed') { |
|
| 927 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 928 | - } else { |
|
| 929 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 930 | - //echo " "; |
|
| 931 | - } |
|
| 932 | - } |
|
| 933 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 934 | - |
|
| 935 | - if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 936 | - |
|
| 937 | - if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 938 | - if ($icon == 'icon') { echo "<img src='../img/dropbox.gif' align=\"absmiddle\">"; } |
|
| 939 | - |
|
| 940 | - if ($builder != 'builder') |
|
| 941 | - { |
|
| 942 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path"; |
|
| 943 | - if ($desc != '') { |
|
| 944 | - if ($icon != 'wrap') { |
|
| 945 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 946 | - else { |
|
| 947 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 948 | - } |
|
| 949 | - } else { |
|
| 950 | - echo "<a href=\"../dropbox/index.php\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 951 | - } |
|
| 952 | - break; |
|
| 953 | - case "Introduction_text": |
|
| 954 | - $name=get_lang('IntroductionText'); |
|
| 955 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 956 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 957 | - if ($row['title'] != '') { $name=$row['title']; } |
|
| 958 | - $desc=$row['description']; |
|
| 959 | - echo str_repeat(" >",$level); |
|
| 960 | - |
|
| 961 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 962 | - if ($icon != 'nolink') { |
|
| 963 | - if ($completed=='completed') { |
|
| 964 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 965 | - } else { |
|
| 966 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 967 | - //echo " "; |
|
| 968 | - } |
|
| 969 | - } |
|
| 970 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 971 | - |
|
| 972 | - if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 973 | - |
|
| 974 | - if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 975 | - if ($icon == 'icon') { echo "<img src='../img/introduction.gif' align=\"absmiddle\" alt='introduction'>"; } |
|
| 976 | - |
|
| 977 | - if ($builder != 'builder') |
|
| 978 | - { |
|
| 979 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; |
|
| 980 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path"; |
|
| 981 | - if ($desc != '') { |
|
| 982 | - if ($icon != 'wrap') { |
|
| 983 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 984 | - else { |
|
| 985 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 986 | - } |
|
| 987 | - } else { |
|
| 988 | - $s = api_get_path(WEB_COURSE_PATH)."$_cid/index.php?intro_cmdEdit=1"; |
|
| 989 | - echo "<a href=\"$s\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 990 | - } |
|
| 991 | - break; |
|
| 992 | - case "Course_description": |
|
| 993 | - $name=get_lang('CourseDescription'); |
|
| 994 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 995 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 996 | - if ($row['title'] != '') { $name=$row['title']; } |
|
| 997 | - $desc=$row['description']; |
|
| 998 | - echo str_repeat(" >",$level); |
|
| 999 | - |
|
| 1000 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 1001 | - if ($icon != 'nolink') { |
|
| 1002 | - if ($completed=='completed') { |
|
| 1003 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 1004 | - } else { |
|
| 1005 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 1006 | - //echo " "; |
|
| 1007 | - } |
|
| 1008 | - } |
|
| 1009 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 1010 | - |
|
| 1011 | - if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 1012 | - |
|
| 1013 | - if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 1014 | - if ($icon == 'icon') { echo "<img src='../img/info.gif' align=\"absmiddle\" alt='info'>"; } |
|
| 1015 | - |
|
| 1016 | - if ($builder != 'builder') |
|
| 1017 | - { |
|
| 1018 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path"; |
|
| 1019 | - if ($desc != '') { |
|
| 1020 | - if ($icon != 'wrap') { |
|
| 1021 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 1022 | - else { |
|
| 1023 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 1024 | - } |
|
| 1025 | - } else { |
|
| 1026 | - $s=api_get_path(WEB_CODE_PATH)."course_description"; |
|
| 1027 | - echo "<a href=\"$s\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 1028 | - } |
|
| 1029 | - break; |
|
| 1030 | - case "Groups": |
|
| 1031 | - $name=get_lang('Groups'); |
|
| 1032 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1033 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1034 | - if ($row['title'] != '') { $name=$row['title']; } |
|
| 1035 | - $desc=$row['description']; |
|
| 1036 | - echo str_repeat(" >",$level); |
|
| 1037 | - |
|
| 1038 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 1039 | - if ($icon != 'nolink') { |
|
| 1040 | - if ($completed=='completed') { |
|
| 1041 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 1042 | - } else { |
|
| 1043 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 1044 | - //echo " "; |
|
| 1045 | - } |
|
| 1046 | - } |
|
| 1047 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 1048 | - |
|
| 1049 | - if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 1050 | - |
|
| 1051 | - if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 1052 | - if ($icon == 'icon') { echo "<img src='../img/group.gif' align=\"absmiddle\" alt='group'>"; } |
|
| 1053 | - |
|
| 1054 | - if ($builder != 'builder') |
|
| 1055 | - { |
|
| 1056 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path"; |
|
| 1057 | - if ($desc != '') { |
|
| 1058 | - if ($icon != 'wrap') { |
|
| 1059 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 1060 | - else { |
|
| 1061 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 1062 | - } |
|
| 1063 | - } else { |
|
| 1064 | - echo "<a href=\"../group/group.php?origin=$origin\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 1065 | - } |
|
| 1066 | - break; |
|
| 1067 | - case "Users": |
|
| 1068 | - $name=get_lang('Users'); |
|
| 1069 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1070 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1071 | - if ($row['title'] != '') { $name=$row['title']; } |
|
| 1072 | - $desc=$row['description']; |
|
| 1073 | - echo str_repeat(" >",$level); |
|
| 1074 | - |
|
| 1075 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 1076 | - if ($icon != 'nolink') { |
|
| 1077 | - if ($completed=='completed') { |
|
| 1078 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 1079 | - } else { |
|
| 1080 | - echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 1081 | - //echo " "; |
|
| 1082 | - } |
|
| 1083 | - } |
|
| 1084 | - if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 1085 | - |
|
| 1086 | - if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 1087 | - |
|
| 1088 | - if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 1089 | - if ($icon == 'icon') { echo "<img src='../img/members.gif' align=\"absmiddle\" alt='members'>"; } |
|
| 1090 | - |
|
| 1091 | - if ($builder != 'builder') |
|
| 1092 | - { |
|
| 1093 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path"; |
|
| 1094 | - if ($desc != '') { |
|
| 1095 | - if ($icon != 'wrap') { |
|
| 1096 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 1097 | - else { |
|
| 1098 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 1099 | - } |
|
| 1100 | - } else { |
|
| 1101 | - echo "<a href=\"../user/user.php?origin=$origin\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 1102 | - } |
|
| 1103 | - break; |
|
| 1104 | - }//end huge switch-statement |
|
| 742 | + $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
|
| 743 | + $tbl_posts_text = $_course['dbNameGlu'].'bb_posts_text'; |
|
| 744 | + $TBL_FORUMS = $_course['dbNameGlu']."bb_forums"; |
|
| 745 | + $result= Database::query("SELECT * FROM $tbl_posts where post_id=$id"); |
|
| 746 | + $myrow=Database::fetch_array($result); |
|
| 747 | + // grabbing the title of the post |
|
| 748 | + $sql_titel="SELECT * FROM $tbl_posts_text WHERE post_id=".$myrow["post_id"]; |
|
| 749 | + $result_titel=Database::query($sql_titel); |
|
| 750 | + $myrow_titel=Database::fetch_array($result_titel); |
|
| 751 | + |
|
| 752 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 753 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 754 | + if ($row['title'] != '') { $myrow_titel["post_title"]=$row['title']; } |
|
| 755 | + $desc=$row['description']; |
|
| 756 | + echo str_repeat(" >",$level); |
|
| 757 | + |
|
| 758 | + $posternom=$myrow['nom']; $posterprenom=$myrow['prenom']; |
|
| 759 | + $posttime=$myrow['post_time']; $posttext=$myrow_titel['post_text']; |
|
| 760 | + $posttitle=$myrow_titel['post_title']; |
|
| 761 | + $posttext = str_replace('"',"'",$posttext); |
|
| 762 | + |
|
| 763 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 764 | + if ($icon != 'nolink') |
|
| 765 | + { |
|
| 766 | + if ($completed=='completed') { |
|
| 767 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 768 | + } else { |
|
| 769 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 770 | + //echo " "; |
|
| 771 | + } |
|
| 772 | + } |
|
| 773 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 774 | + |
|
| 775 | + if ($myrow_titel["post_title"]=='') |
|
| 776 | + { |
|
| 777 | + $type="Forum"; |
|
| 778 | + echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); |
|
| 779 | + } |
|
| 780 | + |
|
| 781 | + if ($icon == 'nolink') { return(shorten($myrow_titel["post_title"],$length)); } |
|
| 782 | + if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; } |
|
| 783 | + if ($builder != 'builder') |
|
| 784 | + { |
|
| 785 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Post&origin=$origin&posternom=$posternom&posterprenom=$posterprenom&posttime=$posttime&posttext=$posttext&posttitle=$posttitle#$id_in_path\" class='$completed'>".shorten($myrow_titel["post_title"],($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Post&origin=$origin&posternom=$posternom&posterprenom=$posterprenom&posttime=$posttime&posttext=$posttext&posttitle=$posttitle#$id_in_path"; |
|
| 786 | + if ($desc != '') |
|
| 787 | + { |
|
| 788 | + if ($icon != 'wrap') |
|
| 789 | + { |
|
| 790 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 791 | + } |
|
| 792 | + else |
|
| 793 | + { |
|
| 794 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 795 | + } |
|
| 796 | + } |
|
| 797 | + } |
|
| 798 | + else |
|
| 799 | + { |
|
| 800 | + echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow_titel["post_title"],($length-3*$level))."</a>"; |
|
| 801 | + } |
|
| 802 | + break; |
|
| 803 | + |
|
| 804 | + case "Document": |
|
| 805 | + $dbTable = Database::get_course_table(TABLE_DOCUMENT); |
|
| 806 | + $result=Database::query("SELECT * FROM $dbTable WHERE id=$id"); |
|
| 807 | + $myrow=Database::fetch_array($result); |
|
| 808 | + |
|
| 809 | + $pathname=explode("/",$myrow["path"]); // making a correct name for the link |
|
| 810 | + $last=count($pathname)-1; // making a correct name for the link |
|
| 811 | + $filename=$pathname[$last]; // making a correct name for the link |
|
| 812 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 813 | + |
|
| 814 | + echo str_repeat(" >",$level); |
|
| 815 | + |
|
| 816 | + if ($icon != 'nolink') { |
|
| 817 | + if ($completed=='completed') { |
|
| 818 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 819 | + } else { |
|
| 820 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 821 | + //echo " "; |
|
| 822 | + } |
|
| 823 | + } |
|
| 824 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 825 | + $image=choose_image($filename); |
|
| 826 | + |
|
| 827 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 828 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 829 | + if ($row['title'] != '') { $filename=$row['title']; } |
|
| 830 | + $desc=$row['description']; |
|
| 831 | + |
|
| 832 | + if (($myrow["path"]=='') and ($filename=='')) { |
|
| 833 | + echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; |
|
| 834 | + return(true); |
|
| 835 | + } |
|
| 836 | + |
|
| 837 | + if ($icon == 'nolink') { return(shorten($filename,$length)); } |
|
| 838 | + if ($icon == 'icon') { echo "<img src='../img/$image' align=\"absmiddle\" alt='$image'>"; } |
|
| 839 | + if ($builder != 'builder') |
|
| 840 | + { |
|
| 841 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path\" class='$completed'>".shorten($filename,($length-3*$level))."</a>"; |
|
| 842 | + if ($desc != '') |
|
| 843 | + { |
|
| 844 | + if ($icon != 'wrap') |
|
| 845 | + { |
|
| 846 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 847 | + } |
|
| 848 | + else |
|
| 849 | + { |
|
| 850 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 851 | + } |
|
| 852 | + } $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path"; |
|
| 853 | + } |
|
| 854 | + else |
|
| 855 | + { |
|
| 856 | + $enableDocumentParsing='yes'; |
|
| 857 | + if (!$enableDocumentParsing) |
|
| 858 | + { //this is the solution for the non-parsing version in the builder |
|
| 859 | + $file=urlencode($myrow["path"]); |
|
| 860 | + echo "<a href='../document/showinframes.php?file=$file' class='$completed' $hyperlink_target_parameter>".shorten($filename,($length-3*$level))."</a>"; |
|
| 861 | + } |
|
| 862 | + else |
|
| 863 | + { |
|
| 864 | + echo "<a href=\"../document/download.php?doc_url=".$myrow["path"]."\" class='$completed' $hyperlink_target_parameter>".shorten($filename,($length-3*$level))."</a>"; |
|
| 865 | + } |
|
| 866 | + } |
|
| 867 | + break; |
|
| 868 | + |
|
| 869 | + case "Assignments": |
|
| 870 | + $name=get_lang('Assignments'); |
|
| 871 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 872 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 873 | + if ($row['title'] != '') { $name=$row['title']; } |
|
| 874 | + $desc=$row['description']; |
|
| 875 | + echo str_repeat(" >",$level); |
|
| 876 | + |
|
| 877 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 878 | + if ($icon != 'nolink') |
|
| 879 | + { |
|
| 880 | + if ($completed=='completed') { |
|
| 881 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 882 | + } else { |
|
| 883 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 884 | + //echo " "; |
|
| 885 | + } |
|
| 886 | + } |
|
| 887 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 888 | + |
|
| 889 | + if ($name=='') |
|
| 890 | + { |
|
| 891 | + echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); |
|
| 892 | + } |
|
| 893 | + |
|
| 894 | + if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 895 | + if ($icon == 'icon') { echo "<img src='../img/works.gif' align=\"absmiddle\">"; } |
|
| 896 | + if ($builder != 'builder') |
|
| 897 | + { |
|
| 898 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path"; |
|
| 899 | + if ($desc != '') |
|
| 900 | + { |
|
| 901 | + if ($icon != 'wrap') |
|
| 902 | + { |
|
| 903 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 904 | + } |
|
| 905 | + else |
|
| 906 | + { |
|
| 907 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 908 | + } |
|
| 909 | + } |
|
| 910 | + } |
|
| 911 | + else |
|
| 912 | + { |
|
| 913 | + echo "<a href=\"../work/work.php\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 914 | + } |
|
| 915 | + break; |
|
| 916 | + case "Dropbox": |
|
| 917 | + $name=get_lang('Dropbox'); |
|
| 918 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 919 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 920 | + if ($row['title'] != '') { $name=$row['title']; } |
|
| 921 | + $desc=$row['description']; |
|
| 922 | + echo str_repeat(" >",$level); |
|
| 923 | + |
|
| 924 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 925 | + if ($icon != 'nolink') { |
|
| 926 | + if ($completed=='completed') { |
|
| 927 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 928 | + } else { |
|
| 929 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 930 | + //echo " "; |
|
| 931 | + } |
|
| 932 | + } |
|
| 933 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 934 | + |
|
| 935 | + if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 936 | + |
|
| 937 | + if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 938 | + if ($icon == 'icon') { echo "<img src='../img/dropbox.gif' align=\"absmiddle\">"; } |
|
| 939 | + |
|
| 940 | + if ($builder != 'builder') |
|
| 941 | + { |
|
| 942 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path"; |
|
| 943 | + if ($desc != '') { |
|
| 944 | + if ($icon != 'wrap') { |
|
| 945 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 946 | + else { |
|
| 947 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 948 | + } |
|
| 949 | + } else { |
|
| 950 | + echo "<a href=\"../dropbox/index.php\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 951 | + } |
|
| 952 | + break; |
|
| 953 | + case "Introduction_text": |
|
| 954 | + $name=get_lang('IntroductionText'); |
|
| 955 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 956 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 957 | + if ($row['title'] != '') { $name=$row['title']; } |
|
| 958 | + $desc=$row['description']; |
|
| 959 | + echo str_repeat(" >",$level); |
|
| 960 | + |
|
| 961 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 962 | + if ($icon != 'nolink') { |
|
| 963 | + if ($completed=='completed') { |
|
| 964 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 965 | + } else { |
|
| 966 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 967 | + //echo " "; |
|
| 968 | + } |
|
| 969 | + } |
|
| 970 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 971 | + |
|
| 972 | + if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 973 | + |
|
| 974 | + if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 975 | + if ($icon == 'icon') { echo "<img src='../img/introduction.gif' align=\"absmiddle\" alt='introduction'>"; } |
|
| 976 | + |
|
| 977 | + if ($builder != 'builder') |
|
| 978 | + { |
|
| 979 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; |
|
| 980 | + $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path"; |
|
| 981 | + if ($desc != '') { |
|
| 982 | + if ($icon != 'wrap') { |
|
| 983 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 984 | + else { |
|
| 985 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 986 | + } |
|
| 987 | + } else { |
|
| 988 | + $s = api_get_path(WEB_COURSE_PATH)."$_cid/index.php?intro_cmdEdit=1"; |
|
| 989 | + echo "<a href=\"$s\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 990 | + } |
|
| 991 | + break; |
|
| 992 | + case "Course_description": |
|
| 993 | + $name=get_lang('CourseDescription'); |
|
| 994 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 995 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 996 | + if ($row['title'] != '') { $name=$row['title']; } |
|
| 997 | + $desc=$row['description']; |
|
| 998 | + echo str_repeat(" >",$level); |
|
| 999 | + |
|
| 1000 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 1001 | + if ($icon != 'nolink') { |
|
| 1002 | + if ($completed=='completed') { |
|
| 1003 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 1004 | + } else { |
|
| 1005 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 1006 | + //echo " "; |
|
| 1007 | + } |
|
| 1008 | + } |
|
| 1009 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 1010 | + |
|
| 1011 | + if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 1012 | + |
|
| 1013 | + if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 1014 | + if ($icon == 'icon') { echo "<img src='../img/info.gif' align=\"absmiddle\" alt='info'>"; } |
|
| 1015 | + |
|
| 1016 | + if ($builder != 'builder') |
|
| 1017 | + { |
|
| 1018 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path"; |
|
| 1019 | + if ($desc != '') { |
|
| 1020 | + if ($icon != 'wrap') { |
|
| 1021 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 1022 | + else { |
|
| 1023 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 1024 | + } |
|
| 1025 | + } else { |
|
| 1026 | + $s=api_get_path(WEB_CODE_PATH)."course_description"; |
|
| 1027 | + echo "<a href=\"$s\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 1028 | + } |
|
| 1029 | + break; |
|
| 1030 | + case "Groups": |
|
| 1031 | + $name=get_lang('Groups'); |
|
| 1032 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1033 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1034 | + if ($row['title'] != '') { $name=$row['title']; } |
|
| 1035 | + $desc=$row['description']; |
|
| 1036 | + echo str_repeat(" >",$level); |
|
| 1037 | + |
|
| 1038 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 1039 | + if ($icon != 'nolink') { |
|
| 1040 | + if ($completed=='completed') { |
|
| 1041 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 1042 | + } else { |
|
| 1043 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 1044 | + //echo " "; |
|
| 1045 | + } |
|
| 1046 | + } |
|
| 1047 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 1048 | + |
|
| 1049 | + if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 1050 | + |
|
| 1051 | + if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 1052 | + if ($icon == 'icon') { echo "<img src='../img/group.gif' align=\"absmiddle\" alt='group'>"; } |
|
| 1053 | + |
|
| 1054 | + if ($builder != 'builder') |
|
| 1055 | + { |
|
| 1056 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path"; |
|
| 1057 | + if ($desc != '') { |
|
| 1058 | + if ($icon != 'wrap') { |
|
| 1059 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 1060 | + else { |
|
| 1061 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 1062 | + } |
|
| 1063 | + } else { |
|
| 1064 | + echo "<a href=\"../group/group.php?origin=$origin\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 1065 | + } |
|
| 1066 | + break; |
|
| 1067 | + case "Users": |
|
| 1068 | + $name=get_lang('Users'); |
|
| 1069 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1070 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1071 | + if ($row['title'] != '') { $name=$row['title']; } |
|
| 1072 | + $desc=$row['description']; |
|
| 1073 | + echo str_repeat(" >",$level); |
|
| 1074 | + |
|
| 1075 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
|
| 1076 | + if ($icon != 'nolink') { |
|
| 1077 | + if ($completed=='completed') { |
|
| 1078 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
|
| 1079 | + } else { |
|
| 1080 | + echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
|
| 1081 | + //echo " "; |
|
| 1082 | + } |
|
| 1083 | + } |
|
| 1084 | + if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
|
| 1085 | + |
|
| 1086 | + if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 1087 | + |
|
| 1088 | + if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 1089 | + if ($icon == 'icon') { echo "<img src='../img/members.gif' align=\"absmiddle\" alt='members'>"; } |
|
| 1090 | + |
|
| 1091 | + if ($builder != 'builder') |
|
| 1092 | + { |
|
| 1093 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path"; |
|
| 1094 | + if ($desc != '') { |
|
| 1095 | + if ($icon != 'wrap') { |
|
| 1096 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 1097 | + else { |
|
| 1098 | + echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 1099 | + } |
|
| 1100 | + } else { |
|
| 1101 | + echo "<a href=\"../user/user.php?origin=$origin\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 1102 | + } |
|
| 1103 | + break; |
|
| 1104 | + }//end huge switch-statement |
|
| 1105 | 1105 | } |
| 1106 | 1106 | |
| 1107 | 1107 | /** |
@@ -1116,253 +1116,253 @@ discard block |
||
| 1116 | 1116 | */ |
| 1117 | 1117 | function get_addedresource_link_in_learnpath($type, $id, $id_in_path) |
| 1118 | 1118 | { |
| 1119 | - global $_course, $learnpath_id, $tbl_learnpath_item, $items; |
|
| 1120 | - global $curDirPath, $_configuration, $enableDocumentParsing, $_user , $_cid; |
|
| 1121 | - |
|
| 1122 | - $hyperlink_target_parameter = ""; //or e.g. target='_blank' |
|
| 1123 | - $builder = 'player'; |
|
| 1124 | - $origin='learnpath'; |
|
| 1125 | - |
|
| 1126 | - $linktype=$type; |
|
| 1127 | - if (($type=="Link _self") or ($type=="Link _blank")) { $type="Link"; } |
|
| 1128 | - |
|
| 1129 | - $link = ''; |
|
| 1130 | - |
|
| 1131 | - switch ($type) |
|
| 1132 | - { |
|
| 1133 | - case "Agenda": |
|
| 1134 | - $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA);; |
|
| 1135 | - $result = Database::query("SELECT * FROM $TABLEAGENDA WHERE id=$id"); |
|
| 1136 | - $myrow=Database::fetch_array($result); |
|
| 1137 | - |
|
| 1138 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1139 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1140 | - if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 1141 | - $desc=$row['description']; |
|
| 1142 | - $agenda_id=$row['item_id']; |
|
| 1143 | - |
|
| 1144 | - if ($builder != 'builder') |
|
| 1145 | - { |
|
| 1146 | - $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path"; |
|
| 1147 | - } |
|
| 1148 | - else |
|
| 1149 | - { |
|
| 1150 | - $link .= "../calendar/agenda.php?origin=$origin&agenda_id=$agenda_id"; |
|
| 1151 | - } |
|
| 1152 | - break; |
|
| 1153 | - |
|
| 1154 | - case "Ad_Valvas": |
|
| 1155 | - $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT); |
|
| 1156 | - $result = Database::query("SELECT * FROM $tbl_announcement WHERE id=$id"); |
|
| 1157 | - $myrow=Database::fetch_array($result); |
|
| 1158 | - |
|
| 1159 | - if ($builder != 'builder') |
|
| 1160 | - { |
|
| 1161 | - $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$id#$id_in_path"; |
|
| 1162 | - } |
|
| 1163 | - else |
|
| 1164 | - { |
|
| 1165 | - $link .= "../announcements/announcements.php?origin=$origin&ann_id=$id"; |
|
| 1166 | - } |
|
| 1167 | - break; |
|
| 1168 | - |
|
| 1169 | - case "Link" : |
|
| 1170 | - $TABLETOOLLINK = Database::get_course_table(TABLE_LINK); |
|
| 1171 | - $result= Database::query("SELECT * FROM $TABLETOOLLINK WHERE id=$id"); |
|
| 1172 | - $myrow=Database::fetch_array($result); |
|
| 1173 | - |
|
| 1174 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1175 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1176 | - |
|
| 1177 | - $thelink=$myrow["url"]; |
|
| 1178 | - if ($builder != 'builder') |
|
| 1179 | - { |
|
| 1180 | - $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path"; |
|
| 1181 | - } |
|
| 1182 | - else |
|
| 1183 | - { |
|
| 1184 | - $link .= $thelink; |
|
| 1185 | - } |
|
| 1186 | - break; |
|
| 1187 | - |
|
| 1188 | - case "Exercise": |
|
| 1189 | - $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
|
| 1190 | - $result= Database::query("SELECT * FROM $TBL_EXERCICES WHERE id=$id"); |
|
| 1191 | - $myrow=Database::fetch_array($result); |
|
| 1192 | - |
|
| 1193 | - if ($builder=='builder') { $origin='builder'; } |
|
| 1194 | - //this is needed for the exercise_submit.php can delete the session info about tests |
|
| 1195 | - |
|
| 1196 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1197 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1198 | - if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 1199 | - |
|
| 1200 | - if ($builder != 'builder') |
|
| 1201 | - { |
|
| 1202 | - $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path"; |
|
| 1203 | - } |
|
| 1204 | - else |
|
| 1205 | - { |
|
| 1206 | - $link .= "../exercise/exercise_submit.php?origin=$origin&exerciseId=".$myrow["id"]; |
|
| 1207 | - } |
|
| 1208 | - break; |
|
| 1209 | - |
|
| 1210 | - case "HotPotatoes": |
|
| 1211 | - $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT); |
|
| 1212 | - $documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
|
| 1213 | - $result = Database::query("SELECT * FROM ".$TBL_DOCUMENT." WHERE id=$id"); |
|
| 1214 | - $myrow= Database::fetch_array($result); |
|
| 1215 | - $path=$myrow["path"]; |
|
| 1216 | - $name=GetQuizName($path,$documentPath); |
|
| 1217 | - |
|
| 1218 | - if ($builder=='builder') { $origin='builder'; } |
|
| 1219 | - |
|
| 1220 | - $cid = $_course['official_code']; |
|
| 1221 | - |
|
| 1222 | - if ($builder != 'builder') |
|
| 1223 | - { |
|
| 1224 | - $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path"; |
|
| 1225 | - } |
|
| 1226 | - else |
|
| 1227 | - { |
|
| 1228 | - $link .= "../exercise/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id'].""; |
|
| 1229 | - } |
|
| 1230 | - break; |
|
| 1231 | - |
|
| 1232 | - case "Forum": |
|
| 1119 | + global $_course, $learnpath_id, $tbl_learnpath_item, $items; |
|
| 1120 | + global $curDirPath, $_configuration, $enableDocumentParsing, $_user , $_cid; |
|
| 1121 | + |
|
| 1122 | + $hyperlink_target_parameter = ""; //or e.g. target='_blank' |
|
| 1123 | + $builder = 'player'; |
|
| 1124 | + $origin='learnpath'; |
|
| 1125 | + |
|
| 1126 | + $linktype=$type; |
|
| 1127 | + if (($type=="Link _self") or ($type=="Link _blank")) { $type="Link"; } |
|
| 1128 | + |
|
| 1129 | + $link = ''; |
|
| 1130 | + |
|
| 1131 | + switch ($type) |
|
| 1132 | + { |
|
| 1133 | + case "Agenda": |
|
| 1134 | + $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA);; |
|
| 1135 | + $result = Database::query("SELECT * FROM $TABLEAGENDA WHERE id=$id"); |
|
| 1136 | + $myrow=Database::fetch_array($result); |
|
| 1137 | + |
|
| 1138 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1139 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1140 | + if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 1141 | + $desc=$row['description']; |
|
| 1142 | + $agenda_id=$row['item_id']; |
|
| 1143 | + |
|
| 1144 | + if ($builder != 'builder') |
|
| 1145 | + { |
|
| 1146 | + $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path"; |
|
| 1147 | + } |
|
| 1148 | + else |
|
| 1149 | + { |
|
| 1150 | + $link .= "../calendar/agenda.php?origin=$origin&agenda_id=$agenda_id"; |
|
| 1151 | + } |
|
| 1152 | + break; |
|
| 1153 | + |
|
| 1154 | + case "Ad_Valvas": |
|
| 1155 | + $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT); |
|
| 1156 | + $result = Database::query("SELECT * FROM $tbl_announcement WHERE id=$id"); |
|
| 1157 | + $myrow=Database::fetch_array($result); |
|
| 1158 | + |
|
| 1159 | + if ($builder != 'builder') |
|
| 1160 | + { |
|
| 1161 | + $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$id#$id_in_path"; |
|
| 1162 | + } |
|
| 1163 | + else |
|
| 1164 | + { |
|
| 1165 | + $link .= "../announcements/announcements.php?origin=$origin&ann_id=$id"; |
|
| 1166 | + } |
|
| 1167 | + break; |
|
| 1168 | + |
|
| 1169 | + case "Link" : |
|
| 1170 | + $TABLETOOLLINK = Database::get_course_table(TABLE_LINK); |
|
| 1171 | + $result= Database::query("SELECT * FROM $TABLETOOLLINK WHERE id=$id"); |
|
| 1172 | + $myrow=Database::fetch_array($result); |
|
| 1173 | + |
|
| 1174 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1175 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1176 | + |
|
| 1177 | + $thelink=$myrow["url"]; |
|
| 1178 | + if ($builder != 'builder') |
|
| 1179 | + { |
|
| 1180 | + $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path"; |
|
| 1181 | + } |
|
| 1182 | + else |
|
| 1183 | + { |
|
| 1184 | + $link .= $thelink; |
|
| 1185 | + } |
|
| 1186 | + break; |
|
| 1187 | + |
|
| 1188 | + case "Exercise": |
|
| 1189 | + $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
|
| 1190 | + $result= Database::query("SELECT * FROM $TBL_EXERCICES WHERE id=$id"); |
|
| 1191 | + $myrow=Database::fetch_array($result); |
|
| 1192 | + |
|
| 1193 | + if ($builder=='builder') { $origin='builder'; } |
|
| 1194 | + //this is needed for the exercise_submit.php can delete the session info about tests |
|
| 1195 | + |
|
| 1196 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1197 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1198 | + if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 1199 | + |
|
| 1200 | + if ($builder != 'builder') |
|
| 1201 | + { |
|
| 1202 | + $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path"; |
|
| 1203 | + } |
|
| 1204 | + else |
|
| 1205 | + { |
|
| 1206 | + $link .= "../exercise/exercise_submit.php?origin=$origin&exerciseId=".$myrow["id"]; |
|
| 1207 | + } |
|
| 1208 | + break; |
|
| 1209 | + |
|
| 1210 | + case "HotPotatoes": |
|
| 1211 | + $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT); |
|
| 1212 | + $documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
|
| 1213 | + $result = Database::query("SELECT * FROM ".$TBL_DOCUMENT." WHERE id=$id"); |
|
| 1214 | + $myrow= Database::fetch_array($result); |
|
| 1215 | + $path=$myrow["path"]; |
|
| 1216 | + $name=GetQuizName($path,$documentPath); |
|
| 1217 | + |
|
| 1218 | + if ($builder=='builder') { $origin='builder'; } |
|
| 1219 | + |
|
| 1220 | + $cid = $_course['official_code']; |
|
| 1221 | + |
|
| 1222 | + if ($builder != 'builder') |
|
| 1223 | + { |
|
| 1224 | + $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path"; |
|
| 1225 | + } |
|
| 1226 | + else |
|
| 1227 | + { |
|
| 1228 | + $link .= "../exercise/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id'].""; |
|
| 1229 | + } |
|
| 1230 | + break; |
|
| 1231 | + |
|
| 1232 | + case "Forum": |
|
| 1233 | 1233 | //deprecated |
| 1234 | - $TBL_FORUMS = Database::get_course_table(TABLE_FORUM); |
|
| 1235 | - $result= Database::query("SELECT * FROM $TBL_FORUMS WHERE forum_id=$id"); |
|
| 1236 | - $myrow=Database::fetch_array($result); |
|
| 1237 | - |
|
| 1238 | - if ($builder=='builder') { $origin='builder'; } |
|
| 1239 | - |
|
| 1240 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1241 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1242 | - if ($row['title'] != '') { $myrow["forum_name"]=$row['title']; } |
|
| 1243 | - |
|
| 1244 | - if ($myrow["forum_name"]=='') { $type="Forum"; } |
|
| 1245 | - |
|
| 1246 | - $forumparameters="forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]; |
|
| 1247 | - if ($builder != 'builder') |
|
| 1248 | - { |
|
| 1249 | - $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path"; |
|
| 1250 | - } |
|
| 1251 | - else |
|
| 1252 | - { |
|
| 1253 | - $link .= "../phpbb/viewforum.php?$forumparameters"; |
|
| 1254 | - } |
|
| 1255 | - break; |
|
| 1256 | - |
|
| 1257 | - case "Thread": //forum post |
|
| 1234 | + $TBL_FORUMS = Database::get_course_table(TABLE_FORUM); |
|
| 1235 | + $result= Database::query("SELECT * FROM $TBL_FORUMS WHERE forum_id=$id"); |
|
| 1236 | + $myrow=Database::fetch_array($result); |
|
| 1237 | + |
|
| 1238 | + if ($builder=='builder') { $origin='builder'; } |
|
| 1239 | + |
|
| 1240 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1241 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1242 | + if ($row['title'] != '') { $myrow["forum_name"]=$row['title']; } |
|
| 1243 | + |
|
| 1244 | + if ($myrow["forum_name"]=='') { $type="Forum"; } |
|
| 1245 | + |
|
| 1246 | + $forumparameters="forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]; |
|
| 1247 | + if ($builder != 'builder') |
|
| 1248 | + { |
|
| 1249 | + $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path"; |
|
| 1250 | + } |
|
| 1251 | + else |
|
| 1252 | + { |
|
| 1253 | + $link .= "../phpbb/viewforum.php?$forumparameters"; |
|
| 1254 | + } |
|
| 1255 | + break; |
|
| 1256 | + |
|
| 1257 | + case "Thread": //forum post |
|
| 1258 | 1258 | //deprecated |
| 1259 | - $tbl_topics = $_course['dbNameGlu'].'bb_topics'; |
|
| 1260 | - $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
|
| 1261 | - $TBL_FORUMS = $_course['dbNameGlu']."bb_forums"; |
|
| 1262 | - $sql="SELECT * FROM $tbl_topics where topic_id=$id"; |
|
| 1263 | - $result= Database::query($sql); |
|
| 1264 | - $myrow=Database::fetch_array($result); |
|
| 1265 | - |
|
| 1266 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1267 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1268 | - |
|
| 1269 | - if ($builder != 'builder') |
|
| 1270 | - { |
|
| 1271 | - $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path"; |
|
| 1272 | - } |
|
| 1273 | - else |
|
| 1274 | - { |
|
| 1275 | - $link .= "../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]; |
|
| 1276 | - } |
|
| 1277 | - break; |
|
| 1278 | - case "Post": |
|
| 1279 | - break; |
|
| 1280 | - case "Document": |
|
| 1281 | - $dbTable = Database::get_course_table(TABLE_DOCUMENT); |
|
| 1282 | - $result=Database::query("SELECT * FROM $dbTable WHERE id=$id",__FILE__,__LINE); |
|
| 1283 | - $myrow=Database::fetch_array($result); |
|
| 1284 | - |
|
| 1285 | - $pathname=explode("/",$myrow["path"]); // making a correct name for the link |
|
| 1286 | - $last=count($pathname)-1; // making a correct name for the link |
|
| 1287 | - $filename=$pathname[$last]; // making a correct name for the link |
|
| 1288 | - |
|
| 1289 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1290 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1291 | - |
|
| 1292 | - if ($builder != 'builder') |
|
| 1293 | - { |
|
| 1294 | - $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path"; |
|
| 1295 | - |
|
| 1296 | - } |
|
| 1297 | - else |
|
| 1298 | - { |
|
| 1299 | - $enableDocumentParsing='yes'; |
|
| 1300 | - if (!$enableDocumentParsing) |
|
| 1301 | - { //this is the solution for the non-parsing version in the builder |
|
| 1302 | - $file=urlencode($myrow["path"]); |
|
| 1303 | - $link .= "../document/showinframes.php?file=$file"; |
|
| 1304 | - } |
|
| 1305 | - else |
|
| 1306 | - { |
|
| 1307 | - $link .= "../document/download.php?doc_url=".$myrow["path"]; |
|
| 1308 | - } |
|
| 1309 | - } |
|
| 1310 | - break; |
|
| 1311 | - |
|
| 1312 | - case "Assignments": |
|
| 1313 | - if ($builder != 'builder') |
|
| 1314 | - { |
|
| 1315 | - $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path"; |
|
| 1316 | - } |
|
| 1317 | - else |
|
| 1318 | - { |
|
| 1319 | - $link .= "../work/work.php"; |
|
| 1320 | - } |
|
| 1321 | - break; |
|
| 1322 | - case "Dropbox": |
|
| 1323 | - if ($builder != 'builder') |
|
| 1324 | - { |
|
| 1325 | - $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path"; |
|
| 1326 | - } else { |
|
| 1327 | - $link .= "../dropbox/index.php"; |
|
| 1328 | - } |
|
| 1329 | - break; |
|
| 1330 | - case "Introduction_text": |
|
| 1331 | - if ($builder != 'builder') |
|
| 1332 | - { |
|
| 1333 | - $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path"; |
|
| 1334 | - } else { |
|
| 1335 | - $s = api_get_path(WEB_COURSE_PATH)."$_cid/index.php?intro_cmdEdit=1"; |
|
| 1336 | - $link .= $s; |
|
| 1337 | - } |
|
| 1338 | - break; |
|
| 1339 | - case "Course_description": |
|
| 1340 | - if ($builder != 'builder') |
|
| 1341 | - { |
|
| 1342 | - $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path"; |
|
| 1343 | - } else { |
|
| 1344 | - $s=api_get_path(WEB_CODE_PATH)."course_description"; |
|
| 1345 | - $link .= $s; |
|
| 1346 | - } |
|
| 1347 | - break; |
|
| 1348 | - case "Groups": |
|
| 1349 | - |
|
| 1350 | - if ($builder != 'builder') |
|
| 1351 | - { |
|
| 1352 | - $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path"; |
|
| 1353 | - } else { |
|
| 1354 | - $link .= "../group/group.php?origin=$origin"; |
|
| 1355 | - } |
|
| 1356 | - break; |
|
| 1357 | - case "Users": |
|
| 1358 | - if ($builder != 'builder') |
|
| 1359 | - { |
|
| 1360 | - $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path"; |
|
| 1361 | - } else { |
|
| 1362 | - $link .= "../user/user.php?origin=$origin"; |
|
| 1363 | - } |
|
| 1364 | - break; |
|
| 1365 | - }//end huge switch-statement |
|
| 1259 | + $tbl_topics = $_course['dbNameGlu'].'bb_topics'; |
|
| 1260 | + $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
|
| 1261 | + $TBL_FORUMS = $_course['dbNameGlu']."bb_forums"; |
|
| 1262 | + $sql="SELECT * FROM $tbl_topics where topic_id=$id"; |
|
| 1263 | + $result= Database::query($sql); |
|
| 1264 | + $myrow=Database::fetch_array($result); |
|
| 1265 | + |
|
| 1266 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1267 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1268 | + |
|
| 1269 | + if ($builder != 'builder') |
|
| 1270 | + { |
|
| 1271 | + $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path"; |
|
| 1272 | + } |
|
| 1273 | + else |
|
| 1274 | + { |
|
| 1275 | + $link .= "../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]; |
|
| 1276 | + } |
|
| 1277 | + break; |
|
| 1278 | + case "Post": |
|
| 1279 | + break; |
|
| 1280 | + case "Document": |
|
| 1281 | + $dbTable = Database::get_course_table(TABLE_DOCUMENT); |
|
| 1282 | + $result=Database::query("SELECT * FROM $dbTable WHERE id=$id",__FILE__,__LINE); |
|
| 1283 | + $myrow=Database::fetch_array($result); |
|
| 1284 | + |
|
| 1285 | + $pathname=explode("/",$myrow["path"]); // making a correct name for the link |
|
| 1286 | + $last=count($pathname)-1; // making a correct name for the link |
|
| 1287 | + $filename=$pathname[$last]; // making a correct name for the link |
|
| 1288 | + |
|
| 1289 | + $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1290 | + $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1291 | + |
|
| 1292 | + if ($builder != 'builder') |
|
| 1293 | + { |
|
| 1294 | + $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path"; |
|
| 1295 | + |
|
| 1296 | + } |
|
| 1297 | + else |
|
| 1298 | + { |
|
| 1299 | + $enableDocumentParsing='yes'; |
|
| 1300 | + if (!$enableDocumentParsing) |
|
| 1301 | + { //this is the solution for the non-parsing version in the builder |
|
| 1302 | + $file=urlencode($myrow["path"]); |
|
| 1303 | + $link .= "../document/showinframes.php?file=$file"; |
|
| 1304 | + } |
|
| 1305 | + else |
|
| 1306 | + { |
|
| 1307 | + $link .= "../document/download.php?doc_url=".$myrow["path"]; |
|
| 1308 | + } |
|
| 1309 | + } |
|
| 1310 | + break; |
|
| 1311 | + |
|
| 1312 | + case "Assignments": |
|
| 1313 | + if ($builder != 'builder') |
|
| 1314 | + { |
|
| 1315 | + $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path"; |
|
| 1316 | + } |
|
| 1317 | + else |
|
| 1318 | + { |
|
| 1319 | + $link .= "../work/work.php"; |
|
| 1320 | + } |
|
| 1321 | + break; |
|
| 1322 | + case "Dropbox": |
|
| 1323 | + if ($builder != 'builder') |
|
| 1324 | + { |
|
| 1325 | + $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path"; |
|
| 1326 | + } else { |
|
| 1327 | + $link .= "../dropbox/index.php"; |
|
| 1328 | + } |
|
| 1329 | + break; |
|
| 1330 | + case "Introduction_text": |
|
| 1331 | + if ($builder != 'builder') |
|
| 1332 | + { |
|
| 1333 | + $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path"; |
|
| 1334 | + } else { |
|
| 1335 | + $s = api_get_path(WEB_COURSE_PATH)."$_cid/index.php?intro_cmdEdit=1"; |
|
| 1336 | + $link .= $s; |
|
| 1337 | + } |
|
| 1338 | + break; |
|
| 1339 | + case "Course_description": |
|
| 1340 | + if ($builder != 'builder') |
|
| 1341 | + { |
|
| 1342 | + $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path"; |
|
| 1343 | + } else { |
|
| 1344 | + $s=api_get_path(WEB_CODE_PATH)."course_description"; |
|
| 1345 | + $link .= $s; |
|
| 1346 | + } |
|
| 1347 | + break; |
|
| 1348 | + case "Groups": |
|
| 1349 | + |
|
| 1350 | + if ($builder != 'builder') |
|
| 1351 | + { |
|
| 1352 | + $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path"; |
|
| 1353 | + } else { |
|
| 1354 | + $link .= "../group/group.php?origin=$origin"; |
|
| 1355 | + } |
|
| 1356 | + break; |
|
| 1357 | + case "Users": |
|
| 1358 | + if ($builder != 'builder') |
|
| 1359 | + { |
|
| 1360 | + $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path"; |
|
| 1361 | + } else { |
|
| 1362 | + $link .= "../user/user.php?origin=$origin"; |
|
| 1363 | + } |
|
| 1364 | + break; |
|
| 1365 | + }//end huge switch-statement |
|
| 1366 | 1366 | return $link; |
| 1367 | 1367 | } |
| 1368 | 1368 | |
@@ -1371,12 +1371,12 @@ discard block |
||
| 1371 | 1371 | */ |
| 1372 | 1372 | function remove_resource($resource_key) |
| 1373 | 1373 | { |
| 1374 | - $addedresource = $_SESSION['addedresource']; |
|
| 1375 | - $addedresourceid = $_SESSION['addedresourceid']; |
|
| 1376 | - unset($addedresource[$resource_key]); |
|
| 1377 | - unset($addedresourceid[$resource_key]); |
|
| 1378 | - $_SESSION['addedresource']=$addedresource; |
|
| 1379 | - $_SESSION['addedresourceid']=$addedresourceid ; |
|
| 1374 | + $addedresource = $_SESSION['addedresource']; |
|
| 1375 | + $addedresourceid = $_SESSION['addedresourceid']; |
|
| 1376 | + unset($addedresource[$resource_key]); |
|
| 1377 | + unset($addedresourceid[$resource_key]); |
|
| 1378 | + $_SESSION['addedresource']=$addedresource; |
|
| 1379 | + $_SESSION['addedresourceid']=$addedresourceid ; |
|
| 1380 | 1380 | } |
| 1381 | 1381 | |
| 1382 | 1382 | /** |
@@ -1385,8 +1385,8 @@ discard block |
||
| 1385 | 1385 | */ |
| 1386 | 1386 | function show_addresource_button($additionalparameters = '') |
| 1387 | 1387 | { |
| 1388 | - global $charset; |
|
| 1389 | - echo '<label for="addresources"><img src="../img/attachment.gif" /></label><input class="link_alike" type="submit" name="addresources" id="addresources" value="'.api_htmlentities(get_lang('Attachment'), ENT_QUOTES, $charset).'" '.$additionalparameters.' />'; |
|
| 1388 | + global $charset; |
|
| 1389 | + echo '<label for="addresources"><img src="../img/attachment.gif" /></label><input class="link_alike" type="submit" name="addresources" id="addresources" value="'.api_htmlentities(get_lang('Attachment'), ENT_QUOTES, $charset).'" '.$additionalparameters.' />'; |
|
| 1390 | 1390 | } |
| 1391 | 1391 | |
| 1392 | 1392 | /** |
@@ -1408,11 +1408,11 @@ discard block |
||
| 1408 | 1408 | */ |
| 1409 | 1409 | function delete_added_resource($type, $id) |
| 1410 | 1410 | { |
| 1411 | - global $_course; |
|
| 1412 | - $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1411 | + global $_course; |
|
| 1412 | + $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1413 | 1413 | |
| 1414 | - $sql="DELETE FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'"; |
|
| 1415 | - Database::query($sql); |
|
| 1414 | + $sql="DELETE FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'"; |
|
| 1415 | + Database::query($sql); |
|
| 1416 | 1416 | } |
| 1417 | 1417 | |
| 1418 | 1418 | /** |
@@ -1421,12 +1421,12 @@ discard block |
||
| 1421 | 1421 | */ |
| 1422 | 1422 | function delete_all_resources_type($type) |
| 1423 | 1423 | { |
| 1424 | - global $_course; |
|
| 1425 | - $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1424 | + global $_course; |
|
| 1425 | + $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1426 | 1426 | |
| 1427 | - $sql="DELETE FROM $TABLERESOURCE WHERE source_type='$type'"; |
|
| 1427 | + $sql="DELETE FROM $TABLERESOURCE WHERE source_type='$type'"; |
|
| 1428 | 1428 | |
| 1429 | - Database::query($sql); |
|
| 1429 | + Database::query($sql); |
|
| 1430 | 1430 | } |
| 1431 | 1431 | |
| 1432 | 1432 | /** |
@@ -1434,15 +1434,15 @@ discard block |
||
| 1434 | 1434 | */ |
| 1435 | 1435 | function check_added_resources($type, $id) |
| 1436 | 1436 | { |
| 1437 | - global $_course, $origin; |
|
| 1438 | - $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1439 | - $sql="SELECT * FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'"; |
|
| 1440 | - $result=Database::query($sql); |
|
| 1441 | - $number_added=Database::num_rows($result); |
|
| 1442 | - if ($number_added<>0) |
|
| 1443 | - return true; |
|
| 1444 | - else |
|
| 1445 | - return false; |
|
| 1437 | + global $_course, $origin; |
|
| 1438 | + $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1439 | + $sql="SELECT * FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'"; |
|
| 1440 | + $result=Database::query($sql); |
|
| 1441 | + $number_added=Database::num_rows($result); |
|
| 1442 | + if ($number_added<>0) |
|
| 1443 | + return true; |
|
| 1444 | + else |
|
| 1445 | + return false; |
|
| 1446 | 1446 | } |
| 1447 | 1447 | |
| 1448 | 1448 | |
@@ -1452,18 +1452,18 @@ discard block |
||
| 1452 | 1452 | */ |
| 1453 | 1453 | function edit_added_resources($type, $id) |
| 1454 | 1454 | { |
| 1455 | - $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1455 | + $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1456 | 1456 | $course_id = api_get_course_int_id(); |
| 1457 | 1457 | $id = intval($id); |
| 1458 | 1458 | $type = Database::escape_string($type); |
| 1459 | - $sql="SELECT * FROM $TABLERESOURCE WHERE c_id = $course_id AND source_type='$type' and source_id=$id"; |
|
| 1460 | - $result=Database::query($sql); |
|
| 1461 | - while ($row=Database::fetch_array($result)) { |
|
| 1462 | - $addedresource[]=$row["resource_type"]; |
|
| 1463 | - $addedresourceid[]=$row["resource_id"]; |
|
| 1464 | - } |
|
| 1465 | - $_SESSION['addedresource']=$addedresource; |
|
| 1466 | - $_SESSION['addedresourceid']=$addedresourceid; |
|
| 1459 | + $sql="SELECT * FROM $TABLERESOURCE WHERE c_id = $course_id AND source_type='$type' and source_id=$id"; |
|
| 1460 | + $result=Database::query($sql); |
|
| 1461 | + while ($row=Database::fetch_array($result)) { |
|
| 1462 | + $addedresource[]=$row["resource_type"]; |
|
| 1463 | + $addedresourceid[]=$row["resource_id"]; |
|
| 1464 | + } |
|
| 1465 | + $_SESSION['addedresource']=$addedresource; |
|
| 1466 | + $_SESSION['addedresourceid']=$addedresourceid; |
|
| 1467 | 1467 | } |
| 1468 | 1468 | |
| 1469 | 1469 | /** |
@@ -1473,20 +1473,20 @@ discard block |
||
| 1473 | 1473 | */ |
| 1474 | 1474 | function update_added_resources($type, $id) |
| 1475 | 1475 | { |
| 1476 | - $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1476 | + $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1477 | 1477 | $course_id = api_get_course_int_id(); |
| 1478 | 1478 | $id = intval($id); |
| 1479 | 1479 | $type = Database::escape_string($type); |
| 1480 | - // delete all the added resources for this item in the database; |
|
| 1481 | - $sql="DELETE FROM $TABLERESOURCE WHERE c_id = $course_id AND source_type='$type' AND source_id='$id'"; |
|
| 1482 | - //echo $sql; |
|
| 1483 | - Database::query($sql); |
|
| 1480 | + // delete all the added resources for this item in the database; |
|
| 1481 | + $sql="DELETE FROM $TABLERESOURCE WHERE c_id = $course_id AND source_type='$type' AND source_id='$id'"; |
|
| 1482 | + //echo $sql; |
|
| 1483 | + Database::query($sql); |
|
| 1484 | 1484 | |
| 1485 | - // store the resources from the session into the database |
|
| 1486 | - store_resources($type, $id); |
|
| 1485 | + // store the resources from the session into the database |
|
| 1486 | + store_resources($type, $id); |
|
| 1487 | 1487 | |
| 1488 | - //delete_added_resource_($type, $id); |
|
| 1489 | - unset_session_resources(); |
|
| 1488 | + //delete_added_resource_($type, $id); |
|
| 1489 | + unset_session_resources(); |
|
| 1490 | 1490 | } |
| 1491 | 1491 | |
| 1492 | 1492 | /** |
@@ -1494,25 +1494,25 @@ discard block |
||
| 1494 | 1494 | */ |
| 1495 | 1495 | function display_added_resources($type, $id, $style='') |
| 1496 | 1496 | { |
| 1497 | - // the array containing the icons |
|
| 1498 | - $arr_icons=array('Agenda'=>'../img/agenda.gif', 'Ad Valvas'=>'../img/valves.gif', 'Link'=>'../img/links.gif', 'Exercise'=>'../img/quiz.gif' ); |
|
| 1499 | - |
|
| 1500 | - global $_course, $origin; |
|
| 1501 | - $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1502 | - |
|
| 1503 | - $sql="SELECT * FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'"; |
|
| 1504 | - $result=Database::query($sql); |
|
| 1505 | - while ($row=Database::fetch_array($result)) |
|
| 1506 | - { |
|
| 1507 | - if ($origin != 'learnpath') |
|
| 1508 | - { |
|
| 1509 | - display_addedresource_link($row['resource_type'], $row['resource_id'], $style) ; |
|
| 1510 | - } |
|
| 1511 | - else |
|
| 1512 | - { |
|
| 1513 | - display_addedresource_link_in_learnpath($row['resource_type'], $row['resource_id'],'agendaitems','','builder','icon') ; echo "<br>"; |
|
| 1514 | - } |
|
| 1515 | - } |
|
| 1497 | + // the array containing the icons |
|
| 1498 | + $arr_icons=array('Agenda'=>'../img/agenda.gif', 'Ad Valvas'=>'../img/valves.gif', 'Link'=>'../img/links.gif', 'Exercise'=>'../img/quiz.gif' ); |
|
| 1499 | + |
|
| 1500 | + global $_course, $origin; |
|
| 1501 | + $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1502 | + |
|
| 1503 | + $sql="SELECT * FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'"; |
|
| 1504 | + $result=Database::query($sql); |
|
| 1505 | + while ($row=Database::fetch_array($result)) |
|
| 1506 | + { |
|
| 1507 | + if ($origin != 'learnpath') |
|
| 1508 | + { |
|
| 1509 | + display_addedresource_link($row['resource_type'], $row['resource_id'], $style) ; |
|
| 1510 | + } |
|
| 1511 | + else |
|
| 1512 | + { |
|
| 1513 | + display_addedresource_link_in_learnpath($row['resource_type'], $row['resource_id'],'agendaitems','','builder','icon') ; echo "<br>"; |
|
| 1514 | + } |
|
| 1515 | + } |
|
| 1516 | 1516 | } |
| 1517 | 1517 | |
| 1518 | 1518 | |
@@ -1523,15 +1523,15 @@ discard block |
||
| 1523 | 1523 | */ |
| 1524 | 1524 | function display_resources($showdeleteimg) |
| 1525 | 1525 | { |
| 1526 | - global $action; |
|
| 1527 | - global $resourceaction; |
|
| 1528 | - global $id; |
|
| 1529 | - global $locationkey; |
|
| 1530 | - global $source_id, $action, $learnpath_id, $chapter_id, $originalresource; |
|
| 1531 | - |
|
| 1532 | - if ($resourceaction=="removeresource") |
|
| 1533 | - { |
|
| 1534 | - /* unneccessary because when editing we delete all the added resources from the |
|
| 1526 | + global $action; |
|
| 1527 | + global $resourceaction; |
|
| 1528 | + global $id; |
|
| 1529 | + global $locationkey; |
|
| 1530 | + global $source_id, $action, $learnpath_id, $chapter_id, $originalresource; |
|
| 1531 | + |
|
| 1532 | + if ($resourceaction=="removeresource") |
|
| 1533 | + { |
|
| 1534 | + /* unneccessary because when editing we delete all the added resources from the |
|
| 1535 | 1535 | database and add all these from the session |
| 1536 | 1536 | if ($action=="edit") // we have an edit and thus we delete from the database and from the session |
| 1537 | 1537 | { |
@@ -1547,41 +1547,41 @@ discard block |
||
| 1547 | 1547 | } |
| 1548 | 1548 | else // we remove from the session |
| 1549 | 1549 | {*/ |
| 1550 | - //echo "remove from session"; |
|
| 1551 | - remove_resource($locationkey); |
|
| 1552 | - } |
|
| 1553 | - $addedresource=$_SESSION['addedresource']; |
|
| 1554 | - $addedresourceid=$_SESSION['addedresourceid']; |
|
| 1555 | - if (is_array($addedresource)) |
|
| 1556 | - { |
|
| 1557 | - echo '<table>'; |
|
| 1558 | - foreach ($addedresource as $resource) |
|
| 1559 | - { |
|
| 1560 | - //echo $resource.":".$addedresourceid[key($addedresource)]; |
|
| 1561 | - echo '<tr><td>'; |
|
| 1562 | - display_addedresource_link($resource,$addedresourceid[key($addedresource)]); |
|
| 1563 | - echo '</td><td width="30">'; |
|
| 1564 | - |
|
| 1565 | - // if $_SERVER['REQUEST_URI'] contains and ?id=xx we have an edit and the url for deleting a session added resource |
|
| 1566 | - // should also contain this id. |
|
| 1567 | - $test=parse_url($_SERVER['REQUEST_URI']); |
|
| 1568 | - $output = array(); |
|
| 1569 | - parse_str($test['query'],$output); |
|
| 1570 | - |
|
| 1571 | - if ($showdeleteimg==1) |
|
| 1572 | - { |
|
| 1573 | - echo "<a href=".api_get_self()."?showresources=true&source_forum=".$_GET['source_forum']."&resourceaction=removeresource&locationkey=".key($addedresource)."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no><img src='../img/delete.gif' border='0' alt='resource ".get_lang('Delete')."' /></a><br />"; |
|
| 1574 | - } |
|
| 1575 | - echo '</td></tr>'; |
|
| 1576 | - next($addedresource); |
|
| 1577 | - //$_SESSION['edit']==''; |
|
| 1578 | - } |
|
| 1579 | - echo '</table>'; |
|
| 1580 | - } |
|
| 1581 | - else // it is a string |
|
| 1582 | - { |
|
| 1583 | - echo ''; |
|
| 1584 | - } |
|
| 1550 | + //echo "remove from session"; |
|
| 1551 | + remove_resource($locationkey); |
|
| 1552 | + } |
|
| 1553 | + $addedresource=$_SESSION['addedresource']; |
|
| 1554 | + $addedresourceid=$_SESSION['addedresourceid']; |
|
| 1555 | + if (is_array($addedresource)) |
|
| 1556 | + { |
|
| 1557 | + echo '<table>'; |
|
| 1558 | + foreach ($addedresource as $resource) |
|
| 1559 | + { |
|
| 1560 | + //echo $resource.":".$addedresourceid[key($addedresource)]; |
|
| 1561 | + echo '<tr><td>'; |
|
| 1562 | + display_addedresource_link($resource,$addedresourceid[key($addedresource)]); |
|
| 1563 | + echo '</td><td width="30">'; |
|
| 1564 | + |
|
| 1565 | + // if $_SERVER['REQUEST_URI'] contains and ?id=xx we have an edit and the url for deleting a session added resource |
|
| 1566 | + // should also contain this id. |
|
| 1567 | + $test=parse_url($_SERVER['REQUEST_URI']); |
|
| 1568 | + $output = array(); |
|
| 1569 | + parse_str($test['query'],$output); |
|
| 1570 | + |
|
| 1571 | + if ($showdeleteimg==1) |
|
| 1572 | + { |
|
| 1573 | + echo "<a href=".api_get_self()."?showresources=true&source_forum=".$_GET['source_forum']."&resourceaction=removeresource&locationkey=".key($addedresource)."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no><img src='../img/delete.gif' border='0' alt='resource ".get_lang('Delete')."' /></a><br />"; |
|
| 1574 | + } |
|
| 1575 | + echo '</td></tr>'; |
|
| 1576 | + next($addedresource); |
|
| 1577 | + //$_SESSION['edit']==''; |
|
| 1578 | + } |
|
| 1579 | + echo '</table>'; |
|
| 1580 | + } |
|
| 1581 | + else // it is a string |
|
| 1582 | + { |
|
| 1583 | + echo ''; |
|
| 1584 | + } |
|
| 1585 | 1585 | } // end of the display_resources function |
| 1586 | 1586 | |
| 1587 | 1587 | |
@@ -1593,49 +1593,49 @@ discard block |
||
| 1593 | 1593 | */ |
| 1594 | 1594 | function showorhide_addresourcelink($type, $id) |
| 1595 | 1595 | { |
| 1596 | - global $from_learnpath, $source_id, $action, $learnpath_id, $chapter_id, $originalresource, $folder, $content, $target; |
|
| 1597 | - //global $_SESSION['addresource']; |
|
| 1598 | - //global $_SESSION['addresourceid']; |
|
| 1599 | - $addedresource=$_SESSION['addedresource']; |
|
| 1600 | - $addedresourceid=$_SESSION['addedresourceid']; |
|
| 1601 | - |
|
| 1602 | - if (is_array($_SESSION['addedresource'])) |
|
| 1603 | - { |
|
| 1604 | - foreach ($addedresource as $toolcompare) |
|
| 1605 | - { |
|
| 1606 | - //echo $toolcompare; |
|
| 1607 | - //echo "/".$type."/".$id."****"; |
|
| 1608 | - //$key=key($addedresource); |
|
| 1609 | - //echo $addedresourceid[$key]; |
|
| 1610 | - //print_r($addedresourceid); |
|
| 1611 | - //echo "<br>"; |
|
| 1612 | - |
|
| 1613 | - if ($toolcompare==$type and $addedresourceid[key($addedresource)]==$id) |
|
| 1614 | - { |
|
| 1615 | - $show=0; |
|
| 1616 | - } |
|
| 1617 | - next($addedresource); |
|
| 1618 | - } |
|
| 1619 | - if ($from_learnpath) { $lang_add_it_or_resource=get_lang('AddIt'); } else { $lang_add_it_or_resource=get_lang('AddResource'); } |
|
| 1620 | - if ($show!==0) |
|
| 1621 | - { |
|
| 1622 | - if ($type=="Document") |
|
| 1623 | - { |
|
| 1624 | - echo "<a href=".api_get_self()."?content=".$type."&folder=".$folder."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no>".$lang_add_it_or_resource."</a>"; |
|
| 1625 | - } |
|
| 1626 | - else |
|
| 1627 | - { |
|
| 1628 | - echo "<a href='".api_get_self()."?content=".$type."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no&target=$target'>".$lang_add_it_or_resource."</a>"; |
|
| 1629 | - } |
|
| 1630 | - } |
|
| 1631 | - } |
|
| 1632 | - else // if it is not an array, it is a string |
|
| 1633 | - { |
|
| 1634 | - if ($_SESSION['addedresource']!==$type or $_SESSION['addedresourceid']!==$id) |
|
| 1635 | - { |
|
| 1636 | - if ($from_learnpath) { $lang_add_it_or_resource=get_lang('AddIt'); } else { $lang_add_it_or_resource=get_lang('AddResource'); } |
|
| 1637 | - echo "<a href='".api_get_self()."?content=".$type."&folder=".$folder."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no&target=$target'>".$lang_add_it_or_resource."</a>"; |
|
| 1638 | - } |
|
| 1639 | - } |
|
| 1596 | + global $from_learnpath, $source_id, $action, $learnpath_id, $chapter_id, $originalresource, $folder, $content, $target; |
|
| 1597 | + //global $_SESSION['addresource']; |
|
| 1598 | + //global $_SESSION['addresourceid']; |
|
| 1599 | + $addedresource=$_SESSION['addedresource']; |
|
| 1600 | + $addedresourceid=$_SESSION['addedresourceid']; |
|
| 1601 | + |
|
| 1602 | + if (is_array($_SESSION['addedresource'])) |
|
| 1603 | + { |
|
| 1604 | + foreach ($addedresource as $toolcompare) |
|
| 1605 | + { |
|
| 1606 | + //echo $toolcompare; |
|
| 1607 | + //echo "/".$type."/".$id."****"; |
|
| 1608 | + //$key=key($addedresource); |
|
| 1609 | + //echo $addedresourceid[$key]; |
|
| 1610 | + //print_r($addedresourceid); |
|
| 1611 | + //echo "<br>"; |
|
| 1612 | + |
|
| 1613 | + if ($toolcompare==$type and $addedresourceid[key($addedresource)]==$id) |
|
| 1614 | + { |
|
| 1615 | + $show=0; |
|
| 1616 | + } |
|
| 1617 | + next($addedresource); |
|
| 1618 | + } |
|
| 1619 | + if ($from_learnpath) { $lang_add_it_or_resource=get_lang('AddIt'); } else { $lang_add_it_or_resource=get_lang('AddResource'); } |
|
| 1620 | + if ($show!==0) |
|
| 1621 | + { |
|
| 1622 | + if ($type=="Document") |
|
| 1623 | + { |
|
| 1624 | + echo "<a href=".api_get_self()."?content=".$type."&folder=".$folder."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no>".$lang_add_it_or_resource."</a>"; |
|
| 1625 | + } |
|
| 1626 | + else |
|
| 1627 | + { |
|
| 1628 | + echo "<a href='".api_get_self()."?content=".$type."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no&target=$target'>".$lang_add_it_or_resource."</a>"; |
|
| 1629 | + } |
|
| 1630 | + } |
|
| 1631 | + } |
|
| 1632 | + else // if it is not an array, it is a string |
|
| 1633 | + { |
|
| 1634 | + if ($_SESSION['addedresource']!==$type or $_SESSION['addedresourceid']!==$id) |
|
| 1635 | + { |
|
| 1636 | + if ($from_learnpath) { $lang_add_it_or_resource=get_lang('AddIt'); } else { $lang_add_it_or_resource=get_lang('AddResource'); } |
|
| 1637 | + echo "<a href='".api_get_self()."?content=".$type."&folder=".$folder."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no&target=$target'>".$lang_add_it_or_resource."</a>"; |
|
| 1638 | + } |
|
| 1639 | + } |
|
| 1640 | 1640 | } |
| 1641 | 1641 | ?> |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | 26 | function unset_session_resources() { |
| 27 | - $_SESSION['addedresource']=''; |
|
| 28 | - $_SESSION['addedresourceid']=''; |
|
| 27 | + $_SESSION['addedresource'] = ''; |
|
| 28 | + $_SESSION['addedresourceid'] = ''; |
|
| 29 | 29 | Session::erase('addedresource'); |
| 30 | 30 | Session::erase('addedresourceid'); |
| 31 | 31 | } |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | if ($level and $level != 0 and $level != 1) |
| 48 | 48 | { |
| 49 | - $folder_up=$folder; |
|
| 50 | - $folder_temp=explode('/',$folder); |
|
| 51 | - $last=count($folder_temp)-1; |
|
| 49 | + $folder_up = $folder; |
|
| 50 | + $folder_temp = explode('/', $folder); |
|
| 51 | + $last = count($folder_temp) - 1; |
|
| 52 | 52 | unset($folder_temp[$last]); |
| 53 | - $folder_up=implode('/',$folder_temp); |
|
| 53 | + $folder_up = implode('/', $folder_temp); |
|
| 54 | 54 | echo "<a href='".api_get_self()."?content=Document&source_forum=".$_GET['source_forum']."&folder=$folder_up&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'><img src='../img/folder_up.gif' border='0' />".get_lang('LevelUp')."</a>"; |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -68,11 +68,11 @@ discard block |
||
| 68 | 68 | // other tools do not have this feature. This only counts |
| 69 | 69 | if (api_is_allowed_to_edit()) |
| 70 | 70 | { |
| 71 | - $visibility="ip.visibility<>'2'"; |
|
| 71 | + $visibility = "ip.visibility<>'2'"; |
|
| 72 | 72 | } |
| 73 | 73 | else |
| 74 | 74 | { |
| 75 | - $visibility="ip.visibility='1'"; |
|
| 75 | + $visibility = "ip.visibility='1'"; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | $item_property_table = Database::get_course_table(TABLE_ITEM_PROPERTY); |
@@ -85,12 +85,12 @@ discard block |
||
| 85 | 85 | (ip.to_group_id = 0 OR i.to_group_id IS NULL) AND |
| 86 | 86 | ip.to_user_id IS NULL |
| 87 | 87 | ORDER BY docs.path ASC"; |
| 88 | - $result=Database::query($sql); |
|
| 89 | - while ($row=Database::fetch_array($result)) |
|
| 88 | + $result = Database::query($sql); |
|
| 89 | + while ($row = Database::fetch_array($result)) |
|
| 90 | 90 | { |
| 91 | 91 | if (!$folder) |
| 92 | 92 | { |
| 93 | - if (get_levels($row['path'])-1==1) |
|
| 93 | + if (get_levels($row['path']) - 1 == 1) |
|
| 94 | 94 | { |
| 95 | 95 | // showing the right icon |
| 96 | 96 | if (file_or_folder($row['path'])) |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | if (file_or_folder($row['path'])) |
| 108 | 108 | { |
| 109 | 109 | echo "<a href='".api_get_self()."?content=Document"; |
| 110 | - echo "&folder=".substr($row['path'],1)."&source_id=$source_id&source_forum=".$_GET['source_forum']."&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".substr($row['path'],1).'</a><br />'; |
|
| 110 | + echo "&folder=".substr($row['path'], 1)."&source_id=$source_id&source_forum=".$_GET['source_forum']."&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".substr($row['path'], 1).'</a><br />'; |
|
| 111 | 111 | } |
| 112 | 112 | else |
| 113 | 113 | { |
| 114 | - echo substr($row['path'],1).' '; |
|
| 115 | - echo showorhide_addresourcelink('Document',$row['id']); |
|
| 114 | + echo substr($row['path'], 1).' '; |
|
| 115 | + echo showorhide_addresourcelink('Document', $row['id']); |
|
| 116 | 116 | echo '<br />'; |
| 117 | 117 | } |
| 118 | 118 | } |
@@ -121,16 +121,16 @@ discard block |
||
| 121 | 121 | { |
| 122 | 122 | // we calculate the level we are in by using the $folder in the url |
| 123 | 123 | // we put +1 because it does not start with an / and in the database it does |
| 124 | - $level=get_levels($folder)+1; |
|
| 124 | + $level = get_levels($folder) + 1; |
|
| 125 | 125 | |
| 126 | 126 | // we calculate each level of the database entry |
| 127 | - $file_level=get_levels($row['path'])-1; |
|
| 127 | + $file_level = get_levels($row['path']) - 1; |
|
| 128 | 128 | // if the level of the database entry is equal to the level we ar in, we put it into an array |
| 129 | 129 | // as this is a potential good entry |
| 130 | - if ($file_level==$level) |
|
| 130 | + if ($file_level == $level) |
|
| 131 | 131 | { |
| 132 | - $good_paths[]=$row['path']; |
|
| 133 | - $good_ids[]=$row['id']; |
|
| 132 | + $good_paths[] = $row['path']; |
|
| 133 | + $good_ids[] = $row['id']; |
|
| 134 | 134 | } |
| 135 | 135 | //$haystack=$row['path']; |
| 136 | 136 | //$conform_folder=strstr($haystack, $folder); |
@@ -149,9 +149,9 @@ discard block |
||
| 149 | 149 | // we have all the potential good database entries, the good ones are those that start with $folder |
| 150 | 150 | foreach ($good_paths as $path) |
| 151 | 151 | { |
| 152 | - if (strstr($path,$folder)) |
|
| 152 | + if (strstr($path, $folder)) |
|
| 153 | 153 | { |
| 154 | - $good_key=key($good_paths); |
|
| 154 | + $good_key = key($good_paths); |
|
| 155 | 155 | // showing the right icon |
| 156 | 156 | if (file_or_folder($path)) |
| 157 | 157 | { |
@@ -166,17 +166,17 @@ discard block |
||
| 166 | 166 | // folders should be clickable |
| 167 | 167 | if (file_or_folder($path)) |
| 168 | 168 | { |
| 169 | - $path=substr($path,1); // remove the first / in folder_up |
|
| 170 | - $uri=str_replace($folder,$path,$_SERVER['REQUEST_URI']); |
|
| 171 | - $newuri=str_replace('add=','addnot=',$uri); |
|
| 169 | + $path = substr($path, 1); // remove the first / in folder_up |
|
| 170 | + $uri = str_replace($folder, $path, $_SERVER['REQUEST_URI']); |
|
| 171 | + $newuri = str_replace('add=', 'addnot=', $uri); |
|
| 172 | 172 | //using the correct name of the folder |
| 173 | - $folder_name=str_replace($folder.'/','',$path); |
|
| 173 | + $folder_name = str_replace($folder.'/', '', $path); |
|
| 174 | 174 | echo "<a href='$newuri'>".$folder_name.'</a><br />'; |
| 175 | 175 | } |
| 176 | 176 | else |
| 177 | 177 | { |
| 178 | - echo str_replace("/$folder/", '',$path).' '; |
|
| 179 | - echo showorhide_addresourcelink('Document',$good_ids[$good_key]); |
|
| 178 | + echo str_replace("/$folder/", '', $path).' '; |
|
| 179 | + echo showorhide_addresourcelink('Document', $good_ids[$good_key]); |
|
| 180 | 180 | echo '<br />'; |
| 181 | 181 | } |
| 182 | 182 | } |
@@ -219,13 +219,13 @@ discard block |
||
| 219 | 219 | { |
| 220 | 220 | foreach ($addedresource as $resource_type) |
| 221 | 221 | { |
| 222 | - $sql="INSERT INTO $resource_table (source_type, source_id, resource_type, resource_id) VALUES ('$source_type', '$source_id', '$resource_type', '".$addedresourceid[key($addedresource)]."')"; |
|
| 222 | + $sql = "INSERT INTO $resource_table (source_type, source_id, resource_type, resource_id) VALUES ('$source_type', '$source_id', '$resource_type', '".$addedresourceid[key($addedresource)]."')"; |
|
| 223 | 223 | Database::query($sql); |
| 224 | - $i=key($addedresource); |
|
| 224 | + $i = key($addedresource); |
|
| 225 | 225 | next($addedresource); |
| 226 | 226 | } |
| 227 | - $_SESSION['addedresource']=''; |
|
| 228 | - $_SESSION['addedresourceid']=''; |
|
| 227 | + $_SESSION['addedresource'] = ''; |
|
| 228 | + $_SESSION['addedresourceid'] = ''; |
|
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | * @param $style this is used to style the link (for instance when a resource is hidden => the added resources should also be styled like they are hidden) |
| 239 | 239 | * @todo use the constants for the type definitions. |
| 240 | 240 | */ |
| 241 | -function display_addedresource_link($type, $id, $style='') |
|
| 241 | +function display_addedresource_link($type, $id, $style = '') |
|
| 242 | 242 | { |
| 243 | 243 | global $_course; |
| 244 | 244 | |
@@ -283,9 +283,9 @@ discard block |
||
| 283 | 283 | break; |
| 284 | 284 | case 'Thread': //=topics |
| 285 | 285 | //deprecated |
| 286 | - $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
|
| 287 | - $tbl_posts_text = $_course['dbNameGlu'].'bb_posts_text'; |
|
| 288 | - $TBL_FORUMS = $_course['dbNameGlu'].'bb_forums'; |
|
| 286 | + $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
|
| 287 | + $tbl_posts_text = $_course['dbNameGlu'].'bb_posts_text'; |
|
| 288 | + $TBL_FORUMS = $_course['dbNameGlu'].'bb_forums'; |
|
| 289 | 289 | $result = Database::query("SELECT * FROM $tbl_posts posts, $TBL_FORUMS forum WHERE forum.forum_id=posts.forum_id and post_id=$id"); |
| 290 | 290 | $myrow = Database::fetch_array($result); |
| 291 | 291 | // grabbing the title of the post |
@@ -307,14 +307,14 @@ discard block |
||
| 307 | 307 | $dbTable = Database::get_course_table(TABLE_DOCUMENT); |
| 308 | 308 | $result = Database::query("SELECT * FROM $dbTable WHERE c_id = $course_id AND id=$id"); |
| 309 | 309 | $myrow = Database::fetch_array($result); |
| 310 | - $pathname = explode('/',$myrow['path']); // making a correct name for the link |
|
| 311 | - $last = count($pathname) - 1; // making a correct name for the link |
|
| 312 | - $filename = $pathname[$last]; // making a correct name for the link |
|
| 310 | + $pathname = explode('/', $myrow['path']); // making a correct name for the link |
|
| 311 | + $last = count($pathname) - 1; // making a correct name for the link |
|
| 312 | + $filename = $pathname[$last]; // making a correct name for the link |
|
| 313 | 313 | $image = choose_image($filename); |
| 314 | - $ext = explode('.',$filename); |
|
| 315 | - $ext = strtolower($ext[sizeof($ext)-1]); |
|
| 314 | + $ext = explode('.', $filename); |
|
| 315 | + $ext = strtolower($ext[sizeof($ext) - 1]); |
|
| 316 | 316 | $myrow['path'] = rawurlencode($myrow['path']); |
| 317 | - $in_frames = in_array($ext, array('htm','html','gif','jpg','jpeg','png')); |
|
| 317 | + $in_frames = in_array($ext, array('htm', 'html', 'gif', 'jpg', 'jpeg', 'png')); |
|
| 318 | 318 | echo '<img src="../img/'.$image.'" align="middle" /> <a href="../document/'.($in_frames ? 'showinframes.php?file=' : 'download.php?doc_url=').$myrow['path'].'"'.$styling.'>'.$filename."</a><br />\n"; |
| 319 | 319 | break; |
| 320 | 320 | case 'Externallink': |
@@ -349,391 +349,391 @@ discard block |
||
| 349 | 349 | |
| 350 | 350 | $length = ((($builder == 'builder') and ($icon == 'nolink')) ? 65 : 32); |
| 351 | 351 | |
| 352 | - if ($builder != 'builder') $origin = 'learnpath'; //origin = learnpath in student view |
|
| 352 | + if ($builder != 'builder') $origin = 'learnpath'; //origin = learnpath in student view |
|
| 353 | 353 | $linktype = $type; |
| 354 | 354 | if (($type == 'Link _self') or ($type == 'Link _blank')) $type = 'Link'; |
| 355 | 355 | |
| 356 | 356 | switch ($type) |
| 357 | 357 | { |
| 358 | 358 | case "Agenda": |
| 359 | - $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA); |
|
| 359 | + $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA); |
|
| 360 | 360 | $result = Database::query("SELECT * FROM $TABLEAGENDA WHERE id=$id"); |
| 361 | - $myrow=Database::fetch_array($result); |
|
| 362 | - |
|
| 363 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 364 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 365 | - if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 366 | - $desc=$row['description']; |
|
| 367 | - $agenda_id=$row['item_id']; |
|
| 368 | - echo str_repeat(" >",$level); |
|
| 361 | + $myrow = Database::fetch_array($result); |
|
| 362 | + |
|
| 363 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 364 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 365 | + if ($row['title'] != '') { $myrow["title"] = $row['title']; } |
|
| 366 | + $desc = $row['description']; |
|
| 367 | + $agenda_id = $row['item_id']; |
|
| 368 | + echo str_repeat(" >", $level); |
|
| 369 | 369 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 370 | 370 | if ($icon != 'nolink') |
| 371 | 371 | { |
| 372 | - if ($completed=='completed') { |
|
| 372 | + if ($completed == 'completed') { |
|
| 373 | 373 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 374 | - } else { |
|
| 374 | + } else { |
|
| 375 | 375 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 376 | 376 | //echo " "; |
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 380 | 380 | |
| 381 | - if ($myrow["title"]=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 381 | + if ($myrow["title"] == '') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 382 | 382 | |
| 383 | - if ($icon == 'nolink') { return(shorten($myrow["title"],$length)); } |
|
| 383 | + if ($icon == 'nolink') { return(shorten($myrow["title"], $length)); } |
|
| 384 | 384 | if ($icon == 'icon') { echo "<img src='../img/agenda.gif' align=\"absmiddle\" alt='agenda'>"; } |
| 385 | 385 | if ($builder != 'builder') |
| 386 | 386 | { |
| 387 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path\" class='$completed'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 388 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path"; |
|
| 387 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path\" class='$completed'>".shorten($myrow["title"], ($length - 3 * $level))."</a>"; |
|
| 388 | + $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Agenda&origin=$origin&agenda_id=$agenda_id#$id_in_path"; |
|
| 389 | 389 | if ($desc != '') |
| 390 | 390 | { |
| 391 | 391 | if ($icon != 'wrap') |
| 392 | 392 | { |
| 393 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 393 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; |
|
| 394 | 394 | } |
| 395 | 395 | else |
| 396 | 396 | { |
| 397 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 397 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; |
|
| 398 | 398 | } |
| 399 | 399 | } |
| 400 | 400 | } |
| 401 | 401 | else |
| 402 | 402 | { |
| 403 | - echo "<a href=\"../calendar/agenda.php?origin=$origin&agenda_id=$agenda_id\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 403 | + echo "<a href=\"../calendar/agenda.php?origin=$origin&agenda_id=$agenda_id\" class='$completed' target='_blank'>".shorten($myrow["title"], ($length - 3 * $level))."</a>"; |
|
| 404 | 404 | } |
| 405 | 405 | break; |
| 406 | 406 | |
| 407 | 407 | case "Ad_Valvas": |
| 408 | 408 | $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT); |
| 409 | 409 | $result = Database::query("SELECT * FROM $tbl_announcement WHERE id=$id"); |
| 410 | - $myrow=Database::fetch_array($result); |
|
| 410 | + $myrow = Database::fetch_array($result); |
|
| 411 | 411 | |
| 412 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 413 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 414 | - if ($row['title'] != '') { $myrow["content"]=$row['title']; } |
|
| 415 | - $desc=$row['description']; |
|
| 416 | - $ann_id=$row['item_id']; |
|
| 417 | - echo str_repeat(" >",$level); |
|
| 412 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 413 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 414 | + if ($row['title'] != '') { $myrow["content"] = $row['title']; } |
|
| 415 | + $desc = $row['description']; |
|
| 416 | + $ann_id = $row['item_id']; |
|
| 417 | + echo str_repeat(" >", $level); |
|
| 418 | 418 | |
| 419 | 419 | // the title and the text are in the content field and we only want to display the title |
| 420 | - list($title, $text)=split('<br>',$myrow['content']); |
|
| 421 | - if ($title=='') { $title=$myrow['content']; } |
|
| 422 | - $title=$myrow['title']; |
|
| 423 | - $text=$myrow['content']; |
|
| 420 | + list($title, $text) = split('<br>', $myrow['content']); |
|
| 421 | + if ($title == '') { $title = $myrow['content']; } |
|
| 422 | + $title = $myrow['title']; |
|
| 423 | + $text = $myrow['content']; |
|
| 424 | 424 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 425 | 425 | if ($icon != 'nolink') |
| 426 | 426 | { |
| 427 | - if ($completed=='completed') { |
|
| 427 | + if ($completed == 'completed') { |
|
| 428 | 428 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 429 | - } else { |
|
| 429 | + } else { |
|
| 430 | 430 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 431 | 431 | //echo " "; |
| 432 | 432 | } |
| 433 | 433 | } |
| 434 | 434 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 435 | 435 | |
| 436 | - if ($title=='') { |
|
| 437 | - $type="Announcement"; |
|
| 436 | + if ($title == '') { |
|
| 437 | + $type = "Announcement"; |
|
| 438 | 438 | echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; |
| 439 | 439 | return(true); |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | - if ($icon == 'nolink') { return(shorten($title,$length)); } |
|
| 442 | + if ($icon == 'nolink') { return(shorten($title, $length)); } |
|
| 443 | 443 | if ($icon == 'icon') { echo "<img src='../img/valves.gif' align=\"absmiddle\" alt='ad valvas'>"; } |
| 444 | 444 | if ($builder != 'builder') |
| 445 | 445 | { |
| 446 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$ann_id#$id_in_path\" class='$completed'>".shorten($title,($length-3*$level))."</a>"; |
|
| 447 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$ann_id#$id_in_path"; |
|
| 446 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$ann_id#$id_in_path\" class='$completed'>".shorten($title, ($length - 3 * $level))."</a>"; |
|
| 447 | + $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Ad_Valvas&origin=$origin&ann_id=$ann_id#$id_in_path"; |
|
| 448 | 448 | if ($desc != '') |
| 449 | 449 | { |
| 450 | 450 | if ($icon != 'wrap') |
| 451 | 451 | { |
| 452 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 452 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; |
|
| 453 | 453 | } |
| 454 | 454 | else |
| 455 | 455 | { |
| 456 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 456 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; |
|
| 457 | 457 | } |
| 458 | 458 | } |
| 459 | 459 | } |
| 460 | 460 | else |
| 461 | 461 | { |
| 462 | - echo "<a href=\"../announcements/announcements.php?origin=$origin&ann_id=$ann_id\" class='$completed' target='_blank'>".shorten($title,($length-3*$level))."</a>"; |
|
| 462 | + echo "<a href=\"../announcements/announcements.php?origin=$origin&ann_id=$ann_id\" class='$completed' target='_blank'>".shorten($title, ($length - 3 * $level))."</a>"; |
|
| 463 | 463 | } |
| 464 | 464 | break; |
| 465 | 465 | |
| 466 | 466 | case "Link" : |
| 467 | - $TABLETOOLLINK = Database::get_course_table(TABLE_LINK); |
|
| 468 | - $result= Database::query("SELECT * FROM $TABLETOOLLINK WHERE id=$id"); |
|
| 469 | - $myrow=Database::fetch_array($result); |
|
| 467 | + $TABLETOOLLINK = Database::get_course_table(TABLE_LINK); |
|
| 468 | + $result = Database::query("SELECT * FROM $TABLETOOLLINK WHERE id=$id"); |
|
| 469 | + $myrow = Database::fetch_array($result); |
|
| 470 | 470 | |
| 471 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 472 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 473 | - if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 474 | - $desc=$row['description']; |
|
| 475 | - echo str_repeat(" >",$level); |
|
| 471 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 472 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 473 | + if ($row['title'] != '') { $myrow["title"] = $row['title']; } |
|
| 474 | + $desc = $row['description']; |
|
| 475 | + echo str_repeat(" >", $level); |
|
| 476 | 476 | |
| 477 | 477 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 478 | 478 | if ($icon != 'nolink') |
| 479 | 479 | { |
| 480 | - if ($completed=='completed') { |
|
| 480 | + if ($completed == 'completed') { |
|
| 481 | 481 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 482 | - } else { |
|
| 482 | + } else { |
|
| 483 | 483 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 484 | 484 | //echo " "; |
| 485 | 485 | } |
| 486 | 486 | } |
| 487 | 487 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 488 | 488 | |
| 489 | - if ($myrow["title"]=='') |
|
| 489 | + if ($myrow["title"] == '') |
|
| 490 | 490 | { |
| 491 | 491 | echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; |
| 492 | 492 | return(true); |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | - if ($icon == 'nolink') { return(shorten($myrow["title"],$length)); } |
|
| 495 | + if ($icon == 'nolink') { return(shorten($myrow["title"], $length)); } |
|
| 496 | 496 | if ($icon == 'icon') |
| 497 | 497 | { |
| 498 | - if ($linktype=='Link _self') { echo "<img src='../img/links.gif' align=\"absmiddle\" alt='links'>"; } |
|
| 498 | + if ($linktype == 'Link _self') { echo "<img src='../img/links.gif' align=\"absmiddle\" alt='links'>"; } |
|
| 499 | 499 | else { echo "<img src='../img/link_blank.gif' align=\"absmiddle\" alt='blank links'>"; } |
| 500 | 500 | } |
| 501 | - $thelink=$myrow["url"]; |
|
| 501 | + $thelink = $myrow["url"]; |
|
| 502 | 502 | if ($builder != 'builder') |
| 503 | 503 | { |
| 504 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path\" class='$completed'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 505 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path"; |
|
| 504 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path\" class='$completed'>".shorten($myrow["title"], ($length - 3 * $level))."</a>"; |
|
| 505 | + $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path"; |
|
| 506 | 506 | if ($desc != '') |
| 507 | 507 | { |
| 508 | 508 | if ($icon != 'wrap') |
| 509 | 509 | { |
| 510 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 510 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; |
|
| 511 | 511 | } |
| 512 | 512 | else |
| 513 | 513 | { |
| 514 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 514 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; |
|
| 515 | 515 | } |
| 516 | 516 | } |
| 517 | 517 | } |
| 518 | 518 | else |
| 519 | 519 | { |
| 520 | - echo "<a href=\"$thelink\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 520 | + echo "<a href=\"$thelink\" class='$completed' target='_blank'>".shorten($myrow["title"], ($length - 3 * $level))."</a>"; |
|
| 521 | 521 | } |
| 522 | 522 | break; |
| 523 | 523 | |
| 524 | 524 | case "Exercise": |
| 525 | - $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
|
| 526 | - $result= Database::query("SELECT * FROM $TBL_EXERCICES WHERE id=$id"); |
|
| 527 | - $myrow=Database::fetch_array($result); |
|
| 525 | + $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
|
| 526 | + $result = Database::query("SELECT * FROM $TBL_EXERCICES WHERE id=$id"); |
|
| 527 | + $myrow = Database::fetch_array($result); |
|
| 528 | 528 | |
| 529 | - if ($builder=='builder') { $origin='builder'; } |
|
| 529 | + if ($builder == 'builder') { $origin = 'builder'; } |
|
| 530 | 530 | //this is needed for the exercise_submit.php can delete the session info about tests |
| 531 | 531 | |
| 532 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 533 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 534 | - if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 535 | - $desc=$row['description']; |
|
| 536 | - echo str_repeat(" >",$level); |
|
| 532 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 533 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 534 | + if ($row['title'] != '') { $myrow["title"] = $row['title']; } |
|
| 535 | + $desc = $row['description']; |
|
| 536 | + echo str_repeat(" >", $level); |
|
| 537 | 537 | |
| 538 | 538 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 539 | 539 | if ($icon != 'nolink') |
| 540 | 540 | { |
| 541 | - if ($completed=='completed') { |
|
| 541 | + if ($completed == 'completed') { |
|
| 542 | 542 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 543 | - } else { |
|
| 543 | + } else { |
|
| 544 | 544 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 545 | 545 | //echo " "; |
| 546 | 546 | } |
| 547 | 547 | } |
| 548 | 548 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 549 | 549 | |
| 550 | - if ($myrow["title"]=='') { |
|
| 550 | + if ($myrow["title"] == '') { |
|
| 551 | 551 | echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; |
| 552 | 552 | return(true); |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | - if ($icon == 'nolink') { return(shorten($myrow["title"],$length)); } |
|
| 555 | + if ($icon == 'nolink') { return(shorten($myrow["title"], $length)); } |
|
| 556 | 556 | if ($icon == 'icon') { echo "<img src='../img/quiz.gif' align=\"absmiddle\" alt='quizz'>"; } |
| 557 | 557 | if ($builder != 'builder') |
| 558 | 558 | { |
| 559 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path\" class='$completed'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 560 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path"; |
|
| 559 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path\" class='$completed'>".shorten($myrow["title"], ($length - 3 * $level))."</a>"; |
|
| 560 | + $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Exercise&origin=$origin&exerciseId=".$myrow["id"]."#$id_in_path"; |
|
| 561 | 561 | if ($desc != '') |
| 562 | 562 | { |
| 563 | 563 | if ($icon != 'wrap') |
| 564 | 564 | { |
| 565 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 565 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; |
|
| 566 | 566 | } |
| 567 | 567 | else |
| 568 | 568 | { |
| 569 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 569 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; |
|
| 570 | 570 | } |
| 571 | 571 | } |
| 572 | 572 | } |
| 573 | 573 | else |
| 574 | 574 | { |
| 575 | - echo "<a href=\"../exercise/exercise_submit.php?origin=$origin&exerciseId=".$myrow["id"]."\" class='$completed' target='_blank'>".shorten($myrow["title"],($length-3*$level))."</a>"; |
|
| 575 | + echo "<a href=\"../exercise/exercise_submit.php?origin=$origin&exerciseId=".$myrow["id"]."\" class='$completed' target='_blank'>".shorten($myrow["title"], ($length - 3 * $level))."</a>"; |
|
| 576 | 576 | } |
| 577 | 577 | break; |
| 578 | 578 | |
| 579 | 579 | case "HotPotatoes": |
| 580 | - $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT); |
|
| 581 | - $documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
|
| 580 | + $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT); |
|
| 581 | + $documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
|
| 582 | 582 | $result = Database::query("SELECT * FROM ".$TBL_DOCUMENT." WHERE id=$id"); |
| 583 | - $myrow= Database::fetch_array($result); |
|
| 584 | - $path=$myrow["path"]; |
|
| 585 | - $name=GetQuizName($path,$documentPath); |
|
| 583 | + $myrow = Database::fetch_array($result); |
|
| 584 | + $path = $myrow["path"]; |
|
| 585 | + $name = GetQuizName($path, $documentPath); |
|
| 586 | 586 | |
| 587 | - if ($builder=='builder') { $origin='builder'; } |
|
| 587 | + if ($builder == 'builder') { $origin = 'builder'; } |
|
| 588 | 588 | //this is needed for the exercise_submit.php can delete the session info about tests |
| 589 | 589 | |
| 590 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 591 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 592 | - if ($row['title'] != '') { $name=$row['title']; } |
|
| 593 | - $desc=$row['description']; |
|
| 594 | - echo str_repeat(" >",$level); |
|
| 590 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 591 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 592 | + if ($row['title'] != '') { $name = $row['title']; } |
|
| 593 | + $desc = $row['description']; |
|
| 594 | + echo str_repeat(" >", $level); |
|
| 595 | 595 | |
| 596 | 596 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 597 | 597 | if ($icon != 'nolink') |
| 598 | 598 | { |
| 599 | - if ($completed=='completed') { |
|
| 599 | + if ($completed == 'completed') { |
|
| 600 | 600 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 601 | - } else { |
|
| 601 | + } else { |
|
| 602 | 602 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 603 | 603 | //echo " "; |
| 604 | 604 | } |
| 605 | 605 | } |
| 606 | 606 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 607 | 607 | |
| 608 | - if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 608 | + if ($name == '') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 609 | 609 | |
| 610 | - if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 610 | + if ($icon == 'nolink') { return(shorten($name, $length)); } |
|
| 611 | 611 | if ($icon == 'icon') { echo "<img src='../img/jqz.gif' align=\"absmiddle\" alt='hot potatoes'>"; } |
| 612 | 612 | |
| 613 | 613 | $cid = $_course['official_code']; |
| 614 | 614 | |
| 615 | 615 | if ($builder != 'builder') |
| 616 | 616 | { |
| 617 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; |
|
| 618 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path"; |
|
| 617 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path\" class='$completed'>".shorten($name, ($length - 3 * $level))."</a>"; |
|
| 618 | + $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=HotPotatoes&origin=$origin&id=$id#$id_in_path"; |
|
| 619 | 619 | if ($desc != '') |
| 620 | 620 | { |
| 621 | 621 | if ($icon != 'wrap') |
| 622 | 622 | { |
| 623 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 623 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; |
|
| 624 | 624 | } |
| 625 | 625 | else |
| 626 | 626 | { |
| 627 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 627 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; |
|
| 628 | 628 | } |
| 629 | 629 | } |
| 630 | 630 | } |
| 631 | 631 | else |
| 632 | 632 | { |
| 633 | - echo " <a href=\"../exercise/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 633 | + echo " <a href=\"../exercise/showinframes.php?file=$path&cid=$cid&uid=".$_user['user_id']."\" class='$completed' target='_blank'>".shorten($name, ($length - 3 * $level))."</a>"; |
|
| 634 | 634 | } |
| 635 | 635 | break; |
| 636 | 636 | |
| 637 | 637 | case "Forum": |
| 638 | 638 | $TBL_FORUMS = Database::get_course_table(TABLE_FORUM); |
| 639 | - $result= Database::query("SELECT * FROM $TBL_FORUMS WHERE forum_id=$id"); |
|
| 640 | - $myrow=Database::fetch_array($result); |
|
| 639 | + $result = Database::query("SELECT * FROM $TBL_FORUMS WHERE forum_id=$id"); |
|
| 640 | + $myrow = Database::fetch_array($result); |
|
| 641 | 641 | |
| 642 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 643 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 644 | - if ($row['title'] != '') { $myrow["forum_name"]=$row['title']; } |
|
| 645 | - $desc=$row['description']; |
|
| 646 | - echo str_repeat(" >",$level); |
|
| 642 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 643 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 644 | + if ($row['title'] != '') { $myrow["forum_name"] = $row['title']; } |
|
| 645 | + $desc = $row['description']; |
|
| 646 | + echo str_repeat(" >", $level); |
|
| 647 | 647 | |
| 648 | 648 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 649 | 649 | if ($icon != 'nolink') |
| 650 | 650 | { |
| 651 | - if ($completed=='completed') { |
|
| 651 | + if ($completed == 'completed') { |
|
| 652 | 652 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 653 | - } else { |
|
| 653 | + } else { |
|
| 654 | 654 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 655 | 655 | //echo " "; |
| 656 | 656 | } |
| 657 | 657 | } |
| 658 | 658 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 659 | 659 | |
| 660 | - if ($myrow["forum_name"]=='') { $type="Forum"; echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 660 | + if ($myrow["forum_name"] == '') { $type = "Forum"; echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 661 | 661 | |
| 662 | - if ($icon == 'nolink') { return(shorten($myrow["forum_name"],$length)); } |
|
| 662 | + if ($icon == 'nolink') { return(shorten($myrow["forum_name"], $length)); } |
|
| 663 | 663 | if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; } |
| 664 | - $forumparameters="forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]; |
|
| 664 | + $forumparameters = "forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]; |
|
| 665 | 665 | if ($builder != 'builder') |
| 666 | 666 | { |
| 667 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path\" class='$completed'>".shorten($myrow["forum_name"],($length-3*$level))."</a>"; |
|
| 668 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path"; |
|
| 667 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path\" class='$completed'>".shorten($myrow["forum_name"], ($length - 3 * $level))."</a>"; |
|
| 668 | + $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path"; |
|
| 669 | 669 | if ($desc != '') |
| 670 | 670 | { |
| 671 | 671 | if ($icon != 'wrap') |
| 672 | 672 | { |
| 673 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 673 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; |
|
| 674 | 674 | } |
| 675 | 675 | else |
| 676 | 676 | { |
| 677 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 677 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; |
|
| 678 | 678 | } |
| 679 | 679 | } |
| 680 | 680 | } |
| 681 | 681 | else |
| 682 | 682 | { |
| 683 | - echo "<a href=\"../phpbb/viewforum.php?$forumparameters\" class='$completed' target='_blank'>".shorten($myrow["forum_name"],($length-3*$level))."</a>"; |
|
| 683 | + echo "<a href=\"../phpbb/viewforum.php?$forumparameters\" class='$completed' target='_blank'>".shorten($myrow["forum_name"], ($length - 3 * $level))."</a>"; |
|
| 684 | 684 | } |
| 685 | 685 | break; |
| 686 | 686 | |
| 687 | 687 | case "Thread": //forum post |
| 688 | 688 | //deprecated |
| 689 | - $tbl_topics = $_course['dbNameGlu'].'bb_topics'; |
|
| 690 | - $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
|
| 689 | + $tbl_topics = $_course['dbNameGlu'].'bb_topics'; |
|
| 690 | + $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
|
| 691 | 691 | $TBL_FORUMS = $_course['dbNameGlu']."bb_forums"; |
| 692 | - $sql="SELECT * FROM $tbl_topics where topic_id=$id"; |
|
| 693 | - $result= Database::query($sql); |
|
| 694 | - $myrow=Database::fetch_array($result); |
|
| 692 | + $sql = "SELECT * FROM $tbl_topics where topic_id=$id"; |
|
| 693 | + $result = Database::query($sql); |
|
| 694 | + $myrow = Database::fetch_array($result); |
|
| 695 | 695 | |
| 696 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 697 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 698 | - if ($row['title'] != '') { $myrow["topic_title"]=$row['title']; } |
|
| 699 | - $desc=$row['description']; |
|
| 700 | - echo str_repeat(" >",$level); |
|
| 696 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 697 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 698 | + if ($row['title'] != '') { $myrow["topic_title"] = $row['title']; } |
|
| 699 | + $desc = $row['description']; |
|
| 700 | + echo str_repeat(" >", $level); |
|
| 701 | 701 | |
| 702 | 702 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 703 | 703 | if ($icon != 'nolink') |
| 704 | 704 | { |
| 705 | - if ($completed=='completed') { |
|
| 705 | + if ($completed == 'completed') { |
|
| 706 | 706 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 707 | - } else { |
|
| 707 | + } else { |
|
| 708 | 708 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 709 | 709 | //echo " "; |
| 710 | 710 | } |
| 711 | 711 | } |
| 712 | 712 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 713 | 713 | |
| 714 | - if ($myrow["topic_title"]=='') { $type="Forum Post"; echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 714 | + if ($myrow["topic_title"] == '') { $type = "Forum Post"; echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 715 | 715 | |
| 716 | - if ($icon == 'nolink') { return(shorten($myrow["topic_title"],$length)); } |
|
| 716 | + if ($icon == 'nolink') { return(shorten($myrow["topic_title"], $length)); } |
|
| 717 | 717 | if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; } |
| 718 | 718 | if ($builder != 'builder') |
| 719 | 719 | { |
| 720 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path\" class='$completed'>".shorten($myrow["topic_title"],($length-3*$level))."</a>"; |
|
| 721 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path"; |
|
| 720 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path\" class='$completed'>".shorten($myrow["topic_title"], ($length - 3 * $level))."</a>"; |
|
| 721 | + $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Thread&origin=$origin&topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."#$id_in_path"; |
|
| 722 | 722 | if ($desc != '') |
| 723 | 723 | { |
| 724 | 724 | if ($icon != 'wrap') |
| 725 | 725 | { |
| 726 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 726 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; |
|
| 727 | 727 | } |
| 728 | 728 | else |
| 729 | 729 | { |
| 730 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 730 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; |
|
| 731 | 731 | } |
| 732 | 732 | } |
| 733 | 733 | } |
| 734 | 734 | else |
| 735 | 735 | { |
| 736 | - echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow["topic_title"],($length-3*$level))."</a>"; |
|
| 736 | + echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow["topic_title"], ($length - 3 * $level))."</a>"; |
|
| 737 | 737 | } |
| 738 | 738 | break; |
| 739 | 739 | |
@@ -742,363 +742,363 @@ discard block |
||
| 742 | 742 | $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
| 743 | 743 | $tbl_posts_text = $_course['dbNameGlu'].'bb_posts_text'; |
| 744 | 744 | $TBL_FORUMS = $_course['dbNameGlu']."bb_forums"; |
| 745 | - $result= Database::query("SELECT * FROM $tbl_posts where post_id=$id"); |
|
| 746 | - $myrow=Database::fetch_array($result); |
|
| 745 | + $result = Database::query("SELECT * FROM $tbl_posts where post_id=$id"); |
|
| 746 | + $myrow = Database::fetch_array($result); |
|
| 747 | 747 | // grabbing the title of the post |
| 748 | - $sql_titel="SELECT * FROM $tbl_posts_text WHERE post_id=".$myrow["post_id"]; |
|
| 749 | - $result_titel=Database::query($sql_titel); |
|
| 750 | - $myrow_titel=Database::fetch_array($result_titel); |
|
| 748 | + $sql_titel = "SELECT * FROM $tbl_posts_text WHERE post_id=".$myrow["post_id"]; |
|
| 749 | + $result_titel = Database::query($sql_titel); |
|
| 750 | + $myrow_titel = Database::fetch_array($result_titel); |
|
| 751 | 751 | |
| 752 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 753 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 754 | - if ($row['title'] != '') { $myrow_titel["post_title"]=$row['title']; } |
|
| 755 | - $desc=$row['description']; |
|
| 756 | - echo str_repeat(" >",$level); |
|
| 752 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 753 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 754 | + if ($row['title'] != '') { $myrow_titel["post_title"] = $row['title']; } |
|
| 755 | + $desc = $row['description']; |
|
| 756 | + echo str_repeat(" >", $level); |
|
| 757 | 757 | |
| 758 | - $posternom=$myrow['nom']; $posterprenom=$myrow['prenom']; |
|
| 759 | - $posttime=$myrow['post_time']; $posttext=$myrow_titel['post_text']; |
|
| 760 | - $posttitle=$myrow_titel['post_title']; |
|
| 761 | - $posttext = str_replace('"',"'",$posttext); |
|
| 758 | + $posternom = $myrow['nom']; $posterprenom = $myrow['prenom']; |
|
| 759 | + $posttime = $myrow['post_time']; $posttext = $myrow_titel['post_text']; |
|
| 760 | + $posttitle = $myrow_titel['post_title']; |
|
| 761 | + $posttext = str_replace('"', "'", $posttext); |
|
| 762 | 762 | |
| 763 | 763 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 764 | 764 | if ($icon != 'nolink') |
| 765 | 765 | { |
| 766 | - if ($completed=='completed') { |
|
| 766 | + if ($completed == 'completed') { |
|
| 767 | 767 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 768 | - } else { |
|
| 768 | + } else { |
|
| 769 | 769 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 770 | 770 | //echo " "; |
| 771 | 771 | } |
| 772 | 772 | } |
| 773 | 773 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 774 | 774 | |
| 775 | - if ($myrow_titel["post_title"]=='') |
|
| 775 | + if ($myrow_titel["post_title"] == '') |
|
| 776 | 776 | { |
| 777 | - $type="Forum"; |
|
| 777 | + $type = "Forum"; |
|
| 778 | 778 | echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); |
| 779 | 779 | } |
| 780 | 780 | |
| 781 | - if ($icon == 'nolink') { return(shorten($myrow_titel["post_title"],$length)); } |
|
| 781 | + if ($icon == 'nolink') { return(shorten($myrow_titel["post_title"], $length)); } |
|
| 782 | 782 | if ($icon == 'icon') { echo "<img src='../img/forum.gif' align=\"absmiddle\" alt='forum'>"; } |
| 783 | 783 | if ($builder != 'builder') |
| 784 | 784 | { |
| 785 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Post&origin=$origin&posternom=$posternom&posterprenom=$posterprenom&posttime=$posttime&posttext=$posttext&posttitle=$posttitle#$id_in_path\" class='$completed'>".shorten($myrow_titel["post_title"],($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Post&origin=$origin&posternom=$posternom&posterprenom=$posterprenom&posttime=$posttime&posttext=$posttext&posttitle=$posttitle#$id_in_path"; |
|
| 785 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Post&origin=$origin&posternom=$posternom&posterprenom=$posterprenom&posttime=$posttime&posttext=$posttext&posttitle=$posttitle#$id_in_path\" class='$completed'>".shorten($myrow_titel["post_title"], ($length - 3 * $level))."</a>"; $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Post&origin=$origin&posternom=$posternom&posterprenom=$posterprenom&posttime=$posttime&posttext=$posttext&posttitle=$posttitle#$id_in_path"; |
|
| 786 | 786 | if ($desc != '') |
| 787 | 787 | { |
| 788 | 788 | if ($icon != 'wrap') |
| 789 | 789 | { |
| 790 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 790 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; |
|
| 791 | 791 | } |
| 792 | 792 | else |
| 793 | 793 | { |
| 794 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 794 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; |
|
| 795 | 795 | } |
| 796 | 796 | } |
| 797 | 797 | } |
| 798 | 798 | else |
| 799 | 799 | { |
| 800 | - echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow_titel["post_title"],($length-3*$level))."</a>"; |
|
| 800 | + echo "<a href=\"../phpbb/viewtopic.php?topic=".$myrow["topic_id"]."&forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]."\" class='$completed' target='_blank'>".shorten($myrow_titel["post_title"], ($length - 3 * $level))."</a>"; |
|
| 801 | 801 | } |
| 802 | 802 | break; |
| 803 | 803 | |
| 804 | 804 | case "Document": |
| 805 | - $dbTable = Database::get_course_table(TABLE_DOCUMENT); |
|
| 806 | - $result=Database::query("SELECT * FROM $dbTable WHERE id=$id"); |
|
| 807 | - $myrow=Database::fetch_array($result); |
|
| 805 | + $dbTable = Database::get_course_table(TABLE_DOCUMENT); |
|
| 806 | + $result = Database::query("SELECT * FROM $dbTable WHERE id=$id"); |
|
| 807 | + $myrow = Database::fetch_array($result); |
|
| 808 | 808 | |
| 809 | - $pathname=explode("/",$myrow["path"]); // making a correct name for the link |
|
| 810 | - $last=count($pathname)-1; // making a correct name for the link |
|
| 811 | - $filename=$pathname[$last]; // making a correct name for the link |
|
| 809 | + $pathname = explode("/", $myrow["path"]); // making a correct name for the link |
|
| 810 | + $last = count($pathname) - 1; // making a correct name for the link |
|
| 811 | + $filename = $pathname[$last]; // making a correct name for the link |
|
| 812 | 812 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 813 | 813 | |
| 814 | - echo str_repeat(" >",$level); |
|
| 814 | + echo str_repeat(" >", $level); |
|
| 815 | 815 | |
| 816 | 816 | if ($icon != 'nolink') { |
| 817 | - if ($completed=='completed') { |
|
| 817 | + if ($completed == 'completed') { |
|
| 818 | 818 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 819 | - } else { |
|
| 819 | + } else { |
|
| 820 | 820 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 821 | 821 | //echo " "; |
| 822 | 822 | } |
| 823 | 823 | } |
| 824 | 824 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 825 | - $image=choose_image($filename); |
|
| 825 | + $image = choose_image($filename); |
|
| 826 | 826 | |
| 827 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 828 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 829 | - if ($row['title'] != '') { $filename=$row['title']; } |
|
| 830 | - $desc=$row['description']; |
|
| 827 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 828 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 829 | + if ($row['title'] != '') { $filename = $row['title']; } |
|
| 830 | + $desc = $row['description']; |
|
| 831 | 831 | |
| 832 | - if (($myrow["path"]=='') and ($filename=='')) { |
|
| 832 | + if (($myrow["path"] == '') and ($filename == '')) { |
|
| 833 | 833 | echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; |
| 834 | 834 | return(true); |
| 835 | 835 | } |
| 836 | 836 | |
| 837 | - if ($icon == 'nolink') { return(shorten($filename,$length)); } |
|
| 837 | + if ($icon == 'nolink') { return(shorten($filename, $length)); } |
|
| 838 | 838 | if ($icon == 'icon') { echo "<img src='../img/$image' align=\"absmiddle\" alt='$image'>"; } |
| 839 | 839 | if ($builder != 'builder') |
| 840 | 840 | { |
| 841 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path\" class='$completed'>".shorten($filename,($length-3*$level))."</a>"; |
|
| 841 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path\" class='$completed'>".shorten($filename, ($length - 3 * $level))."</a>"; |
|
| 842 | 842 | if ($desc != '') |
| 843 | 843 | { |
| 844 | 844 | if ($icon != 'wrap') |
| 845 | 845 | { |
| 846 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 846 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; |
|
| 847 | 847 | } |
| 848 | 848 | else |
| 849 | 849 | { |
| 850 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 850 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; |
|
| 851 | 851 | } |
| 852 | - } $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path"; |
|
| 852 | + } $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Document&origin=$origin&docurl=".$myrow["path"]."#$id_in_path"; |
|
| 853 | 853 | } |
| 854 | 854 | else |
| 855 | 855 | { |
| 856 | - $enableDocumentParsing='yes'; |
|
| 856 | + $enableDocumentParsing = 'yes'; |
|
| 857 | 857 | if (!$enableDocumentParsing) |
| 858 | 858 | { //this is the solution for the non-parsing version in the builder |
| 859 | - $file=urlencode($myrow["path"]); |
|
| 860 | - echo "<a href='../document/showinframes.php?file=$file' class='$completed' $hyperlink_target_parameter>".shorten($filename,($length-3*$level))."</a>"; |
|
| 859 | + $file = urlencode($myrow["path"]); |
|
| 860 | + echo "<a href='../document/showinframes.php?file=$file' class='$completed' $hyperlink_target_parameter>".shorten($filename, ($length - 3 * $level))."</a>"; |
|
| 861 | 861 | } |
| 862 | 862 | else |
| 863 | 863 | { |
| 864 | - echo "<a href=\"../document/download.php?doc_url=".$myrow["path"]."\" class='$completed' $hyperlink_target_parameter>".shorten($filename,($length-3*$level))."</a>"; |
|
| 864 | + echo "<a href=\"../document/download.php?doc_url=".$myrow["path"]."\" class='$completed' $hyperlink_target_parameter>".shorten($filename, ($length - 3 * $level))."</a>"; |
|
| 865 | 865 | } |
| 866 | 866 | } |
| 867 | 867 | break; |
| 868 | 868 | |
| 869 | 869 | case "Assignments": |
| 870 | - $name=get_lang('Assignments'); |
|
| 871 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 872 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 873 | - if ($row['title'] != '') { $name=$row['title']; } |
|
| 874 | - $desc=$row['description']; |
|
| 875 | - echo str_repeat(" >",$level); |
|
| 870 | + $name = get_lang('Assignments'); |
|
| 871 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 872 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 873 | + if ($row['title'] != '') { $name = $row['title']; } |
|
| 874 | + $desc = $row['description']; |
|
| 875 | + echo str_repeat(" >", $level); |
|
| 876 | 876 | |
| 877 | 877 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 878 | 878 | if ($icon != 'nolink') |
| 879 | 879 | { |
| 880 | - if ($completed=='completed') { |
|
| 880 | + if ($completed == 'completed') { |
|
| 881 | 881 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 882 | - } else { |
|
| 882 | + } else { |
|
| 883 | 883 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 884 | 884 | //echo " "; |
| 885 | 885 | } |
| 886 | 886 | } |
| 887 | 887 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 888 | 888 | |
| 889 | - if ($name=='') |
|
| 889 | + if ($name == '') |
|
| 890 | 890 | { |
| 891 | 891 | echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); |
| 892 | 892 | } |
| 893 | 893 | |
| 894 | - if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 894 | + if ($icon == 'nolink') { return(shorten($name, $length)); } |
|
| 895 | 895 | if ($icon == 'icon') { echo "<img src='../img/works.gif' align=\"absmiddle\">"; } |
| 896 | 896 | if ($builder != 'builder') |
| 897 | 897 | { |
| 898 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path"; |
|
| 898 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path\" class='$completed'>".shorten($name, ($length - 3 * $level))."</a>"; $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Assignments&origin=$origin#$id_in_path"; |
|
| 899 | 899 | if ($desc != '') |
| 900 | 900 | { |
| 901 | 901 | if ($icon != 'wrap') |
| 902 | 902 | { |
| 903 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; |
|
| 903 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; |
|
| 904 | 904 | } |
| 905 | 905 | else |
| 906 | 906 | { |
| 907 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; |
|
| 907 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; |
|
| 908 | 908 | } |
| 909 | 909 | } |
| 910 | 910 | } |
| 911 | 911 | else |
| 912 | 912 | { |
| 913 | - echo "<a href=\"../work/work.php\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 913 | + echo "<a href=\"../work/work.php\" class='$completed' target='_blank'>".shorten($name, ($length - 3 * $level))."</a>"; |
|
| 914 | 914 | } |
| 915 | 915 | break; |
| 916 | 916 | case "Dropbox": |
| 917 | - $name=get_lang('Dropbox'); |
|
| 918 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 919 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 920 | - if ($row['title'] != '') { $name=$row['title']; } |
|
| 921 | - $desc=$row['description']; |
|
| 922 | - echo str_repeat(" >",$level); |
|
| 917 | + $name = get_lang('Dropbox'); |
|
| 918 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 919 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 920 | + if ($row['title'] != '') { $name = $row['title']; } |
|
| 921 | + $desc = $row['description']; |
|
| 922 | + echo str_repeat(" >", $level); |
|
| 923 | 923 | |
| 924 | 924 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 925 | 925 | if ($icon != 'nolink') { |
| 926 | - if ($completed=='completed') { |
|
| 926 | + if ($completed == 'completed') { |
|
| 927 | 927 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 928 | - } else { |
|
| 928 | + } else { |
|
| 929 | 929 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 930 | 930 | //echo " "; |
| 931 | 931 | } |
| 932 | 932 | } |
| 933 | 933 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 934 | 934 | |
| 935 | - if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 935 | + if ($name == '') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 936 | 936 | |
| 937 | - if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 937 | + if ($icon == 'nolink') { return(shorten($name, $length)); } |
|
| 938 | 938 | if ($icon == 'icon') { echo "<img src='../img/dropbox.gif' align=\"absmiddle\">"; } |
| 939 | 939 | |
| 940 | 940 | if ($builder != 'builder') |
| 941 | 941 | { |
| 942 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path"; |
|
| 942 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path\" class='$completed'>".shorten($name, ($length - 3 * $level))."</a>"; $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Dropbox&origin=$origin#$id_in_path"; |
|
| 943 | 943 | if ($desc != '') { |
| 944 | 944 | if ($icon != 'wrap') { |
| 945 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 945 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; } |
|
| 946 | 946 | else { |
| 947 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 947 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; } |
|
| 948 | 948 | } |
| 949 | 949 | } else { |
| 950 | - echo "<a href=\"../dropbox/index.php\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 950 | + echo "<a href=\"../dropbox/index.php\" class='$completed' target='_blank'>".shorten($name, ($length - 3 * $level))."</a>"; |
|
| 951 | 951 | } |
| 952 | 952 | break; |
| 953 | 953 | case "Introduction_text": |
| 954 | - $name=get_lang('IntroductionText'); |
|
| 955 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 956 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 957 | - if ($row['title'] != '') { $name=$row['title']; } |
|
| 958 | - $desc=$row['description']; |
|
| 959 | - echo str_repeat(" >",$level); |
|
| 954 | + $name = get_lang('IntroductionText'); |
|
| 955 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 956 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 957 | + if ($row['title'] != '') { $name = $row['title']; } |
|
| 958 | + $desc = $row['description']; |
|
| 959 | + echo str_repeat(" >", $level); |
|
| 960 | 960 | |
| 961 | 961 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 962 | 962 | if ($icon != 'nolink') { |
| 963 | - if ($completed=='completed') { |
|
| 963 | + if ($completed == 'completed') { |
|
| 964 | 964 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 965 | - } else { |
|
| 965 | + } else { |
|
| 966 | 966 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 967 | 967 | //echo " "; |
| 968 | 968 | } |
| 969 | 969 | } |
| 970 | 970 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 971 | 971 | |
| 972 | - if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 972 | + if ($name == '') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 973 | 973 | |
| 974 | - if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 974 | + if ($icon == 'nolink') { return(shorten($name, $length)); } |
|
| 975 | 975 | if ($icon == 'icon') { echo "<img src='../img/introduction.gif' align=\"absmiddle\" alt='introduction'>"; } |
| 976 | 976 | |
| 977 | 977 | if ($builder != 'builder') |
| 978 | 978 | { |
| 979 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; |
|
| 980 | - $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path"; |
|
| 979 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path\" class='$completed'>".shorten($name, ($length - 3 * $level))."</a>"; |
|
| 980 | + $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Introduction_text&origin=$origin#$id_in_path"; |
|
| 981 | 981 | if ($desc != '') { |
| 982 | 982 | if ($icon != 'wrap') { |
| 983 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 983 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; } |
|
| 984 | 984 | else { |
| 985 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 985 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; } |
|
| 986 | 986 | } |
| 987 | 987 | } else { |
| 988 | 988 | $s = api_get_path(WEB_COURSE_PATH)."$_cid/index.php?intro_cmdEdit=1"; |
| 989 | - echo "<a href=\"$s\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 989 | + echo "<a href=\"$s\" class='$completed' target='_blank'>".shorten($name, ($length - 3 * $level))."</a>"; |
|
| 990 | 990 | } |
| 991 | 991 | break; |
| 992 | 992 | case "Course_description": |
| 993 | - $name=get_lang('CourseDescription'); |
|
| 994 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 995 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 996 | - if ($row['title'] != '') { $name=$row['title']; } |
|
| 997 | - $desc=$row['description']; |
|
| 998 | - echo str_repeat(" >",$level); |
|
| 993 | + $name = get_lang('CourseDescription'); |
|
| 994 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 995 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 996 | + if ($row['title'] != '') { $name = $row['title']; } |
|
| 997 | + $desc = $row['description']; |
|
| 998 | + echo str_repeat(" >", $level); |
|
| 999 | 999 | |
| 1000 | 1000 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 1001 | 1001 | if ($icon != 'nolink') { |
| 1002 | - if ($completed=='completed') { |
|
| 1002 | + if ($completed == 'completed') { |
|
| 1003 | 1003 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 1004 | - } else { |
|
| 1004 | + } else { |
|
| 1005 | 1005 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 1006 | 1006 | //echo " "; |
| 1007 | 1007 | } |
| 1008 | 1008 | } |
| 1009 | 1009 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 1010 | 1010 | |
| 1011 | - if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 1011 | + if ($name == '') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 1012 | 1012 | |
| 1013 | - if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 1013 | + if ($icon == 'nolink') { return(shorten($name, $length)); } |
|
| 1014 | 1014 | if ($icon == 'icon') { echo "<img src='../img/info.gif' align=\"absmiddle\" alt='info'>"; } |
| 1015 | 1015 | |
| 1016 | 1016 | if ($builder != 'builder') |
| 1017 | 1017 | { |
| 1018 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path"; |
|
| 1018 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path\" class='$completed'>".shorten($name, ($length - 3 * $level))."</a>"; $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path"; |
|
| 1019 | 1019 | if ($desc != '') { |
| 1020 | 1020 | if ($icon != 'wrap') { |
| 1021 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 1021 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; } |
|
| 1022 | 1022 | else { |
| 1023 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 1023 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; } |
|
| 1024 | 1024 | } |
| 1025 | 1025 | } else { |
| 1026 | - $s=api_get_path(WEB_CODE_PATH)."course_description"; |
|
| 1027 | - echo "<a href=\"$s\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 1026 | + $s = api_get_path(WEB_CODE_PATH)."course_description"; |
|
| 1027 | + echo "<a href=\"$s\" class='$completed' target='_blank'>".shorten($name, ($length - 3 * $level))."</a>"; |
|
| 1028 | 1028 | } |
| 1029 | 1029 | break; |
| 1030 | 1030 | case "Groups": |
| 1031 | - $name=get_lang('Groups'); |
|
| 1032 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1033 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1034 | - if ($row['title'] != '') { $name=$row['title']; } |
|
| 1035 | - $desc=$row['description']; |
|
| 1036 | - echo str_repeat(" >",$level); |
|
| 1031 | + $name = get_lang('Groups'); |
|
| 1032 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1033 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 1034 | + if ($row['title'] != '') { $name = $row['title']; } |
|
| 1035 | + $desc = $row['description']; |
|
| 1036 | + echo str_repeat(" >", $level); |
|
| 1037 | 1037 | |
| 1038 | 1038 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 1039 | 1039 | if ($icon != 'nolink') { |
| 1040 | - if ($completed=='completed') { |
|
| 1040 | + if ($completed == 'completed') { |
|
| 1041 | 1041 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 1042 | - } else { |
|
| 1042 | + } else { |
|
| 1043 | 1043 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 1044 | 1044 | //echo " "; |
| 1045 | 1045 | } |
| 1046 | 1046 | } |
| 1047 | 1047 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 1048 | 1048 | |
| 1049 | - if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 1049 | + if ($name == '') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 1050 | 1050 | |
| 1051 | - if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 1051 | + if ($icon == 'nolink') { return(shorten($name, $length)); } |
|
| 1052 | 1052 | if ($icon == 'icon') { echo "<img src='../img/group.gif' align=\"absmiddle\" alt='group'>"; } |
| 1053 | 1053 | |
| 1054 | 1054 | if ($builder != 'builder') |
| 1055 | 1055 | { |
| 1056 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path"; |
|
| 1056 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path\" class='$completed'>".shorten($name, ($length - 3 * $level))."</a>"; $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Groups&origin=$origin#$id_in_path"; |
|
| 1057 | 1057 | if ($desc != '') { |
| 1058 | 1058 | if ($icon != 'wrap') { |
| 1059 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 1059 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; } |
|
| 1060 | 1060 | else { |
| 1061 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 1061 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; } |
|
| 1062 | 1062 | } |
| 1063 | 1063 | } else { |
| 1064 | - echo "<a href=\"../group/group.php?origin=$origin\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 1064 | + echo "<a href=\"../group/group.php?origin=$origin\" class='$completed' target='_blank'>".shorten($name, ($length - 3 * $level))."</a>"; |
|
| 1065 | 1065 | } |
| 1066 | 1066 | break; |
| 1067 | 1067 | case "Users": |
| 1068 | - $name=get_lang('Users'); |
|
| 1069 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1070 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1071 | - if ($row['title'] != '') { $name=$row['title']; } |
|
| 1072 | - $desc=$row['description']; |
|
| 1073 | - echo str_repeat(" >",$level); |
|
| 1068 | + $name = get_lang('Users'); |
|
| 1069 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1070 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 1071 | + if ($row['title'] != '') { $name = $row['title']; } |
|
| 1072 | + $desc = $row['description']; |
|
| 1073 | + echo str_repeat(" >", $level); |
|
| 1074 | 1074 | |
| 1075 | 1075 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "<td>"; } |
| 1076 | 1076 | if ($icon != 'nolink') { |
| 1077 | - if ($completed=='completed') { |
|
| 1077 | + if ($completed == 'completed') { |
|
| 1078 | 1078 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on'>"; |
| 1079 | - } else { |
|
| 1079 | + } else { |
|
| 1080 | 1080 | echo "<img src='../img/checkbox_on2.gif' border='0' width='13' height='11' alt='on' style='visibility: hidden'>"; |
| 1081 | 1081 | //echo " "; |
| 1082 | 1082 | } |
| 1083 | 1083 | } |
| 1084 | 1084 | if (($builder != 'builder') and ($icon != 'wrap')) { echo "</td><td>"; } |
| 1085 | 1085 | |
| 1086 | - if ($name=='') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 1086 | + if ($name == '') { echo "<span class='messagesmall'>".get_lang('StepDeleted1')." $type ".get_lang('StepDeleted2')."</span>"; return(true); } |
|
| 1087 | 1087 | |
| 1088 | - if ($icon == 'nolink') { return(shorten($name,$length)); } |
|
| 1088 | + if ($icon == 'nolink') { return(shorten($name, $length)); } |
|
| 1089 | 1089 | if ($icon == 'icon') { echo "<img src='../img/members.gif' align=\"absmiddle\" alt='members'>"; } |
| 1090 | 1090 | |
| 1091 | 1091 | if ($builder != 'builder') |
| 1092 | 1092 | { |
| 1093 | - echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path\" class='$completed'>".shorten($name,($length-3*$level))."</a>"; $items[]=api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path"; |
|
| 1093 | + echo "<a href=\"".api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path\" class='$completed'>".shorten($name, ($length - 3 * $level))."</a>"; $items[] = api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Users&origin=$origin#$id_in_path"; |
|
| 1094 | 1094 | if ($desc != '') { |
| 1095 | 1095 | if ($icon != 'wrap') { |
| 1096 | - echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc,($length-3*$level))."</div></td></tr>"; } |
|
| 1096 | + echo "</tr><tr><td></td><td></td><td><div class='description'> ".shorten($desc, ($length - 3 * $level))."</div></td></tr>"; } |
|
| 1097 | 1097 | else { |
| 1098 | - echo "<div class='description'> ".shorten($desc,($length-3*$level))."</div>"; } |
|
| 1098 | + echo "<div class='description'> ".shorten($desc, ($length - 3 * $level))."</div>"; } |
|
| 1099 | 1099 | } |
| 1100 | 1100 | } else { |
| 1101 | - echo "<a href=\"../user/user.php?origin=$origin\" class='$completed' target='_blank'>".shorten($name,($length-3*$level))."</a>"; |
|
| 1101 | + echo "<a href=\"../user/user.php?origin=$origin\" class='$completed' target='_blank'>".shorten($name, ($length - 3 * $level))."</a>"; |
|
| 1102 | 1102 | } |
| 1103 | 1103 | break; |
| 1104 | 1104 | }//end huge switch-statement |
@@ -1117,29 +1117,29 @@ discard block |
||
| 1117 | 1117 | function get_addedresource_link_in_learnpath($type, $id, $id_in_path) |
| 1118 | 1118 | { |
| 1119 | 1119 | global $_course, $learnpath_id, $tbl_learnpath_item, $items; |
| 1120 | - global $curDirPath, $_configuration, $enableDocumentParsing, $_user , $_cid; |
|
| 1120 | + global $curDirPath, $_configuration, $enableDocumentParsing, $_user, $_cid; |
|
| 1121 | 1121 | |
| 1122 | 1122 | $hyperlink_target_parameter = ""; //or e.g. target='_blank' |
| 1123 | 1123 | $builder = 'player'; |
| 1124 | - $origin='learnpath'; |
|
| 1124 | + $origin = 'learnpath'; |
|
| 1125 | 1125 | |
| 1126 | - $linktype=$type; |
|
| 1127 | - if (($type=="Link _self") or ($type=="Link _blank")) { $type="Link"; } |
|
| 1126 | + $linktype = $type; |
|
| 1127 | + if (($type == "Link _self") or ($type == "Link _blank")) { $type = "Link"; } |
|
| 1128 | 1128 | |
| 1129 | 1129 | $link = ''; |
| 1130 | 1130 | |
| 1131 | 1131 | switch ($type) |
| 1132 | 1132 | { |
| 1133 | 1133 | case "Agenda": |
| 1134 | - $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA);; |
|
| 1134 | + $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA); ; |
|
| 1135 | 1135 | $result = Database::query("SELECT * FROM $TABLEAGENDA WHERE id=$id"); |
| 1136 | - $myrow=Database::fetch_array($result); |
|
| 1136 | + $myrow = Database::fetch_array($result); |
|
| 1137 | 1137 | |
| 1138 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1139 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1140 | - if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 1141 | - $desc=$row['description']; |
|
| 1142 | - $agenda_id=$row['item_id']; |
|
| 1138 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1139 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 1140 | + if ($row['title'] != '') { $myrow["title"] = $row['title']; } |
|
| 1141 | + $desc = $row['description']; |
|
| 1142 | + $agenda_id = $row['item_id']; |
|
| 1143 | 1143 | |
| 1144 | 1144 | if ($builder != 'builder') |
| 1145 | 1145 | { |
@@ -1154,7 +1154,7 @@ discard block |
||
| 1154 | 1154 | case "Ad_Valvas": |
| 1155 | 1155 | $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT); |
| 1156 | 1156 | $result = Database::query("SELECT * FROM $tbl_announcement WHERE id=$id"); |
| 1157 | - $myrow=Database::fetch_array($result); |
|
| 1157 | + $myrow = Database::fetch_array($result); |
|
| 1158 | 1158 | |
| 1159 | 1159 | if ($builder != 'builder') |
| 1160 | 1160 | { |
@@ -1167,14 +1167,14 @@ discard block |
||
| 1167 | 1167 | break; |
| 1168 | 1168 | |
| 1169 | 1169 | case "Link" : |
| 1170 | - $TABLETOOLLINK = Database::get_course_table(TABLE_LINK); |
|
| 1171 | - $result= Database::query("SELECT * FROM $TABLETOOLLINK WHERE id=$id"); |
|
| 1172 | - $myrow=Database::fetch_array($result); |
|
| 1170 | + $TABLETOOLLINK = Database::get_course_table(TABLE_LINK); |
|
| 1171 | + $result = Database::query("SELECT * FROM $TABLETOOLLINK WHERE id=$id"); |
|
| 1172 | + $myrow = Database::fetch_array($result); |
|
| 1173 | 1173 | |
| 1174 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1175 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1174 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1175 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 1176 | 1176 | |
| 1177 | - $thelink=$myrow["url"]; |
|
| 1177 | + $thelink = $myrow["url"]; |
|
| 1178 | 1178 | if ($builder != 'builder') |
| 1179 | 1179 | { |
| 1180 | 1180 | $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=$linktype&origin=$origin&thelink=$thelink#$id_in_path"; |
@@ -1186,16 +1186,16 @@ discard block |
||
| 1186 | 1186 | break; |
| 1187 | 1187 | |
| 1188 | 1188 | case "Exercise": |
| 1189 | - $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
|
| 1190 | - $result= Database::query("SELECT * FROM $TBL_EXERCICES WHERE id=$id"); |
|
| 1191 | - $myrow=Database::fetch_array($result); |
|
| 1189 | + $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
|
| 1190 | + $result = Database::query("SELECT * FROM $TBL_EXERCICES WHERE id=$id"); |
|
| 1191 | + $myrow = Database::fetch_array($result); |
|
| 1192 | 1192 | |
| 1193 | - if ($builder=='builder') { $origin='builder'; } |
|
| 1193 | + if ($builder == 'builder') { $origin = 'builder'; } |
|
| 1194 | 1194 | //this is needed for the exercise_submit.php can delete the session info about tests |
| 1195 | 1195 | |
| 1196 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1197 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1198 | - if ($row['title'] != '') { $myrow["title"]=$row['title']; } |
|
| 1196 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1197 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 1198 | + if ($row['title'] != '') { $myrow["title"] = $row['title']; } |
|
| 1199 | 1199 | |
| 1200 | 1200 | if ($builder != 'builder') |
| 1201 | 1201 | { |
@@ -1208,14 +1208,14 @@ discard block |
||
| 1208 | 1208 | break; |
| 1209 | 1209 | |
| 1210 | 1210 | case "HotPotatoes": |
| 1211 | - $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT); |
|
| 1212 | - $documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
|
| 1211 | + $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT); |
|
| 1212 | + $documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
|
| 1213 | 1213 | $result = Database::query("SELECT * FROM ".$TBL_DOCUMENT." WHERE id=$id"); |
| 1214 | - $myrow= Database::fetch_array($result); |
|
| 1215 | - $path=$myrow["path"]; |
|
| 1216 | - $name=GetQuizName($path,$documentPath); |
|
| 1214 | + $myrow = Database::fetch_array($result); |
|
| 1215 | + $path = $myrow["path"]; |
|
| 1216 | + $name = GetQuizName($path, $documentPath); |
|
| 1217 | 1217 | |
| 1218 | - if ($builder=='builder') { $origin='builder'; } |
|
| 1218 | + if ($builder == 'builder') { $origin = 'builder'; } |
|
| 1219 | 1219 | |
| 1220 | 1220 | $cid = $_course['official_code']; |
| 1221 | 1221 | |
@@ -1232,18 +1232,18 @@ discard block |
||
| 1232 | 1232 | case "Forum": |
| 1233 | 1233 | //deprecated |
| 1234 | 1234 | $TBL_FORUMS = Database::get_course_table(TABLE_FORUM); |
| 1235 | - $result= Database::query("SELECT * FROM $TBL_FORUMS WHERE forum_id=$id"); |
|
| 1236 | - $myrow=Database::fetch_array($result); |
|
| 1235 | + $result = Database::query("SELECT * FROM $TBL_FORUMS WHERE forum_id=$id"); |
|
| 1236 | + $myrow = Database::fetch_array($result); |
|
| 1237 | 1237 | |
| 1238 | - if ($builder=='builder') { $origin='builder'; } |
|
| 1238 | + if ($builder == 'builder') { $origin = 'builder'; } |
|
| 1239 | 1239 | |
| 1240 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1241 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1242 | - if ($row['title'] != '') { $myrow["forum_name"]=$row['title']; } |
|
| 1240 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1241 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 1242 | + if ($row['title'] != '') { $myrow["forum_name"] = $row['title']; } |
|
| 1243 | 1243 | |
| 1244 | - if ($myrow["forum_name"]=='') { $type="Forum"; } |
|
| 1244 | + if ($myrow["forum_name"] == '') { $type = "Forum"; } |
|
| 1245 | 1245 | |
| 1246 | - $forumparameters="forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]; |
|
| 1246 | + $forumparameters = "forum=".$myrow["forum_id"]."&md5=".$myrow["md5"]; |
|
| 1247 | 1247 | if ($builder != 'builder') |
| 1248 | 1248 | { |
| 1249 | 1249 | $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Forum&origin=$origin&forumparameters=$forumparameters#$id_in_path"; |
@@ -1256,15 +1256,15 @@ discard block |
||
| 1256 | 1256 | |
| 1257 | 1257 | case "Thread": //forum post |
| 1258 | 1258 | //deprecated |
| 1259 | - $tbl_topics = $_course['dbNameGlu'].'bb_topics'; |
|
| 1260 | - $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
|
| 1259 | + $tbl_topics = $_course['dbNameGlu'].'bb_topics'; |
|
| 1260 | + $tbl_posts = $_course['dbNameGlu'].'bb_posts'; |
|
| 1261 | 1261 | $TBL_FORUMS = $_course['dbNameGlu']."bb_forums"; |
| 1262 | - $sql="SELECT * FROM $tbl_topics where topic_id=$id"; |
|
| 1263 | - $result= Database::query($sql); |
|
| 1264 | - $myrow=Database::fetch_array($result); |
|
| 1262 | + $sql = "SELECT * FROM $tbl_topics where topic_id=$id"; |
|
| 1263 | + $result = Database::query($sql); |
|
| 1264 | + $myrow = Database::fetch_array($result); |
|
| 1265 | 1265 | |
| 1266 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1267 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1266 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1267 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 1268 | 1268 | |
| 1269 | 1269 | if ($builder != 'builder') |
| 1270 | 1270 | { |
@@ -1278,16 +1278,16 @@ discard block |
||
| 1278 | 1278 | case "Post": |
| 1279 | 1279 | break; |
| 1280 | 1280 | case "Document": |
| 1281 | - $dbTable = Database::get_course_table(TABLE_DOCUMENT); |
|
| 1282 | - $result=Database::query("SELECT * FROM $dbTable WHERE id=$id",__FILE__,__LINE); |
|
| 1283 | - $myrow=Database::fetch_array($result); |
|
| 1281 | + $dbTable = Database::get_course_table(TABLE_DOCUMENT); |
|
| 1282 | + $result = Database::query("SELECT * FROM $dbTable WHERE id=$id", __FILE__, __LINE); |
|
| 1283 | + $myrow = Database::fetch_array($result); |
|
| 1284 | 1284 | |
| 1285 | - $pathname=explode("/",$myrow["path"]); // making a correct name for the link |
|
| 1286 | - $last=count($pathname)-1; // making a correct name for the link |
|
| 1287 | - $filename=$pathname[$last]; // making a correct name for the link |
|
| 1285 | + $pathname = explode("/", $myrow["path"]); // making a correct name for the link |
|
| 1286 | + $last = count($pathname) - 1; // making a correct name for the link |
|
| 1287 | + $filename = $pathname[$last]; // making a correct name for the link |
|
| 1288 | 1288 | |
| 1289 | - $sql="select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1290 | - $result=Database::query($sql); $row=Database::fetch_array($result); |
|
| 1289 | + $sql = "select * from $tbl_learnpath_item where id=$id_in_path"; |
|
| 1290 | + $result = Database::query($sql); $row = Database::fetch_array($result); |
|
| 1291 | 1291 | |
| 1292 | 1292 | if ($builder != 'builder') |
| 1293 | 1293 | { |
@@ -1296,10 +1296,10 @@ discard block |
||
| 1296 | 1296 | } |
| 1297 | 1297 | else |
| 1298 | 1298 | { |
| 1299 | - $enableDocumentParsing='yes'; |
|
| 1299 | + $enableDocumentParsing = 'yes'; |
|
| 1300 | 1300 | if (!$enableDocumentParsing) |
| 1301 | 1301 | { //this is the solution for the non-parsing version in the builder |
| 1302 | - $file=urlencode($myrow["path"]); |
|
| 1302 | + $file = urlencode($myrow["path"]); |
|
| 1303 | 1303 | $link .= "../document/showinframes.php?file=$file"; |
| 1304 | 1304 | } |
| 1305 | 1305 | else |
@@ -1341,7 +1341,7 @@ discard block |
||
| 1341 | 1341 | { |
| 1342 | 1342 | $link .= api_get_self()."?action=closelesson&source_forum=".$_GET['source_forum']."&how=complete&id_in_path=$id_in_path&learnpath_id=$learnpath_id&type=Course_description&origin=$origin#$id_in_path"; |
| 1343 | 1343 | } else { |
| 1344 | - $s=api_get_path(WEB_CODE_PATH)."course_description"; |
|
| 1344 | + $s = api_get_path(WEB_CODE_PATH)."course_description"; |
|
| 1345 | 1345 | $link .= $s; |
| 1346 | 1346 | } |
| 1347 | 1347 | break; |
@@ -1375,8 +1375,8 @@ discard block |
||
| 1375 | 1375 | $addedresourceid = $_SESSION['addedresourceid']; |
| 1376 | 1376 | unset($addedresource[$resource_key]); |
| 1377 | 1377 | unset($addedresourceid[$resource_key]); |
| 1378 | - $_SESSION['addedresource']=$addedresource; |
|
| 1379 | - $_SESSION['addedresourceid']=$addedresourceid ; |
|
| 1378 | + $_SESSION['addedresource'] = $addedresource; |
|
| 1379 | + $_SESSION['addedresourceid'] = $addedresourceid; |
|
| 1380 | 1380 | } |
| 1381 | 1381 | |
| 1382 | 1382 | /** |
@@ -1409,9 +1409,9 @@ discard block |
||
| 1409 | 1409 | function delete_added_resource($type, $id) |
| 1410 | 1410 | { |
| 1411 | 1411 | global $_course; |
| 1412 | - $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1412 | + $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1413 | 1413 | |
| 1414 | - $sql="DELETE FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'"; |
|
| 1414 | + $sql = "DELETE FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'"; |
|
| 1415 | 1415 | Database::query($sql); |
| 1416 | 1416 | } |
| 1417 | 1417 | |
@@ -1422,9 +1422,9 @@ discard block |
||
| 1422 | 1422 | function delete_all_resources_type($type) |
| 1423 | 1423 | { |
| 1424 | 1424 | global $_course; |
| 1425 | - $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1425 | + $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1426 | 1426 | |
| 1427 | - $sql="DELETE FROM $TABLERESOURCE WHERE source_type='$type'"; |
|
| 1427 | + $sql = "DELETE FROM $TABLERESOURCE WHERE source_type='$type'"; |
|
| 1428 | 1428 | |
| 1429 | 1429 | Database::query($sql); |
| 1430 | 1430 | } |
@@ -1435,11 +1435,11 @@ discard block |
||
| 1435 | 1435 | function check_added_resources($type, $id) |
| 1436 | 1436 | { |
| 1437 | 1437 | global $_course, $origin; |
| 1438 | - $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1439 | - $sql="SELECT * FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'"; |
|
| 1440 | - $result=Database::query($sql); |
|
| 1441 | - $number_added=Database::num_rows($result); |
|
| 1442 | - if ($number_added<>0) |
|
| 1438 | + $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1439 | + $sql = "SELECT * FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'"; |
|
| 1440 | + $result = Database::query($sql); |
|
| 1441 | + $number_added = Database::num_rows($result); |
|
| 1442 | + if ($number_added <> 0) |
|
| 1443 | 1443 | return true; |
| 1444 | 1444 | else |
| 1445 | 1445 | return false; |
@@ -1452,18 +1452,18 @@ discard block |
||
| 1452 | 1452 | */ |
| 1453 | 1453 | function edit_added_resources($type, $id) |
| 1454 | 1454 | { |
| 1455 | - $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1455 | + $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1456 | 1456 | $course_id = api_get_course_int_id(); |
| 1457 | 1457 | $id = intval($id); |
| 1458 | 1458 | $type = Database::escape_string($type); |
| 1459 | - $sql="SELECT * FROM $TABLERESOURCE WHERE c_id = $course_id AND source_type='$type' and source_id=$id"; |
|
| 1460 | - $result=Database::query($sql); |
|
| 1461 | - while ($row=Database::fetch_array($result)) { |
|
| 1462 | - $addedresource[]=$row["resource_type"]; |
|
| 1463 | - $addedresourceid[]=$row["resource_id"]; |
|
| 1459 | + $sql = "SELECT * FROM $TABLERESOURCE WHERE c_id = $course_id AND source_type='$type' and source_id=$id"; |
|
| 1460 | + $result = Database::query($sql); |
|
| 1461 | + while ($row = Database::fetch_array($result)) { |
|
| 1462 | + $addedresource[] = $row["resource_type"]; |
|
| 1463 | + $addedresourceid[] = $row["resource_id"]; |
|
| 1464 | 1464 | } |
| 1465 | - $_SESSION['addedresource']=$addedresource; |
|
| 1466 | - $_SESSION['addedresourceid']=$addedresourceid; |
|
| 1465 | + $_SESSION['addedresource'] = $addedresource; |
|
| 1466 | + $_SESSION['addedresourceid'] = $addedresourceid; |
|
| 1467 | 1467 | } |
| 1468 | 1468 | |
| 1469 | 1469 | /** |
@@ -1473,12 +1473,12 @@ discard block |
||
| 1473 | 1473 | */ |
| 1474 | 1474 | function update_added_resources($type, $id) |
| 1475 | 1475 | { |
| 1476 | - $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1476 | + $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1477 | 1477 | $course_id = api_get_course_int_id(); |
| 1478 | 1478 | $id = intval($id); |
| 1479 | 1479 | $type = Database::escape_string($type); |
| 1480 | 1480 | // delete all the added resources for this item in the database; |
| 1481 | - $sql="DELETE FROM $TABLERESOURCE WHERE c_id = $course_id AND source_type='$type' AND source_id='$id'"; |
|
| 1481 | + $sql = "DELETE FROM $TABLERESOURCE WHERE c_id = $course_id AND source_type='$type' AND source_id='$id'"; |
|
| 1482 | 1482 | //echo $sql; |
| 1483 | 1483 | Database::query($sql); |
| 1484 | 1484 | |
@@ -1492,25 +1492,25 @@ discard block |
||
| 1492 | 1492 | /** |
| 1493 | 1493 | * this function is to display the resources that were added to a specific item |
| 1494 | 1494 | */ |
| 1495 | -function display_added_resources($type, $id, $style='') |
|
| 1495 | +function display_added_resources($type, $id, $style = '') |
|
| 1496 | 1496 | { |
| 1497 | 1497 | // the array containing the icons |
| 1498 | - $arr_icons=array('Agenda'=>'../img/agenda.gif', 'Ad Valvas'=>'../img/valves.gif', 'Link'=>'../img/links.gif', 'Exercise'=>'../img/quiz.gif' ); |
|
| 1498 | + $arr_icons = array('Agenda'=>'../img/agenda.gif', 'Ad Valvas'=>'../img/valves.gif', 'Link'=>'../img/links.gif', 'Exercise'=>'../img/quiz.gif'); |
|
| 1499 | 1499 | |
| 1500 | 1500 | global $_course, $origin; |
| 1501 | - $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1501 | + $TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES); |
|
| 1502 | 1502 | |
| 1503 | - $sql="SELECT * FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'"; |
|
| 1504 | - $result=Database::query($sql); |
|
| 1505 | - while ($row=Database::fetch_array($result)) |
|
| 1503 | + $sql = "SELECT * FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'"; |
|
| 1504 | + $result = Database::query($sql); |
|
| 1505 | + while ($row = Database::fetch_array($result)) |
|
| 1506 | 1506 | { |
| 1507 | 1507 | if ($origin != 'learnpath') |
| 1508 | 1508 | { |
| 1509 | - display_addedresource_link($row['resource_type'], $row['resource_id'], $style) ; |
|
| 1509 | + display_addedresource_link($row['resource_type'], $row['resource_id'], $style); |
|
| 1510 | 1510 | } |
| 1511 | 1511 | else |
| 1512 | 1512 | { |
| 1513 | - display_addedresource_link_in_learnpath($row['resource_type'], $row['resource_id'],'agendaitems','','builder','icon') ; echo "<br>"; |
|
| 1513 | + display_addedresource_link_in_learnpath($row['resource_type'], $row['resource_id'], 'agendaitems', '', 'builder', 'icon'); echo "<br>"; |
|
| 1514 | 1514 | } |
| 1515 | 1515 | } |
| 1516 | 1516 | } |
@@ -1529,7 +1529,7 @@ discard block |
||
| 1529 | 1529 | global $locationkey; |
| 1530 | 1530 | global $source_id, $action, $learnpath_id, $chapter_id, $originalresource; |
| 1531 | 1531 | |
| 1532 | - if ($resourceaction=="removeresource") |
|
| 1532 | + if ($resourceaction == "removeresource") |
|
| 1533 | 1533 | { |
| 1534 | 1534 | /* unneccessary because when editing we delete all the added resources from the |
| 1535 | 1535 | database and add all these from the session |
@@ -1550,8 +1550,8 @@ discard block |
||
| 1550 | 1550 | //echo "remove from session"; |
| 1551 | 1551 | remove_resource($locationkey); |
| 1552 | 1552 | } |
| 1553 | - $addedresource=$_SESSION['addedresource']; |
|
| 1554 | - $addedresourceid=$_SESSION['addedresourceid']; |
|
| 1553 | + $addedresource = $_SESSION['addedresource']; |
|
| 1554 | + $addedresourceid = $_SESSION['addedresourceid']; |
|
| 1555 | 1555 | if (is_array($addedresource)) |
| 1556 | 1556 | { |
| 1557 | 1557 | echo '<table>'; |
@@ -1559,16 +1559,16 @@ discard block |
||
| 1559 | 1559 | { |
| 1560 | 1560 | //echo $resource.":".$addedresourceid[key($addedresource)]; |
| 1561 | 1561 | echo '<tr><td>'; |
| 1562 | - display_addedresource_link($resource,$addedresourceid[key($addedresource)]); |
|
| 1562 | + display_addedresource_link($resource, $addedresourceid[key($addedresource)]); |
|
| 1563 | 1563 | echo '</td><td width="30">'; |
| 1564 | 1564 | |
| 1565 | 1565 | // if $_SERVER['REQUEST_URI'] contains and ?id=xx we have an edit and the url for deleting a session added resource |
| 1566 | 1566 | // should also contain this id. |
| 1567 | - $test=parse_url($_SERVER['REQUEST_URI']); |
|
| 1567 | + $test = parse_url($_SERVER['REQUEST_URI']); |
|
| 1568 | 1568 | $output = array(); |
| 1569 | - parse_str($test['query'],$output); |
|
| 1569 | + parse_str($test['query'], $output); |
|
| 1570 | 1570 | |
| 1571 | - if ($showdeleteimg==1) |
|
| 1571 | + if ($showdeleteimg == 1) |
|
| 1572 | 1572 | { |
| 1573 | 1573 | echo "<a href=".api_get_self()."?showresources=true&source_forum=".$_GET['source_forum']."&resourceaction=removeresource&locationkey=".key($addedresource)."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no><img src='../img/delete.gif' border='0' alt='resource ".get_lang('Delete')."' /></a><br />"; |
| 1574 | 1574 | } |
@@ -1596,8 +1596,8 @@ discard block |
||
| 1596 | 1596 | global $from_learnpath, $source_id, $action, $learnpath_id, $chapter_id, $originalresource, $folder, $content, $target; |
| 1597 | 1597 | //global $_SESSION['addresource']; |
| 1598 | 1598 | //global $_SESSION['addresourceid']; |
| 1599 | - $addedresource=$_SESSION['addedresource']; |
|
| 1600 | - $addedresourceid=$_SESSION['addedresourceid']; |
|
| 1599 | + $addedresource = $_SESSION['addedresource']; |
|
| 1600 | + $addedresourceid = $_SESSION['addedresourceid']; |
|
| 1601 | 1601 | |
| 1602 | 1602 | if (is_array($_SESSION['addedresource'])) |
| 1603 | 1603 | { |
@@ -1610,16 +1610,16 @@ discard block |
||
| 1610 | 1610 | //print_r($addedresourceid); |
| 1611 | 1611 | //echo "<br>"; |
| 1612 | 1612 | |
| 1613 | - if ($toolcompare==$type and $addedresourceid[key($addedresource)]==$id) |
|
| 1613 | + if ($toolcompare == $type and $addedresourceid[key($addedresource)] == $id) |
|
| 1614 | 1614 | { |
| 1615 | - $show=0; |
|
| 1615 | + $show = 0; |
|
| 1616 | 1616 | } |
| 1617 | 1617 | next($addedresource); |
| 1618 | 1618 | } |
| 1619 | - if ($from_learnpath) { $lang_add_it_or_resource=get_lang('AddIt'); } else { $lang_add_it_or_resource=get_lang('AddResource'); } |
|
| 1620 | - if ($show!==0) |
|
| 1619 | + if ($from_learnpath) { $lang_add_it_or_resource = get_lang('AddIt'); } else { $lang_add_it_or_resource = get_lang('AddResource'); } |
|
| 1620 | + if ($show !== 0) |
|
| 1621 | 1621 | { |
| 1622 | - if ($type=="Document") |
|
| 1622 | + if ($type == "Document") |
|
| 1623 | 1623 | { |
| 1624 | 1624 | echo "<a href=".api_get_self()."?content=".$type."&folder=".$folder."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no>".$lang_add_it_or_resource."</a>"; |
| 1625 | 1625 | } |
@@ -1631,9 +1631,9 @@ discard block |
||
| 1631 | 1631 | } |
| 1632 | 1632 | else // if it is not an array, it is a string |
| 1633 | 1633 | { |
| 1634 | - if ($_SESSION['addedresource']!==$type or $_SESSION['addedresourceid']!==$id) |
|
| 1634 | + if ($_SESSION['addedresource'] !== $type or $_SESSION['addedresourceid'] !== $id) |
|
| 1635 | 1635 | { |
| 1636 | - if ($from_learnpath) { $lang_add_it_or_resource=get_lang('AddIt'); } else { $lang_add_it_or_resource=get_lang('AddResource'); } |
|
| 1636 | + if ($from_learnpath) { $lang_add_it_or_resource = get_lang('AddIt'); } else { $lang_add_it_or_resource = get_lang('AddResource'); } |
|
| 1637 | 1637 | echo "<a href='".api_get_self()."?content=".$type."&folder=".$folder."&source_forum=".$_GET['source_forum']."&add=".$id."&source_id=$source_id&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no&target=$target'>".$lang_add_it_or_resource."</a>"; |
| 1638 | 1638 | } |
| 1639 | 1639 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | use ChamiloSession as Session; |
| 18 | 18 | |
| 19 | 19 | include ('../inc/global.inc.php'); |
| 20 | -$this_section=SECTION_COURSES; |
|
| 20 | +$this_section = SECTION_COURSES; |
|
| 21 | 21 | |
| 22 | 22 | api_protect_course_script(); |
| 23 | 23 | |
@@ -110,11 +110,11 @@ discard block |
||
| 110 | 110 | $max_temp2 = $row[0]; |
| 111 | 111 | if ($max_temp2 > $max_temp) |
| 112 | 112 | { |
| 113 | - $order = $max_temp2 +1; |
|
| 113 | + $order = $max_temp2 + 1; |
|
| 114 | 114 | } |
| 115 | 115 | else |
| 116 | 116 | { |
| 117 | - $order = $max_temp +1; |
|
| 117 | + $order = $max_temp + 1; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | $sql = "INSERT INTO $tbl_learnpath_chapter "."(learnpath_id,chapter_name,chapter_description,parent_chapter_id,display_order) "." VALUES "."($learnpath_id, '$title', '$description', $chapter_id, $order )"; |
@@ -186,21 +186,21 @@ discard block |
||
| 186 | 186 | //calculating the last order of the items of this chapter |
| 187 | 187 | $sql = "SELECT MAX(display_order) FROM $tbl_learnpath_item WHERE chapter_id=$chapter_id"; |
| 188 | 188 | $result = Database::query($sql); |
| 189 | - if(Database::num_rows($result)==0){ |
|
| 189 | + if (Database::num_rows($result) == 0) { |
|
| 190 | 190 | $lastorder_item = 0; |
| 191 | - }else{ |
|
| 191 | + } else { |
|
| 192 | 192 | $row = Database::fetch_array($result); |
| 193 | 193 | $lastorder_item = ($row[0]); |
| 194 | 194 | } |
| 195 | 195 | $sql = "SELECT MAX(display_order) FROM $tbl_learnpath_chapter WHERE parent_chapter_id=$chapter_id"; |
| 196 | 196 | $result = Database::query($sql); |
| 197 | - if(Database::num_rows($result)==0){ |
|
| 197 | + if (Database::num_rows($result) == 0) { |
|
| 198 | 198 | $lastorder_chapter = 0; |
| 199 | - }else{ |
|
| 199 | + } else { |
|
| 200 | 200 | $row = Database::fetch_array($result); |
| 201 | 201 | $lastorder_chapter = ($row[0]); |
| 202 | 202 | } |
| 203 | - $lastorder = ($lastorder_chapter>$lastorder_item?$lastorder_chapter+1:$lastorder_item+1); |
|
| 203 | + $lastorder = ($lastorder_chapter > $lastorder_item ? $lastorder_chapter + 1 : $lastorder_item + 1); |
|
| 204 | 204 | |
| 205 | 205 | foreach ($addedresource as $addedresource_item) |
| 206 | 206 | { |
@@ -251,8 +251,8 @@ discard block |
||
| 251 | 251 | $addedresourceassigned[$i] = 1; |
| 252 | 252 | $resource_added = true; |
| 253 | 253 | } |
| 254 | - $i ++; |
|
| 255 | - $lastorder ++; |
|
| 254 | + $i++; |
|
| 255 | + $lastorder++; |
|
| 256 | 256 | } |
| 257 | 257 | //$_SESSION['addedresource']=null; |
| 258 | 258 | //$_SESSION['addedresourceid']=null; |
@@ -294,34 +294,34 @@ discard block |
||
| 294 | 294 | $url = "../calendar/agenda.php?action=add"; |
| 295 | 295 | } |
| 296 | 296 | $originaltoolname = get_lang("Agenda"); |
| 297 | - $breadcrumbelement = array ("url" => $url, "name" => $originaltoolname); |
|
| 297 | + $breadcrumbelement = array("url" => $url, "name" => $originaltoolname); |
|
| 298 | 298 | session_unregister('from_learnpath'); |
| 299 | 299 | unset ($from_learnpath); |
| 300 | 300 | break; |
| 301 | 301 | case "2" : // coming from forum: new topic |
| 302 | 302 | $url = "../phpbb/newtopic.php?forum=$source_forum&md5=$md5"; |
| 303 | 303 | $originaltoolname = get_lang("ForumAddNewTopic"); |
| 304 | - $breadcrumbelement = array ("url" => $url, "name" => $originaltoolname); |
|
| 304 | + $breadcrumbelement = array("url" => $url, "name" => $originaltoolname); |
|
| 305 | 305 | session_unregister('from_learnpath'); |
| 306 | 306 | unset ($from_learnpath); |
| 307 | 307 | break; |
| 308 | 308 | case "3" : // coming from forum: edit topic |
| 309 | 309 | $url = "../phpbb/editpost.php?post_id=$post_id&topic=$topic&forum=$forum&md5=$md5&originalresource=no"; |
| 310 | 310 | $originaltoolname = get_lang("ForumEditTopic"); |
| 311 | - $breadcrumbelement = array ("url" => $url, "name" => $originaltoolname); |
|
| 311 | + $breadcrumbelement = array("url" => $url, "name" => $originaltoolname); |
|
| 312 | 312 | session_unregister('from_learnpath'); |
| 313 | 313 | unset ($from_learnpath); |
| 314 | 314 | break; |
| 315 | 315 | case "4" : // coming from exercises: edit topic |
| 316 | 316 | $url = "../exercice/admin.php?modifyAnswers=$modifyAnswers"; |
| 317 | 317 | $originaltoolname = get_lang("ExerciseAnswers"); |
| 318 | - $breadcrumbelement = array ("url" => $url, "name" => $originaltoolname); |
|
| 318 | + $breadcrumbelement = array("url" => $url, "name" => $originaltoolname); |
|
| 319 | 319 | session_unregister('from_learnpath'); |
| 320 | 320 | unset ($from_learnpath); |
| 321 | 321 | break; |
| 322 | 322 | case "5" : // coming from learning path |
| 323 | 323 | $from_learnpath = 'yes'; |
| 324 | - Session::write('from_learnpath',$from_learnpath); |
|
| 324 | + Session::write('from_learnpath', $from_learnpath); |
|
| 325 | 325 | break; |
| 326 | 326 | /*************************************** end add [email protected] *********************************/ |
| 327 | 327 | |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | // We do not come from the learning path. We store the name of the tool & url in a session. |
| 330 | 330 | if ($from_learnpath != 'yes') |
| 331 | 331 | { |
| 332 | - if (!$_SESSION["origintoolurl"] OR $_SESSION["origintoolurl"]<>$interbreadcrumb["url"]) |
|
| 332 | + if (!$_SESSION["origintoolurl"] OR $_SESSION["origintoolurl"] <> $interbreadcrumb["url"]) |
|
| 333 | 333 | { |
| 334 | 334 | $_SESSION["origintoolurl"] = $breadcrumbelement["url"]; |
| 335 | 335 | $_SESSION["origintoolname"] = $breadcrumbelement["name"]; |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | if ($from_learnpath != 'yes') |
| 345 | 345 | { |
| 346 | 346 | $nameTools = get_lang('AddResource'); |
| 347 | - $interbreadcrumb[] = array ("url" => $_SESSION["origintoolurl"], "name" => $_SESSION["origintoolname"]); |
|
| 347 | + $interbreadcrumb[] = array("url" => $_SESSION["origintoolurl"], "name" => $_SESSION["origintoolname"]); |
|
| 348 | 348 | } |
| 349 | 349 | else |
| 350 | 350 | { |
@@ -360,9 +360,9 @@ discard block |
||
| 360 | 360 | |
| 361 | 361 | $from_learnpath = 'yes'; |
| 362 | 362 | session_register('from_learnpath'); |
| 363 | - $interbreadcrumb[] = array ("url" => "../scorm/scormdocument.php", "name" => get_lang('LearningPath')); |
|
| 364 | - $interbreadcrumb[] = array ("url" => "../learnpath/learnpath_handler.php?learnpath_id=$learnpath_id", "name" => "{$therow['learnpath_name']}"); |
|
| 365 | - $interbreadcrumb[] = array ("url" => api_get_self()."?action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no", "name" => "{$therow2['chapter_name']}"); |
|
| 363 | + $interbreadcrumb[] = array("url" => "../scorm/scormdocument.php", "name" => get_lang('LearningPath')); |
|
| 364 | + $interbreadcrumb[] = array("url" => "../learnpath/learnpath_handler.php?learnpath_id=$learnpath_id", "name" => "{$therow['learnpath_name']}"); |
|
| 365 | + $interbreadcrumb[] = array("url" => api_get_self()."?action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no", "name" => "{$therow2['chapter_name']}"); |
|
| 366 | 366 | |
| 367 | 367 | } |
| 368 | 368 | |
@@ -387,13 +387,13 @@ discard block |
||
| 387 | 387 | // we retrieve the tools that are active. |
| 388 | 388 | // We use this to check which resources a student may add (only the modules that are active) |
| 389 | 389 | // see http://www.dokeos.com/forum/viewtopic.php?t=4858 |
| 390 | -$active_modules=array(); |
|
| 390 | +$active_modules = array(); |
|
| 391 | 391 | $tool_table = Database::get_course_table(TABLE_TOOL_LIST); |
| 392 | -$sql_select_active="SELECT * FROM $tool_table WHERE visibility='1'"; |
|
| 393 | -$result_select_active=Database::query($sql_select_active); |
|
| 394 | -while ($row=Database::fetch_array($result_select_active)) |
|
| 392 | +$sql_select_active = "SELECT * FROM $tool_table WHERE visibility='1'"; |
|
| 393 | +$result_select_active = Database::query($sql_select_active); |
|
| 394 | +while ($row = Database::fetch_array($result_select_active)) |
|
| 395 | 395 | { |
| 396 | - $active_modules[]=$row['name']; |
|
| 396 | + $active_modules[] = $row['name']; |
|
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | <td width="26%"><b><?php echo get_lang('CourseResources'); ?></b></td> |
| 409 | 409 | </tr> |
| 410 | 410 | <?php |
| 411 | - if (api_is_allowed_to_edit() OR in_array(TOOL_DOCUMENT,$active_modules)) |
|
| 411 | + if (api_is_allowed_to_edit() OR in_array(TOOL_DOCUMENT, $active_modules)) |
|
| 412 | 412 | { |
| 413 | 413 | ?> |
| 414 | 414 | <tr> |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | </tr> |
| 417 | 417 | <?php |
| 418 | 418 | } |
| 419 | - if (api_is_allowed_to_edit() OR in_array(TOOL_CALENDAR_EVENT,$active_modules)) |
|
| 419 | + if (api_is_allowed_to_edit() OR in_array(TOOL_CALENDAR_EVENT, $active_modules)) |
|
| 420 | 420 | { |
| 421 | 421 | ?> |
| 422 | 422 | <tr> |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | </tr> |
| 425 | 425 | <?php |
| 426 | 426 | } |
| 427 | - if (api_is_allowed_to_edit() OR in_array(TOOL_ANNOUNCEMENT,$active_modules)) |
|
| 427 | + if (api_is_allowed_to_edit() OR in_array(TOOL_ANNOUNCEMENT, $active_modules)) |
|
| 428 | 428 | { |
| 429 | 429 | ?> |
| 430 | 430 | <tr> |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | </tr> |
| 433 | 433 | <?php |
| 434 | 434 | } |
| 435 | - if (api_is_allowed_to_edit() OR in_array(TOOL_BB_FORUM,$active_modules)) |
|
| 435 | + if (api_is_allowed_to_edit() OR in_array(TOOL_BB_FORUM, $active_modules)) |
|
| 436 | 436 | { |
| 437 | 437 | ?> |
| 438 | 438 | <tr> |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | </tr> |
| 441 | 441 | <?php |
| 442 | 442 | } |
| 443 | - if (api_is_allowed_to_edit() OR in_array(TOOL_LINK,$active_modules)) |
|
| 443 | + if (api_is_allowed_to_edit() OR in_array(TOOL_LINK, $active_modules)) |
|
| 444 | 444 | { |
| 445 | 445 | ?> |
| 446 | 446 | <tr> |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | </tr> |
| 449 | 449 | <?php |
| 450 | 450 | } |
| 451 | - if (api_is_allowed_to_edit() OR in_array(TOOL_QUIZ,$active_modules)) |
|
| 451 | + if (api_is_allowed_to_edit() OR in_array(TOOL_QUIZ, $active_modules)) |
|
| 452 | 452 | { |
| 453 | 453 | ?> |
| 454 | 454 | <tr> |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | <tr> |
| 469 | 469 | <td width="26%"><b><?php echo get_lang('ExportableCourseResources'); ?></b></td> |
| 470 | 470 | </tr> |
| 471 | -<?php if ($multi_level_learnpath === true ) { ?> |
|
| 471 | +<?php if ($multi_level_learnpath === true) { ?> |
|
| 472 | 472 | <tr> |
| 473 | 473 | <td><?php echo "<a href=\"".api_get_self()."?content=chapter&action=$action&id=$id&learnpath_id=$learnpath_id&chapter_id=$chapter_id&source_forum=$source_forum&originalresource=no\">".get_lang('Chapter')."</a>"; ?></td> |
| 474 | 474 | </tr> |
@@ -589,10 +589,10 @@ discard block |
||
| 589 | 589 | // Agenda items --> |
| 590 | 590 | if ($content == "Agenda") |
| 591 | 591 | { |
| 592 | - $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA); |
|
| 593 | - $TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY); |
|
| 592 | + $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA); |
|
| 593 | + $TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY); |
|
| 594 | 594 | |
| 595 | - $sql="SELECT agenda.*, toolitemproperties.* |
|
| 595 | + $sql = "SELECT agenda.*, toolitemproperties.* |
|
| 596 | 596 | FROM ".$TABLEAGENDA." agenda, ".$TABLE_ITEM_PROPERTY." toolitemproperties |
| 597 | 597 | WHERE agenda.id = toolitemproperties.ref |
| 598 | 598 | AND toolitemproperties.tool='".TOOL_CALENDAR_EVENT."' |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | // 2. we come to the resource linker for the first time (documents = default). In this case it can only be shown if |
| 639 | 639 | // a. one is a teacher (documents can be shown even if the tool is inactive) |
| 640 | 640 | // b. one is a student AND the documents tool is active. Student cannot add documents if the documents tool is inactive (teacher can do this) |
| 641 | -if ($content == "Document" OR (empty($content) AND (api_is_allowed_to_edit() OR in_array(TOOL_DOCUMENT,$active_modules))) AND !$_GET['showresources']) |
|
| 641 | +if ($content == "Document" OR (empty($content) AND (api_is_allowed_to_edit() OR in_array(TOOL_DOCUMENT, $active_modules))) AND !$_GET['showresources']) |
|
| 642 | 642 | { |
| 643 | 643 | // setting variables for file locations |
| 644 | 644 | $baseServDir = $_configuration['root_sys']; |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | { |
| 699 | 699 | $TBL_FORUMS = Database::get_course_table(TABLE_FORUM); |
| 700 | 700 | $TBL_CATAGORIES = Database::get_course_table(TABLE_FORUM_CATEGORY); |
| 701 | - $TBL_FORUMTOPICS = Database::get_course_table(TABLE_FORUM_POST); |
|
| 701 | + $TBL_FORUMTOPICS = Database::get_course_table(TABLE_FORUM_POST); |
|
| 702 | 702 | $tbl_posts = Database::get_course_table(TABLE_FORUM_POST); |
| 703 | 703 | $tbl_posts_text = Database::get_course_table(TOOL_FORUM_POST_TEXT_TABLE); |
| 704 | 704 | |
@@ -883,9 +883,9 @@ discard block |
||
| 883 | 883 | ?> |
| 884 | 884 | </tr> |
| 885 | 885 | <tr> |
| 886 | - <td><?php if ($is_allowedToEdit) {echo get_lang('AddToLinks');} ?></td> |
|
| 886 | + <td><?php if ($is_allowedToEdit) {echo get_lang('AddToLinks'); } ?></td> |
|
| 887 | 887 | <td> |
| 888 | - <?php if ($is_allowedToEdit){?> |
|
| 888 | + <?php if ($is_allowedToEdit) {?> |
|
| 889 | 889 | <select name="add_2_links" id="add_2_links"> |
| 890 | 890 | <option value="niet toevoegen" selected="selected">-<?php echo get_lang('DontAdd'); ?>-</option> |
| 891 | 891 | <option value="0"><?php echo get_lang('MainCategory'); ?></option> |
@@ -111,8 +111,7 @@ discard block |
||
| 111 | 111 | if ($max_temp2 > $max_temp) |
| 112 | 112 | { |
| 113 | 113 | $order = $max_temp2 +1; |
| 114 | - } |
|
| 115 | - else |
|
| 114 | + } else |
|
| 116 | 115 | { |
| 117 | 116 | $order = $max_temp +1; |
| 118 | 117 | } |
@@ -145,8 +144,7 @@ discard block |
||
| 145 | 144 | $addedresourceid[] = Database::insert_id(); |
| 146 | 145 | $_SESSION['addedresource'] = $addedresource; |
| 147 | 146 | $_SESSION['addedresourceid'] = $addedresourceid; |
| 148 | - } |
|
| 149 | - else |
|
| 147 | + } else |
|
| 150 | 148 | { |
| 151 | 149 | // do not add external link to the links table |
| 152 | 150 | $addedresource[] = "Externallink"; |
@@ -188,7 +186,7 @@ discard block |
||
| 188 | 186 | $result = Database::query($sql); |
| 189 | 187 | if(Database::num_rows($result)==0){ |
| 190 | 188 | $lastorder_item = 0; |
| 191 | - }else{ |
|
| 189 | + } else{ |
|
| 192 | 190 | $row = Database::fetch_array($result); |
| 193 | 191 | $lastorder_item = ($row[0]); |
| 194 | 192 | } |
@@ -196,7 +194,7 @@ discard block |
||
| 196 | 194 | $result = Database::query($sql); |
| 197 | 195 | if(Database::num_rows($result)==0){ |
| 198 | 196 | $lastorder_chapter = 0; |
| 199 | - }else{ |
|
| 197 | + } else{ |
|
| 200 | 198 | $row = Database::fetch_array($result); |
| 201 | 199 | $lastorder_chapter = ($row[0]); |
| 202 | 200 | } |
@@ -284,12 +282,10 @@ discard block |
||
| 284 | 282 | if ($action == "edit") |
| 285 | 283 | { |
| 286 | 284 | $url = "../calendar/agenda.php?action=edit&id=49&originalresource=$originalresource"; |
| 287 | - } |
|
| 288 | - elseif ($action == "add") |
|
| 285 | + } elseif ($action == "add") |
|
| 289 | 286 | { |
| 290 | 287 | $url = "../calendar/agenda.php?action=add&originalresource=$originalresource"; |
| 291 | - } |
|
| 292 | - else |
|
| 288 | + } else |
|
| 293 | 289 | { |
| 294 | 290 | $url = "../calendar/agenda.php?action=add"; |
| 295 | 291 | } |
@@ -345,8 +341,7 @@ discard block |
||
| 345 | 341 | { |
| 346 | 342 | $nameTools = get_lang('AddResource'); |
| 347 | 343 | $interbreadcrumb[] = array ("url" => $_SESSION["origintoolurl"], "name" => $_SESSION["origintoolname"]); |
| 348 | -} |
|
| 349 | -else |
|
| 344 | +} else |
|
| 350 | 345 | { |
| 351 | 346 | $learnpath_select_query = " SELECT * FROM $tbl_learnpath_main |
| 352 | 347 | WHERE learnpath_id=$learnpath_id"; |
@@ -458,8 +453,7 @@ discard block |
||
| 458 | 453 | <?php |
| 459 | 454 | } |
| 460 | 455 | |
| 461 | -} |
|
| 462 | -else |
|
| 456 | +} else |
|
| 463 | 457 | { |
| 464 | 458 | ?> |
| 465 | 459 | |
@@ -558,8 +552,7 @@ discard block |
||
| 558 | 552 | if ($from_learnpath != 'yes') |
| 559 | 553 | { |
| 560 | 554 | echo "<form method=\"post\" action=\"{$_SESSION['origintoolurl']}\" style=\"margin: 0px;\"><input type=\"submit\" value=\"".get_lang('Ok')."\"></form>"; |
| 561 | -} |
|
| 562 | -else |
|
| 555 | +} else |
|
| 563 | 556 | { |
| 564 | 557 | echo "<form method=\"get\" action=\"../learnpath/learnpath_handler.php\" style=\"margin: 0px;\"><input type=\"hidden\" name=\"learnpath_id\" value=\"".htmlentities($learnpath_id)."\"><input type=\"submit\" value=\"".' '.get_lang('Ok').' '."\"></form>"; |
| 565 | 558 | } |
@@ -747,8 +740,7 @@ discard block |
||
| 747 | 740 | showorhide_addresourcelink("Thread", $myrow["topic_id"]); |
| 748 | 741 | echo "</td></tr>"; |
| 749 | 742 | } |
| 750 | - } |
|
| 751 | - else |
|
| 743 | + } else |
|
| 752 | 744 | { |
| 753 | 745 | // displaying all the replies |
| 754 | 746 | $sql = "SELECT * FROM ".$tbl_posts." post, ".$tbl_posts_text." post_text WHERE post_text.post_id=post.post_id and post.topic_id=$thread ORDER BY post_text.post_id ASC"; |
@@ -79,81 +79,81 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | if ($from_learnpath == 'yes') |
| 81 | 81 | { |
| 82 | - //start from clear every time in LearnPath Builder |
|
| 83 | - $_SESSION['addedresource'] = null; |
|
| 84 | - $_SESSION['addedresourceid'] = null; |
|
| 85 | - $_SESSION['addedresourceassigned'] = null; |
|
| 86 | - unset ($_SESSION['addedresource']); |
|
| 87 | - unset ($_SESSION['addedresourceid']); |
|
| 88 | - unset ($_SESSION['addedresourceassigned']); |
|
| 82 | + //start from clear every time in LearnPath Builder |
|
| 83 | + $_SESSION['addedresource'] = null; |
|
| 84 | + $_SESSION['addedresourceid'] = null; |
|
| 85 | + $_SESSION['addedresourceassigned'] = null; |
|
| 86 | + unset ($_SESSION['addedresource']); |
|
| 87 | + unset ($_SESSION['addedresourceid']); |
|
| 88 | + unset ($_SESSION['addedresourceassigned']); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | // Process a new chapter? |
| 92 | 92 | if (!empty ($_POST['add_dir']) && !empty ($_POST['title'])) |
| 93 | 93 | { |
| 94 | - $title = $_POST['title']; |
|
| 95 | - $description = ''; |
|
| 96 | - if (!empty ($_POST['description'])) |
|
| 97 | - { |
|
| 98 | - $description = $_POST['description']; |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - // get max display_order so far in this parent chapter |
|
| 102 | - $sql = "SELECT MAX(display_order) FROM $tbl_learnpath_chapter WHERE learnpath_id = $learnpath_id "." AND parent_chapter_id = $chapter_id"; |
|
| 103 | - $res = Database::query($sql); |
|
| 104 | - $row = Database::fetch_array($res); |
|
| 105 | - $max_temp = $row[0]; |
|
| 106 | - |
|
| 107 | - $sql = "SELECT MAX(display_order) FROM $tbl_learnpath_item WHERE "." chapter_id = $chapter_id"; |
|
| 108 | - $res = Database::query($sql); |
|
| 109 | - $row = Database::fetch_array($res); |
|
| 110 | - $max_temp2 = $row[0]; |
|
| 111 | - if ($max_temp2 > $max_temp) |
|
| 112 | - { |
|
| 113 | - $order = $max_temp2 +1; |
|
| 114 | - } |
|
| 115 | - else |
|
| 116 | - { |
|
| 117 | - $order = $max_temp +1; |
|
| 118 | - } |
|
| 119 | - |
|
| 120 | - $sql = "INSERT INTO $tbl_learnpath_chapter "."(learnpath_id,chapter_name,chapter_description,parent_chapter_id,display_order) "." VALUES "."($learnpath_id, '$title', '$description', $chapter_id, $order )"; |
|
| 121 | - $res = Database::query($sql); |
|
| 122 | - if ($res !== false) |
|
| 123 | - { |
|
| 124 | - $title = ''; |
|
| 125 | - $description = ''; |
|
| 126 | - } |
|
| 94 | + $title = $_POST['title']; |
|
| 95 | + $description = ''; |
|
| 96 | + if (!empty ($_POST['description'])) |
|
| 97 | + { |
|
| 98 | + $description = $_POST['description']; |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + // get max display_order so far in this parent chapter |
|
| 102 | + $sql = "SELECT MAX(display_order) FROM $tbl_learnpath_chapter WHERE learnpath_id = $learnpath_id "." AND parent_chapter_id = $chapter_id"; |
|
| 103 | + $res = Database::query($sql); |
|
| 104 | + $row = Database::fetch_array($res); |
|
| 105 | + $max_temp = $row[0]; |
|
| 106 | + |
|
| 107 | + $sql = "SELECT MAX(display_order) FROM $tbl_learnpath_item WHERE "." chapter_id = $chapter_id"; |
|
| 108 | + $res = Database::query($sql); |
|
| 109 | + $row = Database::fetch_array($res); |
|
| 110 | + $max_temp2 = $row[0]; |
|
| 111 | + if ($max_temp2 > $max_temp) |
|
| 112 | + { |
|
| 113 | + $order = $max_temp2 +1; |
|
| 114 | + } |
|
| 115 | + else |
|
| 116 | + { |
|
| 117 | + $order = $max_temp +1; |
|
| 118 | + } |
|
| 119 | + |
|
| 120 | + $sql = "INSERT INTO $tbl_learnpath_chapter "."(learnpath_id,chapter_name,chapter_description,parent_chapter_id,display_order) "." VALUES "."($learnpath_id, '$title', '$description', $chapter_id, $order )"; |
|
| 121 | + $res = Database::query($sql); |
|
| 122 | + if ($res !== false) |
|
| 123 | + { |
|
| 124 | + $title = ''; |
|
| 125 | + $description = ''; |
|
| 126 | + } |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | // This if when a external link is submitted |
| 130 | 130 | if (!empty ($_POST['external_link_submit'])) |
| 131 | 131 | { |
| 132 | - $add = true; |
|
| 133 | - if ($add_2_links != "niet toevoegen") |
|
| 134 | - { |
|
| 135 | - // add external link to the links table. |
|
| 136 | - $pos = strpos($external_link, 'ttp:'); |
|
| 137 | - if ($pos == '') |
|
| 138 | - { |
|
| 139 | - $external_link = 'http://'.$external_link; |
|
| 140 | - } |
|
| 141 | - |
|
| 142 | - $sql = "INSERT INTO $link_table (url, title, category_id) VALUES ('$external_link','$external_link','$add_2_links')"; |
|
| 143 | - $result = Database::query($sql); |
|
| 144 | - $addedresource[] = "Link"; |
|
| 145 | - $addedresourceid[] = Database::insert_id(); |
|
| 146 | - $_SESSION['addedresource'] = $addedresource; |
|
| 147 | - $_SESSION['addedresourceid'] = $addedresourceid; |
|
| 148 | - } |
|
| 149 | - else |
|
| 150 | - { |
|
| 151 | - // do not add external link to the links table |
|
| 152 | - $addedresource[] = "Externallink"; |
|
| 153 | - $addedresourceid[] = $external_link; |
|
| 154 | - $_SESSION['addedresource'] = $addedresource; |
|
| 155 | - $_SESSION['addedresourceid'] = $addedresourceid; |
|
| 156 | - } |
|
| 132 | + $add = true; |
|
| 133 | + if ($add_2_links != "niet toevoegen") |
|
| 134 | + { |
|
| 135 | + // add external link to the links table. |
|
| 136 | + $pos = strpos($external_link, 'ttp:'); |
|
| 137 | + if ($pos == '') |
|
| 138 | + { |
|
| 139 | + $external_link = 'http://'.$external_link; |
|
| 140 | + } |
|
| 141 | + |
|
| 142 | + $sql = "INSERT INTO $link_table (url, title, category_id) VALUES ('$external_link','$external_link','$add_2_links')"; |
|
| 143 | + $result = Database::query($sql); |
|
| 144 | + $addedresource[] = "Link"; |
|
| 145 | + $addedresourceid[] = Database::insert_id(); |
|
| 146 | + $_SESSION['addedresource'] = $addedresource; |
|
| 147 | + $_SESSION['addedresourceid'] = $addedresourceid; |
|
| 148 | + } |
|
| 149 | + else |
|
| 150 | + { |
|
| 151 | + // do not add external link to the links table |
|
| 152 | + $addedresource[] = "Externallink"; |
|
| 153 | + $addedresourceid[] = $external_link; |
|
| 154 | + $_SESSION['addedresource'] = $addedresource; |
|
| 155 | + $_SESSION['addedresourceid'] = $addedresourceid; |
|
| 156 | + } |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | // loading the session variables into local array |
@@ -163,107 +163,107 @@ discard block |
||
| 163 | 163 | // This is when a resource was added to the session |
| 164 | 164 | if ($add) |
| 165 | 165 | { |
| 166 | - // adding the new variable to the local array |
|
| 167 | - if (empty ($_POST['external_link_submit'])) |
|
| 168 | - { |
|
| 169 | - //that case is already arranged, see upwards |
|
| 170 | - $addedresource[] = $content; |
|
| 171 | - $addedresourceid[] = $add; |
|
| 172 | - } |
|
| 173 | - $addedresourceassigned[] = 0; |
|
| 174 | - |
|
| 175 | - // loading the local array into the session variable |
|
| 176 | - $_SESSION['addedresource'] = $addedresource; |
|
| 177 | - $_SESSION['addedresourceid'] = $addedresourceid; |
|
| 166 | + // adding the new variable to the local array |
|
| 167 | + if (empty ($_POST['external_link_submit'])) |
|
| 168 | + { |
|
| 169 | + //that case is already arranged, see upwards |
|
| 170 | + $addedresource[] = $content; |
|
| 171 | + $addedresourceid[] = $add; |
|
| 172 | + } |
|
| 173 | + $addedresourceassigned[] = 0; |
|
| 174 | + |
|
| 175 | + // loading the local array into the session variable |
|
| 176 | + $_SESSION['addedresource'] = $addedresource; |
|
| 177 | + $_SESSION['addedresourceid'] = $addedresourceid; |
|
| 178 | + |
|
| 179 | + //--------------------------------------- |
|
| 180 | + //we assign to chapters immediately ! |
|
| 181 | + //--------------------------------------- |
|
| 182 | + $resource_added = false; |
|
| 183 | + if ($from_learnpath == 'yes') |
|
| 184 | + { |
|
| 185 | + $i = 0; |
|
| 186 | + //calculating the last order of the items of this chapter |
|
| 187 | + $sql = "SELECT MAX(display_order) FROM $tbl_learnpath_item WHERE chapter_id=$chapter_id"; |
|
| 188 | + $result = Database::query($sql); |
|
| 189 | + if(Database::num_rows($result)==0){ |
|
| 190 | + $lastorder_item = 0; |
|
| 191 | + }else{ |
|
| 192 | + $row = Database::fetch_array($result); |
|
| 193 | + $lastorder_item = ($row[0]); |
|
| 194 | + } |
|
| 195 | + $sql = "SELECT MAX(display_order) FROM $tbl_learnpath_chapter WHERE parent_chapter_id=$chapter_id"; |
|
| 196 | + $result = Database::query($sql); |
|
| 197 | + if(Database::num_rows($result)==0){ |
|
| 198 | + $lastorder_chapter = 0; |
|
| 199 | + }else{ |
|
| 200 | + $row = Database::fetch_array($result); |
|
| 201 | + $lastorder_chapter = ($row[0]); |
|
| 202 | + } |
|
| 203 | + $lastorder = ($lastorder_chapter>$lastorder_item?$lastorder_chapter+1:$lastorder_item+1); |
|
| 178 | 204 | |
| 179 | - //--------------------------------------- |
|
| 180 | - //we assign to chapters immediately ! |
|
| 181 | - //--------------------------------------- |
|
| 182 | - $resource_added = false; |
|
| 183 | - if ($from_learnpath == 'yes') |
|
| 184 | - { |
|
| 185 | - $i = 0; |
|
| 186 | - //calculating the last order of the items of this chapter |
|
| 187 | - $sql = "SELECT MAX(display_order) FROM $tbl_learnpath_item WHERE chapter_id=$chapter_id"; |
|
| 188 | - $result = Database::query($sql); |
|
| 189 | - if(Database::num_rows($result)==0){ |
|
| 190 | - $lastorder_item = 0; |
|
| 191 | - }else{ |
|
| 192 | - $row = Database::fetch_array($result); |
|
| 193 | - $lastorder_item = ($row[0]); |
|
| 194 | - } |
|
| 195 | - $sql = "SELECT MAX(display_order) FROM $tbl_learnpath_chapter WHERE parent_chapter_id=$chapter_id"; |
|
| 196 | - $result = Database::query($sql); |
|
| 197 | - if(Database::num_rows($result)==0){ |
|
| 198 | - $lastorder_chapter = 0; |
|
| 199 | - }else{ |
|
| 200 | - $row = Database::fetch_array($result); |
|
| 201 | - $lastorder_chapter = ($row[0]); |
|
| 202 | - } |
|
| 203 | - $lastorder = ($lastorder_chapter>$lastorder_item?$lastorder_chapter+1:$lastorder_item+1); |
|
| 204 | - |
|
| 205 | - foreach ($addedresource as $addedresource_item) |
|
| 206 | - { |
|
| 207 | - // in the case we added a chapter, add this into the chapters list with the correct parent_id |
|
| 208 | - if ($addedresource_item == "Chap") |
|
| 209 | - { |
|
| 210 | - $sql = "INSERT INTO $tbl_learnpath_chapter ("."'learnpath_id','chapter_name','chapter_description','parent_chapter_id','display_order'".") VALUES (".$learnpath_id.",'".$learnpath_chapter_name."','".$learnpath_chapter_description."',".$chapter_id.",".$lastorder.")"; |
|
| 211 | - Database::query($sql); |
|
| 212 | - } |
|
| 213 | - |
|
| 214 | - if (!$addedresourceassigned[$i]) |
|
| 215 | - { |
|
| 216 | - //not to assign it twice |
|
| 217 | - if ($addedresource_item == "Ass") |
|
| 218 | - { |
|
| 219 | - $addedresource_item = "Assignments"; |
|
| 220 | - } |
|
| 221 | - if ($addedresource_item == "Drop") |
|
| 222 | - { |
|
| 223 | - $addedresource_item = "Dropbox"; |
|
| 224 | - } |
|
| 225 | - if ($addedresource_item == "Intro") |
|
| 226 | - { |
|
| 227 | - $addedresource_item = "Introduction_text"; |
|
| 228 | - } |
|
| 229 | - if ($addedresource_item == "Course_desc") |
|
| 230 | - { |
|
| 231 | - $addedresource_item = "Course_description"; |
|
| 232 | - } |
|
| 233 | - if ($addedresource_item == "Group") |
|
| 234 | - { |
|
| 235 | - $addedresource_item = "Groups"; |
|
| 236 | - } |
|
| 237 | - if ($addedresource_item == "User") |
|
| 238 | - { |
|
| 239 | - $addedresource_item = "Users"; |
|
| 240 | - } |
|
| 241 | - if ($target == '') |
|
| 242 | - { |
|
| 243 | - $target = '_self'; |
|
| 244 | - } |
|
| 245 | - if ($addedresource_item == 'Link') |
|
| 246 | - { |
|
| 247 | - $addedresource_item .= ' '.$target; |
|
| 248 | - } |
|
| 249 | - $sql = "INSERT INTO $tbl_learnpath_item (id, chapter_id, item_type, item_id, display_order) VALUES ( '$autoid', '$chapter_id', '$addedresource_item','$addedresourceid[$i]','".$lastorder."')"; |
|
| 250 | - $result = Database::query($sql); |
|
| 251 | - $addedresourceassigned[$i] = 1; |
|
| 252 | - $resource_added = true; |
|
| 253 | - } |
|
| 254 | - $i ++; |
|
| 255 | - $lastorder ++; |
|
| 256 | - } |
|
| 257 | - //$_SESSION['addedresource']=null; |
|
| 258 | - //$_SESSION['addedresourceid']=null; |
|
| 259 | - // cleaning up the session once again |
|
| 260 | - $_SESSION['addedresource'] = null; |
|
| 261 | - $_SESSION['addedresourceid'] = null; |
|
| 262 | - $_SESSION['addedresourceassigned'] = null; |
|
| 263 | - unset ($_SESSION['addedresource']); |
|
| 264 | - unset ($_SESSION['addedresourceid']); |
|
| 265 | - unset ($_SESSION['addedresourceassigned']); |
|
| 266 | - } |
|
| 205 | + foreach ($addedresource as $addedresource_item) |
|
| 206 | + { |
|
| 207 | + // in the case we added a chapter, add this into the chapters list with the correct parent_id |
|
| 208 | + if ($addedresource_item == "Chap") |
|
| 209 | + { |
|
| 210 | + $sql = "INSERT INTO $tbl_learnpath_chapter ("."'learnpath_id','chapter_name','chapter_description','parent_chapter_id','display_order'".") VALUES (".$learnpath_id.",'".$learnpath_chapter_name."','".$learnpath_chapter_description."',".$chapter_id.",".$lastorder.")"; |
|
| 211 | + Database::query($sql); |
|
| 212 | + } |
|
| 213 | + |
|
| 214 | + if (!$addedresourceassigned[$i]) |
|
| 215 | + { |
|
| 216 | + //not to assign it twice |
|
| 217 | + if ($addedresource_item == "Ass") |
|
| 218 | + { |
|
| 219 | + $addedresource_item = "Assignments"; |
|
| 220 | + } |
|
| 221 | + if ($addedresource_item == "Drop") |
|
| 222 | + { |
|
| 223 | + $addedresource_item = "Dropbox"; |
|
| 224 | + } |
|
| 225 | + if ($addedresource_item == "Intro") |
|
| 226 | + { |
|
| 227 | + $addedresource_item = "Introduction_text"; |
|
| 228 | + } |
|
| 229 | + if ($addedresource_item == "Course_desc") |
|
| 230 | + { |
|
| 231 | + $addedresource_item = "Course_description"; |
|
| 232 | + } |
|
| 233 | + if ($addedresource_item == "Group") |
|
| 234 | + { |
|
| 235 | + $addedresource_item = "Groups"; |
|
| 236 | + } |
|
| 237 | + if ($addedresource_item == "User") |
|
| 238 | + { |
|
| 239 | + $addedresource_item = "Users"; |
|
| 240 | + } |
|
| 241 | + if ($target == '') |
|
| 242 | + { |
|
| 243 | + $target = '_self'; |
|
| 244 | + } |
|
| 245 | + if ($addedresource_item == 'Link') |
|
| 246 | + { |
|
| 247 | + $addedresource_item .= ' '.$target; |
|
| 248 | + } |
|
| 249 | + $sql = "INSERT INTO $tbl_learnpath_item (id, chapter_id, item_type, item_id, display_order) VALUES ( '$autoid', '$chapter_id', '$addedresource_item','$addedresourceid[$i]','".$lastorder."')"; |
|
| 250 | + $result = Database::query($sql); |
|
| 251 | + $addedresourceassigned[$i] = 1; |
|
| 252 | + $resource_added = true; |
|
| 253 | + } |
|
| 254 | + $i ++; |
|
| 255 | + $lastorder ++; |
|
| 256 | + } |
|
| 257 | + //$_SESSION['addedresource']=null; |
|
| 258 | + //$_SESSION['addedresourceid']=null; |
|
| 259 | + // cleaning up the session once again |
|
| 260 | + $_SESSION['addedresource'] = null; |
|
| 261 | + $_SESSION['addedresourceid'] = null; |
|
| 262 | + $_SESSION['addedresourceassigned'] = null; |
|
| 263 | + unset ($_SESSION['addedresource']); |
|
| 264 | + unset ($_SESSION['addedresourceid']); |
|
| 265 | + unset ($_SESSION['addedresourceassigned']); |
|
| 266 | + } |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | /* |
@@ -278,64 +278,64 @@ discard block |
||
| 278 | 278 | */ |
| 279 | 279 | if ($_GET["source_id"]) |
| 280 | 280 | { |
| 281 | - switch ($_GET["source_id"]) |
|
| 282 | - { |
|
| 283 | - case "1" : // coming from Agenda |
|
| 284 | - if ($action == "edit") |
|
| 285 | - { |
|
| 286 | - $url = "../calendar/agenda.php?action=edit&id=49&originalresource=$originalresource"; |
|
| 287 | - } |
|
| 288 | - elseif ($action == "add") |
|
| 289 | - { |
|
| 290 | - $url = "../calendar/agenda.php?action=add&originalresource=$originalresource"; |
|
| 291 | - } |
|
| 292 | - else |
|
| 293 | - { |
|
| 294 | - $url = "../calendar/agenda.php?action=add"; |
|
| 295 | - } |
|
| 296 | - $originaltoolname = get_lang("Agenda"); |
|
| 297 | - $breadcrumbelement = array ("url" => $url, "name" => $originaltoolname); |
|
| 298 | - unset($_SESSION['from_learnpath']); |
|
| 299 | - unset ($from_learnpath); |
|
| 300 | - break; |
|
| 301 | - case "2" : // coming from forum: new topic |
|
| 302 | - $url = "../phpbb/newtopic.php?forum=$source_forum&md5=$md5"; |
|
| 303 | - $originaltoolname = get_lang("ForumAddNewTopic"); |
|
| 304 | - $breadcrumbelement = array ("url" => $url, "name" => $originaltoolname); |
|
| 305 | - unset($_SESSION['from_learnpath']); |
|
| 306 | - unset ($from_learnpath); |
|
| 307 | - break; |
|
| 308 | - case "3" : // coming from forum: edit topic |
|
| 309 | - $url = "../phpbb/editpost.php?post_id=$post_id&topic=$topic&forum=$forum&md5=$md5&originalresource=no"; |
|
| 310 | - $originaltoolname = get_lang("ForumEditTopic"); |
|
| 311 | - $breadcrumbelement = array ("url" => $url, "name" => $originaltoolname); |
|
| 312 | - unset($_SESSION['from_learnpath']); |
|
| 313 | - unset ($from_learnpath); |
|
| 314 | - break; |
|
| 315 | - case "4" : // coming from exercises: edit topic |
|
| 316 | - $url = "../exercise/admin.php?modifyAnswers=$modifyAnswers"; |
|
| 317 | - $originaltoolname = get_lang("ExerciseAnswers"); |
|
| 318 | - $breadcrumbelement = array ("url" => $url, "name" => $originaltoolname); |
|
| 319 | - unset($_SESSION['from_learnpath']); |
|
| 320 | - unset ($from_learnpath); |
|
| 321 | - break; |
|
| 322 | - case "5" : // coming from learning path |
|
| 323 | - $from_learnpath = 'yes'; |
|
| 324 | - Session::write('from_learnpath',$from_learnpath); |
|
| 325 | - break; |
|
| 326 | - /*************************************** end add [email protected] *********************************/ |
|
| 327 | - |
|
| 328 | - } |
|
| 329 | - // We do not come from the learning path. We store the name of the tool & url in a session. |
|
| 330 | - if ($from_learnpath != 'yes') |
|
| 331 | - { |
|
| 332 | - if (!$_SESSION["origintoolurl"] OR $_SESSION["origintoolurl"]<>$interbreadcrumb["url"]) |
|
| 333 | - { |
|
| 334 | - $_SESSION["origintoolurl"] = $breadcrumbelement["url"]; |
|
| 335 | - $_SESSION["origintoolname"] = $breadcrumbelement["name"]; |
|
| 336 | - $interbreadcrumb = ""; |
|
| 337 | - } |
|
| 338 | - } |
|
| 281 | + switch ($_GET["source_id"]) |
|
| 282 | + { |
|
| 283 | + case "1" : // coming from Agenda |
|
| 284 | + if ($action == "edit") |
|
| 285 | + { |
|
| 286 | + $url = "../calendar/agenda.php?action=edit&id=49&originalresource=$originalresource"; |
|
| 287 | + } |
|
| 288 | + elseif ($action == "add") |
|
| 289 | + { |
|
| 290 | + $url = "../calendar/agenda.php?action=add&originalresource=$originalresource"; |
|
| 291 | + } |
|
| 292 | + else |
|
| 293 | + { |
|
| 294 | + $url = "../calendar/agenda.php?action=add"; |
|
| 295 | + } |
|
| 296 | + $originaltoolname = get_lang("Agenda"); |
|
| 297 | + $breadcrumbelement = array ("url" => $url, "name" => $originaltoolname); |
|
| 298 | + unset($_SESSION['from_learnpath']); |
|
| 299 | + unset ($from_learnpath); |
|
| 300 | + break; |
|
| 301 | + case "2" : // coming from forum: new topic |
|
| 302 | + $url = "../phpbb/newtopic.php?forum=$source_forum&md5=$md5"; |
|
| 303 | + $originaltoolname = get_lang("ForumAddNewTopic"); |
|
| 304 | + $breadcrumbelement = array ("url" => $url, "name" => $originaltoolname); |
|
| 305 | + unset($_SESSION['from_learnpath']); |
|
| 306 | + unset ($from_learnpath); |
|
| 307 | + break; |
|
| 308 | + case "3" : // coming from forum: edit topic |
|
| 309 | + $url = "../phpbb/editpost.php?post_id=$post_id&topic=$topic&forum=$forum&md5=$md5&originalresource=no"; |
|
| 310 | + $originaltoolname = get_lang("ForumEditTopic"); |
|
| 311 | + $breadcrumbelement = array ("url" => $url, "name" => $originaltoolname); |
|
| 312 | + unset($_SESSION['from_learnpath']); |
|
| 313 | + unset ($from_learnpath); |
|
| 314 | + break; |
|
| 315 | + case "4" : // coming from exercises: edit topic |
|
| 316 | + $url = "../exercise/admin.php?modifyAnswers=$modifyAnswers"; |
|
| 317 | + $originaltoolname = get_lang("ExerciseAnswers"); |
|
| 318 | + $breadcrumbelement = array ("url" => $url, "name" => $originaltoolname); |
|
| 319 | + unset($_SESSION['from_learnpath']); |
|
| 320 | + unset ($from_learnpath); |
|
| 321 | + break; |
|
| 322 | + case "5" : // coming from learning path |
|
| 323 | + $from_learnpath = 'yes'; |
|
| 324 | + Session::write('from_learnpath',$from_learnpath); |
|
| 325 | + break; |
|
| 326 | + /*************************************** end add [email protected] *********************************/ |
|
| 327 | + |
|
| 328 | + } |
|
| 329 | + // We do not come from the learning path. We store the name of the tool & url in a session. |
|
| 330 | + if ($from_learnpath != 'yes') |
|
| 331 | + { |
|
| 332 | + if (!$_SESSION["origintoolurl"] OR $_SESSION["origintoolurl"]<>$interbreadcrumb["url"]) |
|
| 333 | + { |
|
| 334 | + $_SESSION["origintoolurl"] = $breadcrumbelement["url"]; |
|
| 335 | + $_SESSION["origintoolname"] = $breadcrumbelement["name"]; |
|
| 336 | + $interbreadcrumb = ""; |
|
| 337 | + } |
|
| 338 | + } |
|
| 339 | 339 | |
| 340 | 340 | } |
| 341 | 341 | |
@@ -343,26 +343,26 @@ discard block |
||
| 343 | 343 | // the information from the session. Else we use the information of the learningpath itself. |
| 344 | 344 | if ($from_learnpath != 'yes') |
| 345 | 345 | { |
| 346 | - $nameTools = get_lang('AddResource'); |
|
| 347 | - $interbreadcrumb[] = array ("url" => $_SESSION["origintoolurl"], "name" => $_SESSION["origintoolname"]); |
|
| 346 | + $nameTools = get_lang('AddResource'); |
|
| 347 | + $interbreadcrumb[] = array ("url" => $_SESSION["origintoolurl"], "name" => $_SESSION["origintoolname"]); |
|
| 348 | 348 | } |
| 349 | 349 | else |
| 350 | 350 | { |
| 351 | - $learnpath_select_query = " SELECT * FROM $tbl_learnpath_main |
|
| 351 | + $learnpath_select_query = " SELECT * FROM $tbl_learnpath_main |
|
| 352 | 352 | WHERE learnpath_id=$learnpath_id"; |
| 353 | - $sql_result = Database::query($learnpath_select_query); |
|
| 354 | - $therow = Database::fetch_array($sql_result); |
|
| 353 | + $sql_result = Database::query($learnpath_select_query); |
|
| 354 | + $therow = Database::fetch_array($sql_result); |
|
| 355 | 355 | |
| 356 | - $learnpath_chapter_query = " SELECT * FROM $tbl_learnpath_chapter |
|
| 356 | + $learnpath_chapter_query = " SELECT * FROM $tbl_learnpath_chapter |
|
| 357 | 357 | WHERE (learnpath_id = '$learnpath_id' and id = '$chapter_id')"; |
| 358 | - $sql_result = Database::query($learnpath_chapter_query); |
|
| 359 | - $therow2 = Database::fetch_array($sql_result); |
|
| 358 | + $sql_result = Database::query($learnpath_chapter_query); |
|
| 359 | + $therow2 = Database::fetch_array($sql_result); |
|
| 360 | 360 | |
| 361 | - $from_learnpath = 'yes'; |
|
| 362 | - $_SESSION['from_learnpath'] = $from_learnpath; |
|
| 363 | - $interbreadcrumb[] = array ("url" => "../scorm/scormdocument.php", "name" => get_lang('LearningPath')); |
|
| 364 | - $interbreadcrumb[] = array ("url" => "../learnpath/learnpath_handler.php?learnpath_id=$learnpath_id", "name" => "{$therow['learnpath_name']}"); |
|
| 365 | - $interbreadcrumb[] = array ("url" => api_get_self()."?action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no", "name" => "{$therow2['chapter_name']}"); |
|
| 361 | + $from_learnpath = 'yes'; |
|
| 362 | + $_SESSION['from_learnpath'] = $from_learnpath; |
|
| 363 | + $interbreadcrumb[] = array ("url" => "../scorm/scormdocument.php", "name" => get_lang('LearningPath')); |
|
| 364 | + $interbreadcrumb[] = array ("url" => "../learnpath/learnpath_handler.php?learnpath_id=$learnpath_id", "name" => "{$therow['learnpath_name']}"); |
|
| 365 | + $interbreadcrumb[] = array ("url" => api_get_self()."?action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no", "name" => "{$therow2['chapter_name']}"); |
|
| 366 | 366 | |
| 367 | 367 | } |
| 368 | 368 | |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | echo "<h3>".$nameTools; |
| 381 | 381 | if ($from_learnpath == 'yes') |
| 382 | 382 | { |
| 383 | - echo get_lang("AddResource")." - {$therow2['chapter_name']}"; |
|
| 383 | + echo get_lang("AddResource")." - {$therow2['chapter_name']}"; |
|
| 384 | 384 | } |
| 385 | 385 | echo "</h3>"; |
| 386 | 386 | |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | $result_select_active=Database::query($sql_select_active); |
| 394 | 394 | while ($row=Database::fetch_array($result_select_active)) |
| 395 | 395 | { |
| 396 | - $active_modules[]=$row['name']; |
|
| 396 | + $active_modules[]=$row['name']; |
|
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | |
@@ -536,12 +536,12 @@ discard block |
||
| 536 | 536 | |
| 537 | 537 | if ($from_learnpath != 'yes') |
| 538 | 538 | { |
| 539 | - echo "<tr><td> </td></tr>"; |
|
| 540 | - echo "<tr><td><b>".get_lang('ResourcesAdded')." ("; |
|
| 541 | - echo count($addedresource); |
|
| 542 | - echo ")</b></td></tr>"; |
|
| 543 | - echo "<tr><td nowrap><a href=\"".api_get_self()."?showresources=true&action=$action&id=$id&learnpath_id=$learnpath_id&chapter_id=$chapter_id&source_forum=$source_forum&originalresource=no\">".get_lang('ShowDelete')."</a>"; |
|
| 544 | - echo "</td></tr>"; |
|
| 539 | + echo "<tr><td> </td></tr>"; |
|
| 540 | + echo "<tr><td><b>".get_lang('ResourcesAdded')." ("; |
|
| 541 | + echo count($addedresource); |
|
| 542 | + echo ")</b></td></tr>"; |
|
| 543 | + echo "<tr><td nowrap><a href=\"".api_get_self()."?showresources=true&action=$action&id=$id&learnpath_id=$learnpath_id&chapter_id=$chapter_id&source_forum=$source_forum&originalresource=no\">".get_lang('ShowDelete')."</a>"; |
|
| 544 | + echo "</td></tr>"; |
|
| 545 | 545 | } |
| 546 | 546 | ?> |
| 547 | 547 | <tr> |
@@ -557,11 +557,11 @@ discard block |
||
| 557 | 557 | |
| 558 | 558 | if ($from_learnpath != 'yes') |
| 559 | 559 | { |
| 560 | - echo "<form method=\"post\" action=\"{$_SESSION['origintoolurl']}\" style=\"margin: 0px;\"><input type=\"submit\" value=\"".get_lang('Ok')."\"></form>"; |
|
| 560 | + echo "<form method=\"post\" action=\"{$_SESSION['origintoolurl']}\" style=\"margin: 0px;\"><input type=\"submit\" value=\"".get_lang('Ok')."\"></form>"; |
|
| 561 | 561 | } |
| 562 | 562 | else |
| 563 | 563 | { |
| 564 | - echo "<form method=\"get\" action=\"../learnpath/learnpath_handler.php\" style=\"margin: 0px;\"><input type=\"hidden\" name=\"learnpath_id\" value=\"".htmlentities($learnpath_id)."\"><input type=\"submit\" value=\"".' '.get_lang('Ok').' '."\"></form>"; |
|
| 564 | + echo "<form method=\"get\" action=\"../learnpath/learnpath_handler.php\" style=\"margin: 0px;\"><input type=\"hidden\" name=\"learnpath_id\" value=\"".htmlentities($learnpath_id)."\"><input type=\"submit\" value=\"".' '.get_lang('Ok').' '."\"></form>"; |
|
| 565 | 565 | } |
| 566 | 566 | ?> |
| 567 | 567 | |
@@ -577,40 +577,40 @@ discard block |
||
| 577 | 577 | |
| 578 | 578 | if ($resource_added) |
| 579 | 579 | { |
| 580 | - Display :: display_normal_message(get_lang("ResourceAdded")); |
|
| 580 | + Display :: display_normal_message(get_lang("ResourceAdded")); |
|
| 581 | 581 | } |
| 582 | 582 | |
| 583 | 583 | if ($from_learnpath != 'yes') |
| 584 | 584 | { |
| 585 | - echo count($addedresource)." ".api_strtolower(get_lang('ResourcesAdded'))."<br/>"; |
|
| 585 | + echo count($addedresource)." ".api_strtolower(get_lang('ResourcesAdded'))."<br/>"; |
|
| 586 | 586 | } |
| 587 | 587 | //echo "<hr>"; |
| 588 | 588 | |
| 589 | 589 | // Agenda items --> |
| 590 | 590 | if ($content == "Agenda") |
| 591 | 591 | { |
| 592 | - $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA); |
|
| 593 | - $TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY); |
|
| 592 | + $TABLEAGENDA = Database::get_course_table(TABLE_AGENDA); |
|
| 593 | + $TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY); |
|
| 594 | 594 | |
| 595 | - $sql="SELECT agenda.*, toolitemproperties.* |
|
| 595 | + $sql="SELECT agenda.*, toolitemproperties.* |
|
| 596 | 596 | FROM ".$TABLEAGENDA." agenda, ".$TABLE_ITEM_PROPERTY." toolitemproperties |
| 597 | 597 | WHERE agenda.id = toolitemproperties.ref |
| 598 | 598 | AND toolitemproperties.tool='".TOOL_CALENDAR_EVENT."' |
| 599 | 599 | AND (toolitemproperties.to_group_id='0' OR toolitemproperties.to_group_id IS NULL) |
| 600 | 600 | AND toolitemproperties.visibility='1'"; |
| 601 | 601 | |
| 602 | - $result = Database::query($sql); |
|
| 603 | - |
|
| 604 | - while ($myrow = Database::fetch_array($result)) |
|
| 605 | - { |
|
| 606 | - echo "<table width=\"100%\"><tr><td bgcolor=\"#E6E6E6\">"; |
|
| 607 | - echo "<img src='../img/agenda.gif' alt='agenda'>"; |
|
| 608 | - echo api_convert_and_format_date($myrow["start_date"], null, date_default_timezone_get())."<br />"; |
|
| 609 | - echo "<b>".$myrow["title"]."</b></td></tr><tr><td>"; |
|
| 610 | - echo $myrow["content"]."<br />"; |
|
| 611 | - showorhide_addresourcelink($content, $myrow["id"]); |
|
| 612 | - echo "</td></tr></table><br />"; |
|
| 613 | - } |
|
| 602 | + $result = Database::query($sql); |
|
| 603 | + |
|
| 604 | + while ($myrow = Database::fetch_array($result)) |
|
| 605 | + { |
|
| 606 | + echo "<table width=\"100%\"><tr><td bgcolor=\"#E6E6E6\">"; |
|
| 607 | + echo "<img src='../img/agenda.gif' alt='agenda'>"; |
|
| 608 | + echo api_convert_and_format_date($myrow["start_date"], null, date_default_timezone_get())."<br />"; |
|
| 609 | + echo "<b>".$myrow["title"]."</b></td></tr><tr><td>"; |
|
| 610 | + echo $myrow["content"]."<br />"; |
|
| 611 | + showorhide_addresourcelink($content, $myrow["id"]); |
|
| 612 | + echo "</td></tr></table><br />"; |
|
| 613 | + } |
|
| 614 | 614 | } // end if ($_GET["resource"]=="Agenda") |
| 615 | 615 | |
| 616 | 616 | /* |
@@ -620,12 +620,12 @@ discard block |
||
| 620 | 620 | */ |
| 621 | 621 | if ($content == "chapter") |
| 622 | 622 | { |
| 623 | - echo '<table><form name="add_dir" action="'.'" method="POST">'."\n"; |
|
| 624 | - echo ' <tr><td>'.get_lang('Title').'</td><td><input type="text" name="title" value="'.$title.'"></input></td></tr>'."\n"; |
|
| 625 | - echo ' <tr><td>'.get_lang('Description').'</td><td><input type="text" name="description" value="'.$description.'"></input></td></tr>'."\n"; |
|
| 626 | - echo ' <tr><td></td><td><input type="submit" name="add_dir" value="'.get_lang('AddIt').'"/></td></tr>'."\n"; |
|
| 627 | - echo '</form></table>'."\n"; |
|
| 628 | - //echo "<hr>"; |
|
| 623 | + echo '<table><form name="add_dir" action="'.'" method="POST">'."\n"; |
|
| 624 | + echo ' <tr><td>'.get_lang('Title').'</td><td><input type="text" name="title" value="'.$title.'"></input></td></tr>'."\n"; |
|
| 625 | + echo ' <tr><td>'.get_lang('Description').'</td><td><input type="text" name="description" value="'.$description.'"></input></td></tr>'."\n"; |
|
| 626 | + echo ' <tr><td></td><td><input type="submit" name="add_dir" value="'.get_lang('AddIt').'"/></td></tr>'."\n"; |
|
| 627 | + echo '</form></table>'."\n"; |
|
| 628 | + //echo "<hr>"; |
|
| 629 | 629 | } |
| 630 | 630 | |
| 631 | 631 | /* |
@@ -640,23 +640,23 @@ discard block |
||
| 640 | 640 | // b. one is a student AND the documents tool is active. Student cannot add documents if the documents tool is inactive (teacher can do this) |
| 641 | 641 | if ($content == "Document" OR (empty($content) AND (api_is_allowed_to_edit() OR in_array(TOOL_DOCUMENT,$active_modules))) AND !$_GET['showresources']) |
| 642 | 642 | { |
| 643 | - // setting variables for file locations |
|
| 644 | - $baseServDir = $_configuration['root_sys']; |
|
| 645 | - $courseDir = $_course['path']."/document"; |
|
| 646 | - $baseWorkDir = $baseServDir.$courseDir; |
|
| 647 | - // showing the link to move one folder up (when not in the root folder) |
|
| 648 | - show_folder_up($chapter_id); |
|
| 649 | - // showing the blue bar with the path in it when we are not in the root |
|
| 650 | - if (get_levels($folder)) |
|
| 651 | - { |
|
| 652 | - echo "<table width=\"100%\"><tr><td bgcolor=\"#4171B5\">"; |
|
| 653 | - echo "<img src=\"../img/opendir.gif\" alt='directory'><font color=\"#ffffff\"><b>"; |
|
| 654 | - echo $folder."</b></font></td></tr></table>"; |
|
| 655 | - } |
|
| 656 | - |
|
| 657 | - // showing the documents and subfolders of the folder we are in. |
|
| 658 | - show_documents($folder, $chapter_id); |
|
| 659 | - //echo "<hr>"; |
|
| 643 | + // setting variables for file locations |
|
| 644 | + $baseServDir = $_configuration['root_sys']; |
|
| 645 | + $courseDir = $_course['path']."/document"; |
|
| 646 | + $baseWorkDir = $baseServDir.$courseDir; |
|
| 647 | + // showing the link to move one folder up (when not in the root folder) |
|
| 648 | + show_folder_up($chapter_id); |
|
| 649 | + // showing the blue bar with the path in it when we are not in the root |
|
| 650 | + if (get_levels($folder)) |
|
| 651 | + { |
|
| 652 | + echo "<table width=\"100%\"><tr><td bgcolor=\"#4171B5\">"; |
|
| 653 | + echo "<img src=\"../img/opendir.gif\" alt='directory'><font color=\"#ffffff\"><b>"; |
|
| 654 | + echo $folder."</b></font></td></tr></table>"; |
|
| 655 | + } |
|
| 656 | + |
|
| 657 | + // showing the documents and subfolders of the folder we are in. |
|
| 658 | + show_documents($folder, $chapter_id); |
|
| 659 | + //echo "<hr>"; |
|
| 660 | 660 | } |
| 661 | 661 | |
| 662 | 662 | /* |
@@ -666,8 +666,8 @@ discard block |
||
| 666 | 666 | */ |
| 667 | 667 | if ($content == "Ad_Valvas") |
| 668 | 668 | { |
| 669 | - $tbl_announcement = Database :: get_course_table(TABLE_ANNOUNCEMENT); |
|
| 670 | - $sql = "SELECT * FROM ".$tbl_announcement." a, ".$item_property_table." i |
|
| 669 | + $tbl_announcement = Database :: get_course_table(TABLE_ANNOUNCEMENT); |
|
| 670 | + $sql = "SELECT * FROM ".$tbl_announcement." a, ".$item_property_table." i |
|
| 671 | 671 | WHERE |
| 672 | 672 | i.tool = '".TOOL_ANNOUNCEMENT."' AND |
| 673 | 673 | a.id=i.ref AND |
@@ -676,17 +676,17 @@ discard block |
||
| 676 | 676 | i.to_user_id IS NULL |
| 677 | 677 | ORDER BY a.display_order ASC"; |
| 678 | 678 | |
| 679 | - $result = Database::query($sql); |
|
| 680 | - while ($myrow = Database::fetch_array($result)) |
|
| 681 | - { |
|
| 682 | - echo "<table width=\"100%\"><tr><td>"; |
|
| 683 | - echo "<img src='../img/valves.gif' alt='advalvas'>"; |
|
| 684 | - echo api_convert_and_format_date($myrow["end_date"], DATE_FORMAT_LONG, date_default_timezone_get()); |
|
| 685 | - echo "</td></tr><tr><td>"; |
|
| 686 | - echo $myrow["title"]."<br />"; |
|
| 687 | - showorhide_addresourcelink($content, $myrow["id"]); |
|
| 688 | - echo "</td></tr></table>"; |
|
| 689 | - } |
|
| 679 | + $result = Database::query($sql); |
|
| 680 | + while ($myrow = Database::fetch_array($result)) |
|
| 681 | + { |
|
| 682 | + echo "<table width=\"100%\"><tr><td>"; |
|
| 683 | + echo "<img src='../img/valves.gif' alt='advalvas'>"; |
|
| 684 | + echo api_convert_and_format_date($myrow["end_date"], DATE_FORMAT_LONG, date_default_timezone_get()); |
|
| 685 | + echo "</td></tr><tr><td>"; |
|
| 686 | + echo $myrow["title"]."<br />"; |
|
| 687 | + showorhide_addresourcelink($content, $myrow["id"]); |
|
| 688 | + echo "</td></tr></table>"; |
|
| 689 | + } |
|
| 690 | 690 | } |
| 691 | 691 | |
| 692 | 692 | /* |
@@ -696,75 +696,75 @@ discard block |
||
| 696 | 696 | */ |
| 697 | 697 | if ($content == "Forum") |
| 698 | 698 | { |
| 699 | - $TBL_FORUMS = Database::get_course_table(TABLE_FORUM); |
|
| 700 | - $TBL_CATAGORIES = Database::get_course_table(TABLE_FORUM_CATEGORY); |
|
| 701 | - $TBL_FORUMTOPICS = Database::get_course_table(TABLE_FORUM_POST); |
|
| 702 | - $tbl_posts = Database::get_course_table(TABLE_FORUM_POST); |
|
| 703 | - $tbl_posts_text = Database::get_course_table(TOOL_FORUM_POST_TEXT_TABLE); |
|
| 704 | - |
|
| 705 | - echo "<table width='100%'>"; |
|
| 699 | + $TBL_FORUMS = Database::get_course_table(TABLE_FORUM); |
|
| 700 | + $TBL_CATAGORIES = Database::get_course_table(TABLE_FORUM_CATEGORY); |
|
| 701 | + $TBL_FORUMTOPICS = Database::get_course_table(TABLE_FORUM_POST); |
|
| 702 | + $tbl_posts = Database::get_course_table(TABLE_FORUM_POST); |
|
| 703 | + $tbl_posts_text = Database::get_course_table(TOOL_FORUM_POST_TEXT_TABLE); |
|
| 704 | + |
|
| 705 | + echo "<table width='100%'>"; |
|
| 706 | + |
|
| 707 | + // displaying the categories and the forums |
|
| 708 | + if (!$forum and !$thread) |
|
| 709 | + { |
|
| 710 | + $sql = "SELECT * FROM ".$TBL_FORUMS." forums, ".$TBL_CATAGORIES." categories WHERE forums.cat_id=categories.cat_id ORDER BY forums.cat_id DESC"; |
|
| 711 | + $result = Database::query($sql); |
|
| 712 | + while ($myrow = Database::fetch_array($result)) |
|
| 713 | + { |
|
| 714 | + if ($myrow["cat_title"] !== $old_cat_title) |
|
| 715 | + { |
|
| 716 | + echo "<tr><td bgcolor='#4171B5' colspan='2'><font color='white'><b>".$myrow["cat_title"]."</b></font></td></tr>"; |
|
| 717 | + } |
|
| 718 | + $old_cat_title = $myrow["cat_title"]; |
|
| 719 | + echo "<tr><td><img src='../img/forum.gif'><a href='".api_get_self()."?content=Forum&category=".$myrow["cat_id"]."&forum=".$myrow["forum_id"]."&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".$myrow["forum_name"]."</td><td>"; |
|
| 720 | + showorhide_addresourcelink("Forum", $myrow["forum_id"]); |
|
| 721 | + echo "</td></tr>"; |
|
| 722 | + } |
|
| 723 | + } |
|
| 724 | + //displaying all the threads of one forum |
|
| 725 | + if ($forum) |
|
| 726 | + { |
|
| 727 | + // displaying the category title |
|
| 728 | + $sql = "SELECT * FROM ".$TBL_CATAGORIES." WHERE cat_id=$category"; |
|
| 729 | + $result = Database::query($sql); |
|
| 730 | + $myrow = Database::fetch_array($result); |
|
| 731 | + echo "<tr><td bgcolor='#4171B5' colspan='2'><font color='white'><b>".$myrow["cat_title"]."</b></font></td></tr>"; |
|
| 732 | + |
|
| 733 | + // displaying the forum title |
|
| 734 | + $sql = "SELECT * FROM ".$TBL_FORUMS." forums, ".$TBL_FORUMTOPICS." topics WHERE forums.forum_id=topics.forum_id"; |
|
| 735 | + $result = Database::query($sql); |
|
| 736 | + $myrow = Database::fetch_array($result); |
|
| 737 | + echo "<tr><td bgcolor='#cccccc' colspan='2'><b>".$myrow["forum_name"]."</b></td></tr>"; |
|
| 738 | + |
|
| 739 | + if (!$thread) |
|
| 740 | + { |
|
| 741 | + // displaying all the threads of this forum |
|
| 742 | + $sql = "SELECT * FROM ".$TBL_FORUMTOPICS." WHERE forum_id=$forum"; |
|
| 743 | + $result = Database::query($sql); |
|
| 744 | + while ($myrow = Database::fetch_array($result)) |
|
| 745 | + { |
|
| 746 | + echo "<tr><td><a href='".api_get_self()."?content=Forum&category=$category&forum=1&thread=".$myrow["topic_id"]."&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".$myrow["topic_title"]."</a> (".$myrow["prenom"]." ".$myrow["nom"].")</td><td>"; |
|
| 747 | + showorhide_addresourcelink("Thread", $myrow["topic_id"]); |
|
| 748 | + echo "</td></tr>"; |
|
| 749 | + } |
|
| 750 | + } |
|
| 751 | + else |
|
| 752 | + { |
|
| 753 | + // displaying all the replies |
|
| 754 | + $sql = "SELECT * FROM ".$tbl_posts." post, ".$tbl_posts_text." post_text WHERE post_text.post_id=post.post_id and post.topic_id=$thread ORDER BY post_text.post_id ASC"; |
|
| 755 | + $result = Database::query($sql); |
|
| 756 | + while ($myrow = Database::fetch_array($result)) |
|
| 757 | + { |
|
| 758 | + echo "<tr><td><b>".$myrow["post_title"]."</b><br>"; |
|
| 759 | + echo $myrow["post_text"]."</td>"; |
|
| 760 | + echo "<td>"; |
|
| 761 | + showorhide_addresourcelink("Post", $myrow["post_id"]); |
|
| 762 | + echo "</td></tr><tr><td colspan='2'><hr noshade></td></tr>"; |
|
| 763 | + } |
|
| 706 | 764 | |
| 707 | - // displaying the categories and the forums |
|
| 708 | - if (!$forum and !$thread) |
|
| 709 | - { |
|
| 710 | - $sql = "SELECT * FROM ".$TBL_FORUMS." forums, ".$TBL_CATAGORIES." categories WHERE forums.cat_id=categories.cat_id ORDER BY forums.cat_id DESC"; |
|
| 711 | - $result = Database::query($sql); |
|
| 712 | - while ($myrow = Database::fetch_array($result)) |
|
| 713 | - { |
|
| 714 | - if ($myrow["cat_title"] !== $old_cat_title) |
|
| 715 | - { |
|
| 716 | - echo "<tr><td bgcolor='#4171B5' colspan='2'><font color='white'><b>".$myrow["cat_title"]."</b></font></td></tr>"; |
|
| 717 | - } |
|
| 718 | - $old_cat_title = $myrow["cat_title"]; |
|
| 719 | - echo "<tr><td><img src='../img/forum.gif'><a href='".api_get_self()."?content=Forum&category=".$myrow["cat_id"]."&forum=".$myrow["forum_id"]."&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".$myrow["forum_name"]."</td><td>"; |
|
| 720 | - showorhide_addresourcelink("Forum", $myrow["forum_id"]); |
|
| 721 | - echo "</td></tr>"; |
|
| 722 | - } |
|
| 723 | - } |
|
| 724 | - //displaying all the threads of one forum |
|
| 725 | - if ($forum) |
|
| 726 | - { |
|
| 727 | - // displaying the category title |
|
| 728 | - $sql = "SELECT * FROM ".$TBL_CATAGORIES." WHERE cat_id=$category"; |
|
| 729 | - $result = Database::query($sql); |
|
| 730 | - $myrow = Database::fetch_array($result); |
|
| 731 | - echo "<tr><td bgcolor='#4171B5' colspan='2'><font color='white'><b>".$myrow["cat_title"]."</b></font></td></tr>"; |
|
| 732 | - |
|
| 733 | - // displaying the forum title |
|
| 734 | - $sql = "SELECT * FROM ".$TBL_FORUMS." forums, ".$TBL_FORUMTOPICS." topics WHERE forums.forum_id=topics.forum_id"; |
|
| 735 | - $result = Database::query($sql); |
|
| 736 | - $myrow = Database::fetch_array($result); |
|
| 737 | - echo "<tr><td bgcolor='#cccccc' colspan='2'><b>".$myrow["forum_name"]."</b></td></tr>"; |
|
| 738 | - |
|
| 739 | - if (!$thread) |
|
| 740 | - { |
|
| 741 | - // displaying all the threads of this forum |
|
| 742 | - $sql = "SELECT * FROM ".$TBL_FORUMTOPICS." WHERE forum_id=$forum"; |
|
| 743 | - $result = Database::query($sql); |
|
| 744 | - while ($myrow = Database::fetch_array($result)) |
|
| 745 | - { |
|
| 746 | - echo "<tr><td><a href='".api_get_self()."?content=Forum&category=$category&forum=1&thread=".$myrow["topic_id"]."&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".$myrow["topic_title"]."</a> (".$myrow["prenom"]." ".$myrow["nom"].")</td><td>"; |
|
| 747 | - showorhide_addresourcelink("Thread", $myrow["topic_id"]); |
|
| 748 | - echo "</td></tr>"; |
|
| 749 | - } |
|
| 750 | - } |
|
| 751 | - else |
|
| 752 | - { |
|
| 753 | - // displaying all the replies |
|
| 754 | - $sql = "SELECT * FROM ".$tbl_posts." post, ".$tbl_posts_text." post_text WHERE post_text.post_id=post.post_id and post.topic_id=$thread ORDER BY post_text.post_id ASC"; |
|
| 755 | - $result = Database::query($sql); |
|
| 756 | - while ($myrow = Database::fetch_array($result)) |
|
| 757 | - { |
|
| 758 | - echo "<tr><td><b>".$myrow["post_title"]."</b><br>"; |
|
| 759 | - echo $myrow["post_text"]."</td>"; |
|
| 760 | - echo "<td>"; |
|
| 761 | - showorhide_addresourcelink("Post", $myrow["post_id"]); |
|
| 762 | - echo "</td></tr><tr><td colspan='2'><hr noshade></td></tr>"; |
|
| 763 | - } |
|
| 764 | - |
|
| 765 | - } |
|
| 766 | - } |
|
| 767 | - echo "</table>"; |
|
| 765 | + } |
|
| 766 | + } |
|
| 767 | + echo "</table>"; |
|
| 768 | 768 | } |
| 769 | 769 | |
| 770 | 770 | /* |
@@ -774,57 +774,57 @@ discard block |
||
| 774 | 774 | */ |
| 775 | 775 | if ($content == "Link") |
| 776 | 776 | { |
| 777 | - // including the links language file |
|
| 778 | - include ("../lang/$language/link.inc.php"); |
|
| 779 | - |
|
| 780 | - $tbl_categories = Database::get_course_table(TABLE_LINK_CATEGORY); |
|
| 781 | - if (($learnpath_id != '') and ($content == 'Link')) |
|
| 782 | - { |
|
| 783 | - echo "<form name='learnpath_link'><table>"; |
|
| 784 | - echo "<tr></td><td align='left'>".get_lang('LinkTarget')." :</td><td align='left'><select name='target' onchange='targetfunc()'><option value='_self' "; |
|
| 785 | - if ($target == '_self') |
|
| 786 | - { |
|
| 787 | - echo "selected"; |
|
| 788 | - } |
|
| 789 | - echo ">".get_lang('SameWindow')."</option><option value='_blank'"; |
|
| 790 | - if ($target == '_blank') |
|
| 791 | - { |
|
| 792 | - echo "selected"; |
|
| 793 | - } |
|
| 794 | - echo ">".get_lang('NewWindow')."</option></select></td></tr></table></form>"; |
|
| 795 | - } |
|
| 796 | - |
|
| 797 | - // showing the links that are in the root (having no category) |
|
| 798 | - $sql = "SELECT * FROM ".$link_table." l, ".$item_property_table." ip WHERE (l.category_id=0 or l.category_id IS NULL) AND ip.tool = '".TOOL_LINK."' AND l.id=ip.ref AND ip.visibility='1'"; |
|
| 799 | - $result = Database::query($sql); |
|
| 800 | - if (Database::num_rows($result) > 0) |
|
| 801 | - { |
|
| 802 | - echo "<table width=\"100%\"><tr><td bgcolor=\"#E6E6E6\"><i>".get_lang('NoCategory')."</i></td></tr></table>"; |
|
| 803 | - while ($myrow = Database::fetch_array($result)) |
|
| 804 | - { |
|
| 805 | - echo "<img src='../img/links.gif'>".$myrow["title"]; |
|
| 806 | - echo "<br>"; |
|
| 807 | - showorhide_addresourcelink($content, $myrow["id"]); |
|
| 808 | - echo "<br><br>"; |
|
| 809 | - } |
|
| 810 | - } |
|
| 811 | - |
|
| 812 | - // showing the categories and the links in it. |
|
| 813 | - $sqlcategories = "SELECT * FROM ".$tbl_categories." ORDER by display_order DESC"; |
|
| 814 | - $resultcategories = Database::query($sqlcategories) or die; |
|
| 815 | - while ($myrow = @ Database::fetch_array($resultcategories)) |
|
| 816 | - { |
|
| 817 | - $sql_links = "SELECT * FROM ".$link_table." l, ".$item_property_table." ip WHERE l.category_id='".$myrow["id"]."' AND ip.tool = '".TOOL_LINK."' AND l.id=ip.ref AND ip.visibility='1' ORDER BY l.display_order DESC"; |
|
| 818 | - echo "<table width=\"100%\"><tr><td bgcolor=\"#E6E6E6\"><i>".$myrow["category_title"]."</i></td></tr></table>"; |
|
| 819 | - $result_links = Database::query($sql_links); |
|
| 820 | - while ($myrow = Database::fetch_array($result_links)) |
|
| 821 | - { |
|
| 822 | - echo "<img src='../img/links.gif' />".$myrow["title"]; |
|
| 823 | - echo "<br>"; |
|
| 824 | - showorhide_addresourcelink($content, $myrow["id"]); |
|
| 825 | - echo "<br><br>"; |
|
| 826 | - } |
|
| 827 | - } |
|
| 777 | + // including the links language file |
|
| 778 | + include ("../lang/$language/link.inc.php"); |
|
| 779 | + |
|
| 780 | + $tbl_categories = Database::get_course_table(TABLE_LINK_CATEGORY); |
|
| 781 | + if (($learnpath_id != '') and ($content == 'Link')) |
|
| 782 | + { |
|
| 783 | + echo "<form name='learnpath_link'><table>"; |
|
| 784 | + echo "<tr></td><td align='left'>".get_lang('LinkTarget')." :</td><td align='left'><select name='target' onchange='targetfunc()'><option value='_self' "; |
|
| 785 | + if ($target == '_self') |
|
| 786 | + { |
|
| 787 | + echo "selected"; |
|
| 788 | + } |
|
| 789 | + echo ">".get_lang('SameWindow')."</option><option value='_blank'"; |
|
| 790 | + if ($target == '_blank') |
|
| 791 | + { |
|
| 792 | + echo "selected"; |
|
| 793 | + } |
|
| 794 | + echo ">".get_lang('NewWindow')."</option></select></td></tr></table></form>"; |
|
| 795 | + } |
|
| 796 | + |
|
| 797 | + // showing the links that are in the root (having no category) |
|
| 798 | + $sql = "SELECT * FROM ".$link_table." l, ".$item_property_table." ip WHERE (l.category_id=0 or l.category_id IS NULL) AND ip.tool = '".TOOL_LINK."' AND l.id=ip.ref AND ip.visibility='1'"; |
|
| 799 | + $result = Database::query($sql); |
|
| 800 | + if (Database::num_rows($result) > 0) |
|
| 801 | + { |
|
| 802 | + echo "<table width=\"100%\"><tr><td bgcolor=\"#E6E6E6\"><i>".get_lang('NoCategory')."</i></td></tr></table>"; |
|
| 803 | + while ($myrow = Database::fetch_array($result)) |
|
| 804 | + { |
|
| 805 | + echo "<img src='../img/links.gif'>".$myrow["title"]; |
|
| 806 | + echo "<br>"; |
|
| 807 | + showorhide_addresourcelink($content, $myrow["id"]); |
|
| 808 | + echo "<br><br>"; |
|
| 809 | + } |
|
| 810 | + } |
|
| 811 | + |
|
| 812 | + // showing the categories and the links in it. |
|
| 813 | + $sqlcategories = "SELECT * FROM ".$tbl_categories." ORDER by display_order DESC"; |
|
| 814 | + $resultcategories = Database::query($sqlcategories) or die; |
|
| 815 | + while ($myrow = @ Database::fetch_array($resultcategories)) |
|
| 816 | + { |
|
| 817 | + $sql_links = "SELECT * FROM ".$link_table." l, ".$item_property_table." ip WHERE l.category_id='".$myrow["id"]."' AND ip.tool = '".TOOL_LINK."' AND l.id=ip.ref AND ip.visibility='1' ORDER BY l.display_order DESC"; |
|
| 818 | + echo "<table width=\"100%\"><tr><td bgcolor=\"#E6E6E6\"><i>".$myrow["category_title"]."</i></td></tr></table>"; |
|
| 819 | + $result_links = Database::query($sql_links); |
|
| 820 | + while ($myrow = Database::fetch_array($result_links)) |
|
| 821 | + { |
|
| 822 | + echo "<img src='../img/links.gif' />".$myrow["title"]; |
|
| 823 | + echo "<br>"; |
|
| 824 | + showorhide_addresourcelink($content, $myrow["id"]); |
|
| 825 | + echo "<br><br>"; |
|
| 826 | + } |
|
| 827 | + } |
|
| 828 | 828 | } |
| 829 | 829 | |
| 830 | 830 | /* |
@@ -834,31 +834,31 @@ discard block |
||
| 834 | 834 | */ |
| 835 | 835 | if (($content == "Exercise") or ($content == "HotPotatoes")) |
| 836 | 836 | { |
| 837 | - $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
|
| 838 | - $result = Database::query("SELECT * FROM ".$TBL_EXERCICES." WHERE active='1' ORDER BY id ASC"); |
|
| 839 | - while ($myrow = Database::fetch_array($result)) |
|
| 840 | - { |
|
| 841 | - echo "<img src='../img/quiz.gif'>".$myrow["title"]."<br>"; |
|
| 842 | - showorhide_addresourcelink($content, $myrow["id"]); |
|
| 843 | - echo "<br><br>"; |
|
| 844 | - } |
|
| 837 | + $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
|
| 838 | + $result = Database::query("SELECT * FROM ".$TBL_EXERCICES." WHERE active='1' ORDER BY id ASC"); |
|
| 839 | + while ($myrow = Database::fetch_array($result)) |
|
| 840 | + { |
|
| 841 | + echo "<img src='../img/quiz.gif'>".$myrow["title"]."<br>"; |
|
| 842 | + showorhide_addresourcelink($content, $myrow["id"]); |
|
| 843 | + echo "<br><br>"; |
|
| 844 | + } |
|
| 845 | + |
|
| 846 | + if ($from_learnpath == 'yes') |
|
| 847 | + { |
|
| 848 | + $uploadPath = "/HotPotatoes_files"; |
|
| 849 | + $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT); |
|
| 850 | + $documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
|
| 851 | + $sql = "SELECT * FROM ".$TBL_DOCUMENT." WHERE (path LIKE '%htm%' OR path LIKE '%html%') AND path LIKE '".$uploadPath."/%/%' ORDER BY id ASC"; |
|
| 852 | + $result = Database::query($sql); |
|
| 853 | + while ($myrow = Database::fetch_array($result)) |
|
| 854 | + { |
|
| 855 | + $path = $myrow["path"]; |
|
| 856 | + echo "<img src='../img/jqz.gif'>".GetQuizName($path, $documentPath)."<br>"; |
|
| 857 | + showorhide_addresourcelink("HotPotatoes", $myrow["id"]); |
|
| 858 | + echo "<br><br>"; |
|
| 845 | 859 | |
| 846 | - if ($from_learnpath == 'yes') |
|
| 847 | - { |
|
| 848 | - $uploadPath = "/HotPotatoes_files"; |
|
| 849 | - $TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT); |
|
| 850 | - $documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
|
| 851 | - $sql = "SELECT * FROM ".$TBL_DOCUMENT." WHERE (path LIKE '%htm%' OR path LIKE '%html%') AND path LIKE '".$uploadPath."/%/%' ORDER BY id ASC"; |
|
| 852 | - $result = Database::query($sql); |
|
| 853 | - while ($myrow = Database::fetch_array($result)) |
|
| 854 | - { |
|
| 855 | - $path = $myrow["path"]; |
|
| 856 | - echo "<img src='../img/jqz.gif'>".GetQuizName($path, $documentPath)."<br>"; |
|
| 857 | - showorhide_addresourcelink("HotPotatoes", $myrow["id"]); |
|
| 858 | - echo "<br><br>"; |
|
| 859 | - |
|
| 860 | - } |
|
| 861 | - } |
|
| 860 | + } |
|
| 861 | + } |
|
| 862 | 862 | } |
| 863 | 863 | |
| 864 | 864 | /* |
@@ -876,10 +876,10 @@ discard block |
||
| 876 | 876 | <td align="left"><input name="external_link" type="text" id="external_link" value="http://"></td> |
| 877 | 877 | <?php |
| 878 | 878 | |
| 879 | - if ($learnpath_id != '') |
|
| 880 | - { |
|
| 881 | - echo "</tr><tr><td align='right'>".get_lang('LinkTarget')." :</td><td align='left'><select name='target'><option value='_self'>".get_lang('SameWindow')."</option><option value='_blank'>".get_lang('NewWindow')."</option></select></td>"; |
|
| 882 | - } |
|
| 879 | + if ($learnpath_id != '') |
|
| 880 | + { |
|
| 881 | + echo "</tr><tr><td align='right'>".get_lang('LinkTarget')." :</td><td align='left'><select name='target'><option value='_self'>".get_lang('SameWindow')."</option><option value='_blank'>".get_lang('NewWindow')."</option></select></td>"; |
|
| 882 | + } |
|
| 883 | 883 | ?> |
| 884 | 884 | </tr> |
| 885 | 885 | <tr> |
@@ -891,14 +891,14 @@ discard block |
||
| 891 | 891 | <option value="0"><?php echo get_lang('MainCategory'); ?></option> |
| 892 | 892 | <?php |
| 893 | 893 | |
| 894 | - $tbl_categories = Database::get_course_table(TABLE_LINK_CATEGORY); |
|
| 895 | - $sql = "SELECT * FROM $tbl_categories ORDER BY display_order ASC"; |
|
| 896 | - echo $sql; |
|
| 897 | - $result = Database::query($sql); |
|
| 898 | - while ($row = Database::fetch_array($result)) |
|
| 899 | - { |
|
| 900 | - echo "<option value='".$row["id"]."'>".$row["category_title"]."</option>"; |
|
| 901 | - } |
|
| 894 | + $tbl_categories = Database::get_course_table(TABLE_LINK_CATEGORY); |
|
| 895 | + $sql = "SELECT * FROM $tbl_categories ORDER BY display_order ASC"; |
|
| 896 | + echo $sql; |
|
| 897 | + $result = Database::query($sql); |
|
| 898 | + while ($row = Database::fetch_array($result)) |
|
| 899 | + { |
|
| 900 | + echo "<option value='".$row["id"]."'>".$row["category_title"]."</option>"; |
|
| 901 | + } |
|
| 902 | 902 | ?> |
| 903 | 903 | |
| 904 | 904 | </select><?php } ?></td> |
@@ -927,7 +927,7 @@ discard block |
||
| 927 | 927 | */ |
| 928 | 928 | if ($content == "Assignment") |
| 929 | 929 | { |
| 930 | - echo "<a href=".api_get_self()."?content=Ass&add=Ass&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no>".get_lang('AddAssignmentPage')."</a>"; |
|
| 930 | + echo "<a href=".api_get_self()."?content=Ass&add=Ass&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no>".get_lang('AddAssignmentPage')."</a>"; |
|
| 931 | 931 | } |
| 932 | 932 | |
| 933 | 933 | /* |
@@ -937,7 +937,7 @@ discard block |
||
| 937 | 937 | */ |
| 938 | 938 | if ($content == "Dropbox") |
| 939 | 939 | { |
| 940 | - echo "<a href='".api_get_self()."?content=Drop&add=Drop&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".get_lang('DropboxAdd')."</a>"; |
|
| 940 | + echo "<a href='".api_get_self()."?content=Drop&add=Drop&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".get_lang('DropboxAdd')."</a>"; |
|
| 941 | 941 | } |
| 942 | 942 | |
| 943 | 943 | /* |
@@ -947,7 +947,7 @@ discard block |
||
| 947 | 947 | */ |
| 948 | 948 | if ($content == "Introduction_text") |
| 949 | 949 | { |
| 950 | - echo "<a href='".api_get_self()."?content=Intro&add=Intro&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".get_lang('IntroductionTextAdd')."</a>"; |
|
| 950 | + echo "<a href='".api_get_self()."?content=Intro&add=Intro&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".get_lang('IntroductionTextAdd')."</a>"; |
|
| 951 | 951 | } |
| 952 | 952 | |
| 953 | 953 | /* |
@@ -957,7 +957,7 @@ discard block |
||
| 957 | 957 | */ |
| 958 | 958 | if ($content == "Course_description") |
| 959 | 959 | { |
| 960 | - echo "<a href='".api_get_self()."?content=Course_desc&add=Course_desc&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".get_lang('CourseDescriptionAdd')."</a>"; |
|
| 960 | + echo "<a href='".api_get_self()."?content=Course_desc&add=Course_desc&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".get_lang('CourseDescriptionAdd')."</a>"; |
|
| 961 | 961 | } |
| 962 | 962 | |
| 963 | 963 | /* |
@@ -967,7 +967,7 @@ discard block |
||
| 967 | 967 | */ |
| 968 | 968 | if ($content == "Groups") |
| 969 | 969 | { |
| 970 | - echo "<a href='".api_get_self()."?content=Group&add=Group&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".get_lang('$GroupsAdd')."</a>"; |
|
| 970 | + echo "<a href='".api_get_self()."?content=Group&add=Group&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".get_lang('$GroupsAdd')."</a>"; |
|
| 971 | 971 | } |
| 972 | 972 | |
| 973 | 973 | /* |
@@ -977,13 +977,13 @@ discard block |
||
| 977 | 977 | */ |
| 978 | 978 | if ($content == "Users") |
| 979 | 979 | { |
| 980 | - echo "<a href='".api_get_self()."?content=User&add=User&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".get_lang('UsersAdd')."</a>"; |
|
| 980 | + echo "<a href='".api_get_self()."?content=User&add=User&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no'>".get_lang('UsersAdd')."</a>"; |
|
| 981 | 981 | } |
| 982 | 982 | |
| 983 | 983 | if ($showresources) |
| 984 | 984 | { |
| 985 | - //echo "<h4>".get_lang('ResourceAdded')."</h4>"; |
|
| 986 | - display_resources(1); |
|
| 985 | + //echo "<h4>".get_lang('ResourceAdded')."</h4>"; |
|
| 986 | + display_resources(1); |
|
| 987 | 987 | } |
| 988 | 988 | |
| 989 | 989 | echo "</td></tr></table>"; |
@@ -28,11 +28,11 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | // COURSES WITH CATEGORIES |
| 30 | 30 | if (!empty($user_course_categories)) { |
| 31 | - foreach ($user_course_categories as $row) { |
|
| 32 | - echo Display::page_subheader($row['title']); |
|
| 33 | - echo '<a name="category'.$row['id'].'"></a>'; |
|
| 31 | + foreach ($user_course_categories as $row) { |
|
| 32 | + echo Display::page_subheader($row['title']); |
|
| 33 | + echo '<a name="category'.$row['id'].'"></a>'; |
|
| 34 | 34 | |
| 35 | - if (isset($_GET['categoryid']) && $_GET['categoryid'] == $row['id']) { ?> |
|
| 35 | + if (isset($_GET['categoryid']) && $_GET['categoryid'] == $row['id']) { ?> |
|
| 36 | 36 | <!-- We display the edit form for the category --> |
| 37 | 37 | |
| 38 | 38 | <form name="edit_course_category" method="post" action="courses.php?action=<?php echo $action; ?>"> |
@@ -243,15 +243,15 @@ discard block |
||
| 243 | 243 | </a> |
| 244 | 244 | <?php } else { |
| 245 | 245 | echo Display::display_icon('up_na.png', get_lang('Up'),'',22); |
| 246 | - } |
|
| 246 | + } |
|
| 247 | 247 | |
| 248 | - if ($key < $number_of_courses - 1) { ?> |
|
| 248 | + if ($key < $number_of_courses - 1) { ?> |
|
| 249 | 249 | <a href="courses.php?action=<?php echo $action; ?>&move=down&course=<?php echo $course['code']; ?>&category=<?php echo $course['user_course_cat']; ?>&sec_token=<?php echo $stok; ?>"> |
| 250 | 250 | <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?> |
| 251 | 251 | </a> |
| 252 | 252 | <?php } else { |
| 253 | 253 | echo Display::display_icon('down_na.png', get_lang('Down'),'',22); |
| 254 | - }?> |
|
| 254 | + }?> |
|
| 255 | 255 | </div> |
| 256 | 256 | <div style="float:left; margin-right:10px;"> |
| 257 | 257 | <!-- cancel subscrioption--> |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | </div> |
| 270 | 270 | <?php } |
| 271 | 271 | } |
| 272 | - ?> |
|
| 272 | + ?> |
|
| 273 | 273 | </td> |
| 274 | 274 | </tr> |
| 275 | 275 | <?php |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | <!-- Actions: The menu with the different options in cathe course management --> |
| 18 | 18 | <div id="actions" class="actions"> |
| 19 | 19 | <?php if ($action != 'createcoursecategory') { ?> |
| 20 | - <a href="<?php echo api_get_self(); ?>?action=createcoursecategory"><?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'),'','32'); ?></a> |
|
| 20 | + <a href="<?php echo api_get_self(); ?>?action=createcoursecategory"><?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'), '', '32'); ?></a> |
|
| 21 | 21 | <?php } ?> |
| 22 | 22 | </div> |
| 23 | 23 | |
@@ -49,26 +49,26 @@ discard block |
||
| 49 | 49 | $max_category_key = count($user_course_categories); |
| 50 | 50 | if ($action != 'unsubscribe') { ?> |
| 51 | 51 | <a href="courses.php?action=sortmycourses&categoryid=<?php echo $row['id']; ?>&sec_token=<?php echo $stok; ?>#category<?php echo $row['id']; ?>"> |
| 52 | - <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?> |
|
| 52 | + <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?> |
|
| 53 | 53 | </a> |
| 54 | 54 | |
| 55 | 55 | <?php if ($row['id'] != $user_course_categories[0]['id']) { ?> |
| 56 | 56 | <a href="courses.php?action=<?php echo $action ?>&move=up&category=<?php echo $row['id']; ?>&sec_token=<?php echo $stok; ?>"> |
| 57 | - <?php echo Display::return_icon('up.png', get_lang('Up'),'',22); ?> |
|
| 57 | + <?php echo Display::return_icon('up.png', get_lang('Up'), '', 22); ?> |
|
| 58 | 58 | </a> |
| 59 | 59 | <?php } else { ?> |
| 60 | - <?php echo Display::return_icon('up_na.png', get_lang('Up'),'',22); ?> |
|
| 60 | + <?php echo Display::return_icon('up_na.png', get_lang('Up'), '', 22); ?> |
|
| 61 | 61 | <?php } ?> |
| 62 | 62 | |
| 63 | 63 | <?php if ($row['id'] != $user_course_categories[$max_category_key - 1]['id']) { ?> |
| 64 | 64 | <a href="courses.php?action=<?php echo $action; ?>&move=down&category=<?php echo $row['id']; ?>&sec_token=<?php echo $stok; ?>"> |
| 65 | - <?php echo Display::return_icon('down.png', get_lang('Down'),'',22); ?> |
|
| 65 | + <?php echo Display::return_icon('down.png', get_lang('Down'), '', 22); ?> |
|
| 66 | 66 | </a> |
| 67 | 67 | <?php } else { ?> |
| 68 | - <?php echo Display::return_icon('down_na.png', get_lang('Down'),'',22); ?> |
|
| 68 | + <?php echo Display::return_icon('down_na.png', get_lang('Down'), '', 22); ?> |
|
| 69 | 69 | <?php } ?> |
| 70 | 70 | <a href="courses.php?action=deletecoursecategory&id=<?php echo $row['id']; ?>&sec_token=<?php echo $stok; ?>"> |
| 71 | - <?php echo Display::display_icon('delete.png', get_lang('Delete'), array('onclick' => "javascript: if (!confirm('".addslashes(api_htmlentities(get_lang("CourseCategoryAbout2bedeleted"), ENT_QUOTES, api_get_system_encoding()))."')) return false;"),22) ?> |
|
| 71 | + <?php echo Display::display_icon('delete.png', get_lang('Delete'), array('onclick' => "javascript: if (!confirm('".addslashes(api_htmlentities(get_lang("CourseCategoryAbout2bedeleted"), ENT_QUOTES, api_get_system_encoding()))."')) return false;"), 22) ?> |
|
| 72 | 72 | </a> |
| 73 | 73 | <?php } |
| 74 | 74 | echo '<br /><br />'; |
@@ -122,35 +122,35 @@ discard block |
||
| 122 | 122 | <div style="float:left;width:110px;"> |
| 123 | 123 | <?php |
| 124 | 124 | if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') { |
| 125 | - $icon_title = get_lang('CourseDetails') . ' - ' . $course['title']; |
|
| 125 | + $icon_title = get_lang('CourseDetails').' - '.$course['title']; |
|
| 126 | 126 | ?> |
| 127 | 127 | <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" data-title="<?php echo $icon_title ?>" title="<?php echo $icon_title ?>" class="ajax"> |
| 128 | - <?php echo Display::return_icon('info.png', $icon_title,'','22') ?> |
|
| 128 | + <?php echo Display::return_icon('info.png', $icon_title, '', '22') ?> |
|
| 129 | 129 | <?php } ?> |
| 130 | 130 | </a> |
| 131 | 131 | |
| 132 | 132 | <?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) { ?> |
| 133 | - <?php echo Display::display_icon('edit_na.png', get_lang('Edit'),'',22); ?> |
|
| 133 | + <?php echo Display::display_icon('edit_na.png', get_lang('Edit'), '', 22); ?> |
|
| 134 | 134 | <?php } else { ?> |
| 135 | 135 | <a href="courses.php?action=<?php echo $action; ?>&edit=<?php echo $course['code']; ?>&sec_token=<?php echo $stok; ?>"> |
| 136 | - <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?> |
|
| 136 | + <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?> |
|
| 137 | 137 | </a> |
| 138 | 138 | <?php } ?> |
| 139 | 139 | |
| 140 | 140 | <?php if ($key > 0) { ?> |
| 141 | 141 | <a href="courses.php?action=<?php echo $action; ?>&move=up&course=<?php echo $course['code']; ?>&category=<?php echo $course['user_course_cat']; ?>&sec_token=<?php echo $stok; ?>"> |
| 142 | - <?php echo Display::display_icon('up.png', get_lang('Up'),'',22); ?> |
|
| 142 | + <?php echo Display::display_icon('up.png', get_lang('Up'), '', 22); ?> |
|
| 143 | 143 | </a> |
| 144 | 144 | <?php } else { ?> |
| 145 | - <?php echo Display::display_icon('up_na.png', get_lang('Up'),'',22); ?> |
|
| 145 | + <?php echo Display::display_icon('up_na.png', get_lang('Up'), '', 22); ?> |
|
| 146 | 146 | <?php } ?> |
| 147 | 147 | |
| 148 | 148 | <?php if ($key < $number_of_courses - 1) { ?> |
| 149 | 149 | <a href="courses.php?action=<?php echo $action; ?>&move=down&course=<?php echo $course['code']; ?>&category=<?php echo $course['user_course_cat']; ?>&sec_token=<?php echo $stok; ?>"> |
| 150 | - <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?> |
|
| 150 | + <?php echo Display::display_icon('down.png', get_lang('Down'), '', 22); ?> |
|
| 151 | 151 | </a> |
| 152 | 152 | <?php } else { ?> |
| 153 | - <?php echo Display::display_icon('down_na.png', get_lang('Down'),'',22); ?> |
|
| 153 | + <?php echo Display::display_icon('down_na.png', get_lang('Down'), '', 22); ?> |
|
| 154 | 154 | <?php } ?> |
| 155 | 155 | |
| 156 | 156 | </div> |
@@ -221,36 +221,36 @@ discard block |
||
| 221 | 221 | <div style="float:left; width:110px"> |
| 222 | 222 | <?php |
| 223 | 223 | if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') { |
| 224 | - $icon_title = get_lang('CourseDetails') . ' - ' . $course['title']; |
|
| 224 | + $icon_title = get_lang('CourseDetails').' - '.$course['title']; |
|
| 225 | 225 | ?> |
| 226 | 226 | <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" data-title="<?php echo $icon_title ?>" title="<?php echo $icon_title ?>" class="ajax"> |
| 227 | - <?php echo Display::return_icon('info.png', $icon_title, '','22'); ?> |
|
| 227 | + <?php echo Display::return_icon('info.png', $icon_title, '', '22'); ?> |
|
| 228 | 228 | </a> |
| 229 | 229 | <?php } ?> |
| 230 | 230 | |
| 231 | 231 | <?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) { ?> |
| 232 | - <?php echo Display::display_icon('edit_na.png', get_lang('Edit'),'',22); ?> |
|
| 232 | + <?php echo Display::display_icon('edit_na.png', get_lang('Edit'), '', 22); ?> |
|
| 233 | 233 | <?php } else { ?> |
| 234 | 234 | <a href="courses.php?action=<?php echo $action; ?>&edit=<?php echo $course['code']; ?>&sec_token=<?php echo $stok; ?>"> |
| 235 | - <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?> |
|
| 235 | + <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?> |
|
| 236 | 236 | </a> |
| 237 | 237 | <?php } ?> |
| 238 | 238 | |
| 239 | 239 | <!-- up /down icons--> |
| 240 | 240 | <?php if ($key > 0) { ?> |
| 241 | 241 | <a href="courses.php?action=<?php echo $action; ?>&move=up&course=<?php echo $course['code']; ?>&category=<?php echo $course['user_course_cat']; ?>&sec_token=<?php echo $stok; ?>"> |
| 242 | - <?php echo Display::display_icon('up.png', get_lang('Up'),'',22) ?> |
|
| 242 | + <?php echo Display::display_icon('up.png', get_lang('Up'), '', 22) ?> |
|
| 243 | 243 | </a> |
| 244 | 244 | <?php } else { |
| 245 | - echo Display::display_icon('up_na.png', get_lang('Up'),'',22); |
|
| 245 | + echo Display::display_icon('up_na.png', get_lang('Up'), '', 22); |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | if ($key < $number_of_courses - 1) { ?> |
| 249 | 249 | <a href="courses.php?action=<?php echo $action; ?>&move=down&course=<?php echo $course['code']; ?>&category=<?php echo $course['user_course_cat']; ?>&sec_token=<?php echo $stok; ?>"> |
| 250 | - <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?> |
|
| 250 | + <?php echo Display::display_icon('down.png', get_lang('Down'), '', 22); ?> |
|
| 251 | 251 | </a> |
| 252 | 252 | <?php } else { |
| 253 | - echo Display::display_icon('down_na.png', get_lang('Down'),'',22); |
|
| 253 | + echo Display::display_icon('down_na.png', get_lang('Down'), '', 22); |
|
| 254 | 254 | }?> |
| 255 | 255 | </div> |
| 256 | 256 | <div style="float:left; margin-right:10px;"> |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | <!-- Actions: The menu with the different options in cathe course management --> |
| 17 | 17 | <div id="actions" class="actions"> |
| 18 | 18 | <a href="<?php echo api_get_self() ?>?action=sortmycourses"> |
| 19 | - <?php echo Display::return_icon('back.png', get_lang('Back'),'','32'); ?> |
|
| 19 | + <?php echo Display::return_icon('back.png', get_lang('Back'), '', '32'); ?> |
|
| 20 | 20 | </a> |
| 21 | 21 | </div> |
| 22 | 22 | |
@@ -26,14 +26,14 @@ |
||
| 26 | 26 | * Redirect to the correct script to handle this type of upload |
| 27 | 27 | */ |
| 28 | 28 | switch ($_SESSION['my_tool']) { |
| 29 | - case TOOL_LEARNPATH: |
|
| 30 | - require 'upload.scorm.php'; |
|
| 31 | - break; |
|
| 32 | - //the following cases need to be distinguished later on |
|
| 33 | - case TOOL_DROPBOX: |
|
| 34 | - case TOOL_STUDENTPUBLICATION: |
|
| 35 | - case TOOL_DOCUMENT: |
|
| 36 | - default: |
|
| 37 | - require 'upload.document.php'; |
|
| 38 | - break; |
|
| 29 | + case TOOL_LEARNPATH: |
|
| 30 | + require 'upload.scorm.php'; |
|
| 31 | + break; |
|
| 32 | + //the following cases need to be distinguished later on |
|
| 33 | + case TOOL_DROPBOX: |
|
| 34 | + case TOOL_STUDENTPUBLICATION: |
|
| 35 | + case TOOL_DOCUMENT: |
|
| 36 | + default: |
|
| 37 | + require 'upload.document.php'; |
|
| 38 | + break; |
|
| 39 | 39 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | require_once '../inc/global.inc.php'; |
| 17 | 17 | $this_section = SECTION_COURSES; |
| 18 | -$current_course_tool = TOOL_GROUP; |
|
| 18 | +$current_course_tool = TOOL_GROUP; |
|
| 19 | 19 | |
| 20 | 20 | // Notice for unauthorized people. |
| 21 | 21 | api_protect_course_script(true); |
@@ -85,29 +85,29 @@ discard block |
||
| 85 | 85 | Display::return_icon('add.png', get_lang('NewGroupCreate'), '', ICON_SIZE_MEDIUM).'</a>'; |
| 86 | 86 | |
| 87 | 87 | if (api_get_setting('allow_group_categories') == 'true') { |
| 88 | - $actions.= '<a href="group_category.php?'.api_get_cidreq().'&action=add_category">'. |
|
| 88 | + $actions .= '<a href="group_category.php?'.api_get_cidreq().'&action=add_category">'. |
|
| 89 | 89 | Display::return_icon('new_folder.png', get_lang('AddCategory'), '', ICON_SIZE_MEDIUM).'</a>'; |
| 90 | 90 | } else { |
| 91 | - $actions.= '<a href="group_category.php?'.api_get_cidreq().'&id=2">'. |
|
| 91 | + $actions .= '<a href="group_category.php?'.api_get_cidreq().'&id=2">'. |
|
| 92 | 92 | Display::return_icon('settings.png', get_lang('PropModify'), '', ICON_SIZE_MEDIUM).'</a>'; |
| 93 | 93 | } |
| 94 | - $actions.= '<a href="import.php?'.api_get_cidreq().'&action=import">'. |
|
| 94 | + $actions .= '<a href="import.php?'.api_get_cidreq().'&action=import">'. |
|
| 95 | 95 | Display::return_icon('import_csv.png', get_lang('Import'), '', ICON_SIZE_MEDIUM).'</a>'; |
| 96 | 96 | |
| 97 | - $actions.= '<a href="group_overview.php?'.api_get_cidreq().'&action=export_all&type=csv">'. |
|
| 97 | + $actions .= '<a href="group_overview.php?'.api_get_cidreq().'&action=export_all&type=csv">'. |
|
| 98 | 98 | Display::return_icon('export_csv.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>'; |
| 99 | 99 | |
| 100 | - $actions.= '<a href="group_overview.php?'.api_get_cidreq().'&action=export&type=xls">'. |
|
| 100 | + $actions .= '<a href="group_overview.php?'.api_get_cidreq().'&action=export&type=xls">'. |
|
| 101 | 101 | Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM).'</a>'; |
| 102 | 102 | |
| 103 | - $actions.= '<a href="group_overview.php?'.api_get_cidreq().'&action=export_pdf">'. |
|
| 103 | + $actions .= '<a href="group_overview.php?'.api_get_cidreq().'&action=export_pdf">'. |
|
| 104 | 104 | Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM).'</a>'; |
| 105 | 105 | |
| 106 | - $actions.= '<a href="group.php?'.api_get_cidreq().'">'. |
|
| 107 | - Display::return_icon('group.png', get_lang('Groups'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 106 | + $actions .= '<a href="group.php?'.api_get_cidreq().'">'. |
|
| 107 | + Display::return_icon('group.png', get_lang('Groups'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 108 | 108 | |
| 109 | 109 | |
| 110 | - $actions.= '<a href="../user/user.php?'.api_get_cidreq().'">'. |
|
| 110 | + $actions .= '<a href="../user/user.php?'.api_get_cidreq().'">'. |
|
| 111 | 111 | Display::return_icon('user.png', get_lang('GoTo').' '.get_lang('Users'), '', ICON_SIZE_MEDIUM).'</a>'; |
| 112 | 112 | |
| 113 | 113 | // Action links |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * This script displays an area where teachers can edit the group properties and member list. |
| 6 | - * |
|
| 6 | + * |
|
| 7 | 7 | * @author various contributors |
| 8 | 8 | * @author Roan Embrechts (VUB), partial code cleanup, initial virtual course support |
| 9 | 9 | * @package chamilo.group |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | require_once '../inc/global.inc.php'; |
| 14 | 14 | $this_section = SECTION_COURSES; |
| 15 | -$current_course_tool = TOOL_GROUP; |
|
| 15 | +$current_course_tool = TOOL_GROUP; |
|
| 16 | 16 | |
| 17 | 17 | // Notice for unauthorized people. |
| 18 | 18 | api_protect_course_script(true); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $form->addGroup( |
| 82 | 82 | $group, |
| 83 | 83 | '', |
| 84 | - Display::return_icon('user.png', get_lang('GroupSelfRegistration')) . '<span>' . get_lang('GroupSelfRegistration') . '</span>', |
|
| 84 | + Display::return_icon('user.png', get_lang('GroupSelfRegistration')).'<span>'.get_lang('GroupSelfRegistration').'</span>', |
|
| 85 | 85 | null, |
| 86 | 86 | false |
| 87 | 87 | ); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $form->addGroup( |
| 96 | 96 | $group, |
| 97 | 97 | '', |
| 98 | - Display::return_icon('folder.png', get_lang('GroupDocument')) . '<span>' . get_lang('GroupDocument') . '</span>', |
|
| 98 | + Display::return_icon('folder.png', get_lang('GroupDocument')).'<span>'.get_lang('GroupDocument').'</span>', |
|
| 99 | 99 | null, |
| 100 | 100 | false |
| 101 | 101 | ); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $form->addGroup( |
| 110 | 110 | $group, |
| 111 | 111 | '', |
| 112 | - Display::return_icon('works.png', get_lang('GroupWork')) . '<span>' . get_lang('GroupWork') . '</span>', |
|
| 112 | + Display::return_icon('works.png', get_lang('GroupWork')).'<span>'.get_lang('GroupWork').'</span>', |
|
| 113 | 113 | null, |
| 114 | 114 | false |
| 115 | 115 | ); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $form->addGroup( |
| 124 | 124 | $group, |
| 125 | 125 | '', |
| 126 | - Display::return_icon('agenda.png', get_lang('GroupCalendar')) . '<span>' . get_lang('GroupCalendar') . '</span>', |
|
| 126 | + Display::return_icon('agenda.png', get_lang('GroupCalendar')).'<span>'.get_lang('GroupCalendar').'</span>', |
|
| 127 | 127 | null, |
| 128 | 128 | false |
| 129 | 129 | ); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $form->addGroup( |
| 141 | 141 | $group, |
| 142 | 142 | '', |
| 143 | - Display::return_icon('announce.png', get_lang('GroupAnnouncements')) . '<span>' . get_lang('GroupAnnouncements') . '</span>', |
|
| 143 | + Display::return_icon('announce.png', get_lang('GroupAnnouncements')).'<span>'.get_lang('GroupAnnouncements').'</span>', |
|
| 144 | 144 | null, |
| 145 | 145 | false |
| 146 | 146 | ); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $form->addGroup( |
| 155 | 155 | $group, |
| 156 | 156 | '', |
| 157 | - Display::return_icon('forum.png', get_lang('GroupForum')) . '<span>' . get_lang('GroupForum') . '</span>', |
|
| 157 | + Display::return_icon('forum.png', get_lang('GroupForum')).'<span>'.get_lang('GroupForum').'</span>', |
|
| 158 | 158 | null, |
| 159 | 159 | false |
| 160 | 160 | ); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $form->addGroup( |
| 182 | 182 | $group, |
| 183 | 183 | '', |
| 184 | - Display::return_icon('chat.png', get_lang('Chat')) . '<span>' . get_lang('Chat') . '</span>', |
|
| 184 | + Display::return_icon('chat.png', get_lang('Chat')).'<span>'.get_lang('Chat').'</span>', |
|
| 185 | 185 | null, |
| 186 | 186 | false |
| 187 | 187 | ); |