New translation.
[moodle.git] / help.php
blobabcfb995d413c6c768bfbc7a3f20751080f91e73
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
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();
15 print_header();
17 if (detect_munged_arguments("$module/$file")) {
18 error("Filenames contain illegal characters!");
21 if ($file) {
22 if ($module == "moodle") {
23 $filepath = "$CFG->dirroot/lang/$lang/help/$file";
24 } else {
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";
34 } else {
35 $filepath = "$CFG->dirroot/lang/en/help/$module/$file";
38 if (file_exists("$filepath")) {
39 require_once("$filepath");
40 } else {
41 notify("Can not find the specified help file");
42 die;
45 } else {
46 echo "<p>";
47 echo $text;
48 echo "</p>";
51 close_window_button();
53 </body>
54 </html>