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
7 require_once("config.php");
9 optional_variable($file, "");
10 optional_variable($text, "No text to display");
11 optional_variable($module, "moodle");
13 $lang = current_language();
17 if (detect_munged_arguments("$module/$file")) {
18 error("Filenames contain illegal characters!");
22 if ($module == "moodle") {
23 $filepath = "$CFG->dirroot/lang/$lang/help/$file";
25 $filepath = "$CFG->dirroot/lang/$lang/help/$module/$file";
28 if (file_exists("$filepath")) {
29 require_once("$filepath"); // Chosen language
31 } else { // Fall back to English
32 if ($module == "moodle") {
33 $filepath = "$CFG->dirroot/lang/en/help/$file";
35 $filepath = "$CFG->dirroot/lang/en/help/$module/$file";
38 if (file_exists("$filepath")) {
39 require_once("$filepath");
41 notify("Can not find the specified help file");
51 close_window_button();