@@ -561,8 +561,9 @@ |
||
561 | 561 | } |
562 | 562 | $dir= substr($dir,0,-1); |
563 | 563 | $selectcat = ''; |
564 | - if (isset($_REQUEST['selectcat'])) |
|
565 | - $selectcat = "&selectcat=".Security::remove_XSS($_REQUEST['selectcat']); |
|
564 | + if (isset($_REQUEST['selectcat'])) { |
|
565 | + $selectcat = "&selectcat=".Security::remove_XSS($_REQUEST['selectcat']); |
|
566 | + } |
|
566 | 567 | $certificate_condition = ''; |
567 | 568 | if ($is_certificate_mode) { |
568 | 569 | $df = DocumentManager::get_default_certificate_id($_course['code']); |
@@ -40,7 +40,9 @@ |
||
40 | 40 | $user_id = api_get_user_id(); |
41 | 41 | $coursePath = api_get_path(SYS_COURSE_PATH).$cidReq.'/document'; |
42 | 42 | $_course = CourseManager::get_course_information($cidReq); |
43 | -if ($_course == null) die ("problem when fetching course information"); |
|
43 | +if ($_course == null) { |
|
44 | + die ("problem when fetching course information"); |
|
45 | +} |
|
44 | 46 | // stupid variable initialisation for old version of DocumentManager functions. |
45 | 47 | $_course['path'] = $_course['directory']; |
46 | 48 | $is_manager = (CourseManager::get_user_in_course_status($user_id, $cidReq) == COURSEMANAGER); |
@@ -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 | { |
@@ -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"; |
@@ -303,7 +303,9 @@ discard block |
||
303 | 303 | } |
304 | 304 | |
305 | 305 | foreach ($recipient_ids as $rec) { |
306 | - if (empty($rec)) die(get_lang('GeneralError').' (code 210)'); |
|
306 | + if (empty($rec)) { |
|
307 | + die(get_lang('GeneralError').' (code 210)'); |
|
308 | + } |
|
307 | 309 | //if (!isCourseMember($rec)) die(); //cannot sent document to someone outside of course |
308 | 310 | //this check is done when validating submitted data |
309 | 311 | $this->recipients[] = array('id' => $rec, 'name' => getUserNameFromId($rec)); |
@@ -593,13 +595,19 @@ discard block |
||
593 | 595 | $id = intval($id); |
594 | 596 | $sql = "DELETE FROM ".$dropbox_cnf['tbl_file']." |
595 | 597 | WHERE c_id = $course_id AND cat_id = '".$id."' "; |
596 | - if (!Database::query($sql)) return false; |
|
598 | + if (!Database::query($sql)) { |
|
599 | + return false; |
|
600 | + } |
|
597 | 601 | $sql = "DELETE FROM ".$dropbox_cnf['tbl_category']." |
598 | 602 | WHERE c_id = $course_id AND cat_id = '".$id."' "; |
599 | - if (!Database::query($sql)) return false; |
|
603 | + if (!Database::query($sql)) { |
|
604 | + return false; |
|
605 | + } |
|
600 | 606 | $sql = "DELETE FROM ".$dropbox_cnf['tbl_post']." |
601 | 607 | WHERE c_id = $course_id AND cat_id = '".$id."' "; |
602 | - if (!Database::query($sql)) return false; |
|
608 | + if (!Database::query($sql)) { |
|
609 | + return false; |
|
610 | + } |
|
603 | 611 | return true; |
604 | 612 | } |
605 | 613 |
@@ -267,7 +267,9 @@ |
||
267 | 267 | break; |
268 | 268 | } |
269 | 269 | } |
270 | - if (!$found) die(get_lang('GeneralError').' (code 415)'); |
|
270 | + if (!$found) { |
|
271 | + die(get_lang('GeneralError').' (code 415)'); |
|
272 | + } |
|
271 | 273 | |
272 | 274 | echo '<form method="post" action="index.php">', "\n", |
273 | 275 | '<input type="hidden" name="feedbackid" value="', |
@@ -9,17 +9,19 @@ |
||
9 | 9 | |
10 | 10 | // actions menu |
11 | 11 | $new_thematic_plan_data = array(); |
12 | -if (!empty($thematic_plan_data)) |
|
13 | -foreach($thematic_plan_data as $thematic_item) { |
|
12 | +if (!empty($thematic_plan_data)) { |
|
13 | + foreach($thematic_plan_data as $thematic_item) { |
|
14 | 14 | $thematic_simple_list[] = $thematic_item['description_type']; |
15 | +} |
|
15 | 16 | $new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item; |
16 | 17 | } |
17 | 18 | |
18 | 19 | $new_id = ADD_THEMATIC_PLAN; |
19 | -if (!empty($thematic_simple_list)) |
|
20 | -foreach($thematic_simple_list as $item) { |
|
20 | +if (!empty($thematic_simple_list)) { |
|
21 | + foreach($thematic_simple_list as $item) { |
|
21 | 22 | if ($item >= ADD_THEMATIC_PLAN) { |
22 | 23 | $new_id = $item + 1; |
24 | +} |
|
23 | 25 | $default_thematic_plan_title[$item] = $new_thematic_plan_data[$item]['title']; |
24 | 26 | } |
25 | 27 | } |
@@ -81,7 +81,7 @@ |
||
81 | 81 | //just showing the src in a iframe ... |
82 | 82 | $html .= '<h2>'.$toc['title'].'</h2>'; |
83 | 83 | $html .= '<iframe border="0" frameborder="0" style="width:100%;height:600px" src="' . $src . '"></iframe>'; |
84 | - }else{ |
|
84 | + } else{ |
|
85 | 85 | $html .= "<div class='impress-title'>"; |
86 | 86 | $html .= '<h1>'.$toc['title'].'</h1>'; |
87 | 87 | $html .= "</div>"; |
@@ -45,8 +45,9 @@ discard block |
||
45 | 45 | } |
46 | 46 | break; |
47 | 47 | case "stackgetall": |
48 | - if (storage_can_set($_REQUEST['svuser'])) |
|
49 | - print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
48 | + if (storage_can_set($_REQUEST['svuser'])) { |
|
49 | + print storage_stack_getall($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey']); |
|
50 | + } |
|
50 | 51 | break; |
51 | 52 | case "getposition": |
52 | 53 | print storage_get_position($_REQUEST['svuser'], $_REQUEST['svcourse'], $_REQUEST['svsco'], $_REQUEST['svkey'], $_REQUEST['svasc']); |
@@ -87,8 +88,7 @@ discard block |
||
87 | 88 | } else { |
88 | 89 | return $row['sv_value']; |
89 | 90 | } |
90 | - } |
|
91 | - else { |
|
91 | + } else { |
|
92 | 92 | return null; |
93 | 93 | } |
94 | 94 | } |
@@ -144,8 +144,7 @@ discard block |
||
144 | 144 | if (Database::num_rows($res) > 0) { |
145 | 145 | $row = Database::fetch_assoc($res); |
146 | 146 | return $row['position']; |
147 | - } |
|
148 | - else { |
|
147 | + } else { |
|
149 | 148 | return null; |
150 | 149 | } |
151 | 150 | } |
@@ -198,8 +197,7 @@ discard block |
||
198 | 197 | if ($resorder && $resinsert) { |
199 | 198 | Database::query("commit"); |
200 | 199 | return 1; |
201 | - } |
|
202 | - else { |
|
200 | + } else { |
|
203 | 201 | Database::query("rollback"); |
204 | 202 | return 0; |
205 | 203 | } |