3 /// Displays external information about a course
5 require_once("../config.php");
6 require_once("lib.php");
8 $id = optional_param('id', false, PARAM_INT
); // Course id
9 $name = optional_param('name', false, PARAM_RAW
); // Course short name
11 if (!$id and !$name) {
12 error("Must specify course id or short name");
16 if (! $course = get_record("course", "shortname", $name) ) {
17 error("That's an invalid short course name");
20 if (! $course = get_record("course", "id", $id) ) {
21 error("That's an invalid course id");
27 if ($CFG->forcelogin
) {
31 print_header(get_string("summaryof", "", $course->fullname
));
33 echo "<h3 align=\"center\">$course->fullname<br />($course->shortname)</h3>";
37 $strallowguests = get_string("allowguests");
38 echo "<p><font size=\"1\"><img align=\"middle\" alt=\"\" height=\"16\" width=\"16\" border=\"0\" src=\"$CFG->pixpath/i/guest.gif\" /></a> $strallowguests</font></p>";
40 if ($course->password
) {
41 $strrequireskey = get_string("requireskey");
42 echo "<p><font size=\"1\"><img align=\"middle\" alt=\"\" height=\"16\" width=\"16\" border=\"0\" src=\"$CFG->pixpath/i/key.gif\" /></a> $strrequireskey</font></p>";
46 if ($teachers = get_course_teachers($course->id
)) {
47 echo "<table align=\"center\"><tr><td nowrap=\"nowrap\">";
48 echo "<p><font size=\"1\">\n";
49 foreach ($teachers as $teacher) {
50 if ($teacher->authority
> 0) {
51 if (!$teacher->role
) {
52 $teacher->role
= $course->teacher
;
54 echo "$teacher->role: ";
55 link_to_popup_window ("/user/view.php?id=$teacher->id&course=$site->id", "opener",
56 fullname($teacher), 400, 500, "$teacher->role",
62 echo "</td</tr></table>";
66 print_simple_box_start("center", "100%");
67 echo filter_text(text_to_html($course->summary
),$course->id
);
68 print_simple_box_end();
72 close_window_button();