]> git.mjollnir.org Git - moodle.git/commitdiff
Added $forcelang optional parameter. This is useful if we want to get help.php
authorvyshane <vyshane>
Wed, 22 Mar 2006 03:16:27 +0000 (03:16 +0000)
committervyshane <vyshane>
Wed, 22 Mar 2006 03:16:27 +0000 (03:16 +0000)
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.

help.php

index 38de024358449aa227305ef941402dabf41ab4ef..7ef2807babe7575800937dda47fc5a76c0fbd77b 100644 (file)
--- a/help.php
+++ b/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();
 
     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)) {