Automatic installer.php lang files by installer_builder (20060913)
[moodle.git] / course / info.php
blob995517ae91b6f1b91ea9a3b7252f1f3fedbed975
1 <?php // $Id$
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");
15 if ($name) {
16 if (! $course = get_record("course", "shortname", $name) ) {
17 error("That's an invalid short course name");
19 } else {
20 if (! $course = get_record("course", "id", $id) ) {
21 error("That's an invalid course id");
25 $site = get_site();
27 if ($CFG->forcelogin) {
28 require_login();
31 print_header(get_string("summaryof", "", $course->fullname));
33 echo "<h3 align=\"center\">$course->fullname<br />($course->shortname)</h3>";
35 echo "<center>";
36 if ($course->guest) {
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>&nbsp;$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>&nbsp;$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&amp;course=$site->id", "opener",
56 fullname($teacher), 400, 500, "$teacher->role",
57 "");
58 echo "<br />";
61 echo "</font></p>";
62 echo "</td</tr></table>";
64 echo "<br />";
66 print_simple_box_start("center", "100%");
67 echo filter_text(text_to_html($course->summary),$course->id);
68 print_simple_box_end();
70 echo "<br />";
72 close_window_button();