New translation
[moodle.git] / doc / view.php
blob088c59f30677963fecfee83729009f3143726b16
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 ($id) {
11 if (! $course = get_record("course", "id", $id)) {
12 error("Course is misconfigured");
14 $strhelp = get_string("help");
15 print_header("$course->shortname: $strhelp", "$course->fullname",
16 "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> -> $strhelp");
17 } else {
18 if (! $site = get_site()) {
19 error("Site is misconfigured");
21 $strdocumentation = get_string("documentation");
22 print_header("$site->shortname: $strhelp", "$site->fullname",
23 "<a href=\"view.php?file=contents.html\">$strdocumentation</a>");
27 echo "<blockquote>";
29 if (! document_file($file, true)) {
30 notify("404 - File Not Found");
33 echo "</blockquote>";