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