Added $forcelang optional parameter. This is useful if we want to get help.php

to display the help content in a language irrespective of the site language
settings. This is needed for /admin/helpdoc.php script. This view requires
previews for:

1) en_utf8
2) the current language the site is set to

Without the change to /help.php, 1) is not possible.
This commit is contained in:
vyshane 2006-03-22 03:16:27 +00:00
parent 3b26532171
commit c05181937a

View file

@ -19,6 +19,7 @@
$file = optional_param('file', '', PARAM_CLEAN);
$text = optional_param('text', 'No text to display', PARAM_CLEAN);
$module = optional_param('module', 'moodle', PARAM_ALPHAEXT);
$forcelang = optional_param('forcelang', '', PARAM_ALPHAEXT);
print_header();
@ -29,8 +30,11 @@
print_simple_box_start('center', '96%');
$helpfound = false;
$langs = array(current_language(), get_string('parentlanguage'), 'en'); // Fallback
if (empty($forcelang)) {
$langs = array(current_language(), get_string('parentlanguage'), 'en_utf8'); // Fallback
} else {
$langs = array($forcelang);
}
if (!empty($file)) {
foreach ($langs as $lang) {
if (empty($lang)) {