Slight tweak to allow completely blank headers (no arguments to
[moodle.git] / help.php
CommitLineData
229b6580 1<?PHP
2 /// help.php - prints a very simple page and includes a
3 /// page content or a string from elsewhere
4 /// Usually this will appear in a popup
65cf9fc3 5 /// See helpbutton() in lib/moodlelib.php
229b6580 6
7 include("config.php");
8
65cf9fc3 9 optional_variable($file, "");
10 optional_variable($text, "No text to display");
11 optional_variable($module, "moodle");
12
229b6580 13 if (ereg("\\.\\.", $file)) {
14 error("Error: Filenames can not contain \"..\"");
15 }
16
229b6580 17?>
18<HTML>
19<HEAD>
20<LINK rel="stylesheet" href="<?=$CFG->wwwroot?>/theme/<?=$CFG->theme?>/styles.css">
21</HEAD>
22<BODY BGCOLOR="<?=$THEME->body ?>">
65cf9fc3 23<? if ($file) {
24 if ($module == "moodle") {
25 $langpath = "$CFG->dirroot/lang";
26 } else {
27 $langpath = "$CFG->dirroot/mod/$module/lang";
28 }
29
30 if (file_exists("$langpath/$CFG->lang/page/$file")) {
31 include("$langpath/$CFG->lang/page/$file");
32 } else {
33 include("$langpath/en/page/$file");
34 }
35 } else {
36 echo "<P>";
37 echo $text;
38 echo "</P>";
39 }
ed5ab9f7 40?>
229b6580 41</BODY>
42</HTML>
43