file size.html was added on branch MOODLE_15_STABLE on 2005-07-07 17:01:43 +0000
[moodle.git] / doc / view.php
blobf3efc204c6a6ab68f7e910ea762aa9a701dd1273
1 <?PHP // $Id$
3 require("../config.php");
5 optional_variable($id); // course context
6 require_variable($file); // file in this directory to view
8 $file = clean_filename($file);
10 if ($CFG->forcelogin) {
11 require_login();
14 if ($id) {
15 if (! $course = get_record("course", "id", $id)) {
16 error("Course is misconfigured");
18 $strhelp = get_string("help");
19 print_header("$course->shortname: $strhelp", "$course->fullname",
20 "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> -> $strhelp");
21 } else {
22 if (! $site = get_site()) {
23 error("Site is misconfigured");
25 $strdocumentation = get_string("documentation");
26 print_header("$site->shortname: $strhelp", "$site->fullname",
27 "<a href=\"view.php?file=contents.html\">$strdocumentation</a>");
31 echo "<blockquote>";
33 if (! document_file($file, true)) {
34 notify("404 - File Not Found");
37 echo "</blockquote>";