mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
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:
parent
3b26532171
commit
c05181937a
1 changed files with 6 additions and 2 deletions
8
help.php
8
help.php
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue