Commit | Line | Data |
---|---|---|
822a1063 | 1 | <?php |
6be7abc7 | 2 | /** |
3 | * help.php - Displays help page. | |
4 | * | |
5 | * Prints a very simple page and includes | |
6 | * page content or a string from elsewhere. | |
7 | * Usually this will appear in a popup | |
8 | * See {@link helpbutton()} in {@link lib/moodlelib.php} | |
9 | * | |
10 | * @author Martin Dougiamas | |
6be7abc7 | 11 | * @package moodlecore |
12 | */ | |
53a78cef PS |
13 | |
14 | define('NO_MOODLE_COOKIES', true); | |
15 | ||
6be7abc7 | 16 | require_once('config.php'); |
17 | ||
53a78cef PS |
18 | $identifier = required_param('identifier', PARAM_SAFEDIR); |
19 | $component = required_param('component', PARAM_SAFEDIR); | |
20 | $lang = required_param('component', PARAM_LANG); | |
21 | ||
22 | if (!$lang) { | |
23 | $lang = 'en'; | |
24 | } | |
25 | ||
26 | $SESSION->lang = $lang; // does not actually modify session because we do not use cookies here | |
3a915b06 | 27 | |
53a78cef PS |
28 | // send basic headers only, we do not need full html page here |
29 | @header('Content-Type: text/plain; charset=utf-8'); | |
6be7abc7 | 30 | |
53a78cef PS |
31 | if (strpos('_hlp', $identifier) === false) { |
32 | echo '<strong>Old 1.9 style help files need to be converted to standard strings with "_hlp" suffix: '.$component.'/'.$identifier.'</strong>'; | |
33 | die; | |
34 | } | |
868ca14f | 35 | |
53a78cef | 36 | echo get_string($identifier, $component); |