2002-08-18 16:31:23 +00:00
|
|
|
<?PHP // $Id$
|
|
|
|
|
|
|
|
require("../config.php");
|
|
|
|
|
2002-10-29 14:48:58 +00:00
|
|
|
optional_variable($id); // course context
|
2002-08-18 16:31:23 +00:00
|
|
|
require_variable($file); // file in this directory to view
|
|
|
|
|
2002-10-29 14:48:58 +00:00
|
|
|
$file = clean_filename($file);
|
2002-08-18 16:31:23 +00:00
|
|
|
|
2004-05-16 10:26:04 +00:00
|
|
|
if ($CFG->forcelogin) {
|
|
|
|
require_login();
|
|
|
|
}
|
|
|
|
|
2002-10-29 14:48:58 +00:00
|
|
|
if ($id) {
|
|
|
|
if (! $course = get_record("course", "id", $id)) {
|
|
|
|
error("Course is misconfigured");
|
|
|
|
}
|
2002-08-18 16:31:23 +00:00
|
|
|
$strhelp = get_string("help");
|
|
|
|
print_header("$course->shortname: $strhelp", "$course->fullname",
|
2003-06-12 11:55:03 +00:00
|
|
|
"<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> -> $strhelp");
|
2002-10-29 14:48:58 +00:00
|
|
|
} else {
|
|
|
|
if (! $site = get_site()) {
|
|
|
|
error("Site is misconfigured");
|
|
|
|
}
|
|
|
|
$strdocumentation = get_string("documentation");
|
|
|
|
print_header("$site->shortname: $strhelp", "$site->fullname",
|
2003-06-12 11:55:03 +00:00
|
|
|
"<a href=\"view.php?file=contents.html\">$strdocumentation</a>");
|
2002-10-29 14:48:58 +00:00
|
|
|
|
2002-08-18 16:31:23 +00:00
|
|
|
}
|
2002-12-29 14:39:52 +00:00
|
|
|
|
2003-06-12 11:55:03 +00:00
|
|
|
echo "<blockquote>";
|
2002-12-29 14:39:52 +00:00
|
|
|
|
2003-06-12 11:55:03 +00:00
|
|
|
if (! document_file($file, true)) {
|
|
|
|
notify("404 - File Not Found");
|
|
|
|
}
|
2002-12-29 14:39:52 +00:00
|
|
|
|
2003-06-12 11:55:03 +00:00
|
|
|
echo "</blockquote>";
|
2002-08-18 16:31:23 +00:00
|
|
|
|
|
|
|
?>
|
|
|
|
|