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
5 /// See helpbutton() in lib/moodlelib.php
9 optional_variable($file, "");
10 optional_variable($text, "No text to display");
11 optional_variable($module, "moodle");
15 if (ereg("\\.\\.", $file)) {
16 error("Filenames can not contain \"..\"");
20 if ($module == "moodle") {
21 $filepath = "$CFG->dirroot/lang/$CFG->lang/help/$file";
23 $filepath = "$CFG->dirroot/lang/$CFG->lang/help/$module/$file";
26 if (file_exists("$filepath")) {
27 include("$filepath"); // Chosen language
29 } else { // Fall back to English
30 if ($module == "moodle") {
31 $filepath = "$CFG->dirroot/lang/en/help/$file";
33 $filepath = "$CFG->dirroot/lang/en/help/$module/$file";
36 if (file_exists("$filepath")) {
39 notify("Can not find the specified help file");