Improvements to the help system

This commit is contained in:
martin
2002-07-21 08:34:25 +00:00
parent c31ebf26c7
commit 65cf9fc390
5 changed files with 51 additions and 18 deletions
+22 -7
View File
@@ -2,26 +2,41 @@
/// help.php - prints a very simple page and includes a
/// page content or a string from elsewhere
/// Usually this will appear in a popup
/// See help() in lib/moodlelib.php
/// See helpbutton() in lib/moodlelib.php
include("config.php");
optional_variable($file, "");
optional_variable($text, "No text to display");
optional_variable($module, "moodle");
if (ereg("\\.\\.", $file)) {
error("Error: Filenames can not contain \"..\"");
}
?>
<HTML>
<HEAD>
<LINK rel="stylesheet" href="<?=$CFG->wwwroot?>/theme/<?=$CFG->theme?>/styles.css">
</HEAD>
<BODY BGCOLOR="<?=$THEME->body ?>">
<? if (file_exists("lang/$CFG->lang/page/$file")) {
include("lang/$CFG->lang/page/$file");
} else {
include("lang/en/page/$file");
}
<? if ($file) {
if ($module == "moodle") {
$langpath = "$CFG->dirroot/lang";
} else {
$langpath = "$CFG->dirroot/mod/$module/lang";
}
if (file_exists("$langpath/$CFG->lang/page/$file")) {
include("$langpath/$CFG->lang/page/$file");
} else {
include("$langpath/en/page/$file");
}
} else {
echo "<P>";
echo $text;
echo "</P>";
}
?>
</BODY>
</HTML>