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");
15 if (detect_munged_arguments("$module/$file")) {
16 error("Filenames contain illegal characters!");
22 $langs = array(current_language(), get_string("parentlanguage"), "en"); // Fallback
23 foreach ($langs as $lang) {
27 if ($module == "moodle") {
28 $filepath = "$CFG->dirroot/lang/$lang/help/$file";
30 $filepath = "$CFG->dirroot/lang/$lang/help/$module/$file";
33 if (file_exists("$filepath")) {
35 include("$filepath"); // The actual helpfile
47 notify("Help file '$file' could not be found!");
50 close_window_button();
52 echo "<center><p><a href=\"help.php?file=index.html\">".get_string("helpindex")."</a><p></center>";