]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12291 help.php is now able to skip _local langpacks. Merged from MOODLE_19_STABLE
authormudrd8mz <mudrd8mz>
Sat, 19 Jan 2008 22:00:39 +0000 (22:00 +0000)
committermudrd8mz <mudrd8mz>
Sat, 19 Jan 2008 22:00:39 +0000 (22:00 +0000)
help.php

index 330c0c050fe27b814bf0c2b9585b7774621be5fd..62363ec85b67ad75adce7c1d89f964e6ebe07805 100644 (file)
--- a/help.php
+++ b/help.php
@@ -18,6 +18,7 @@ $file   = optional_param('file', '', PARAM_PATH);
 $text   = optional_param('text', 'No text to display', PARAM_CLEAN);
 $module = optional_param('module', 'moodle', PARAM_ALPHAEXT);
 $forcelang = optional_param('forcelang', '', PARAM_SAFEDIR);
+$skiplocal = optional_param('skiplocal', 0, PARAM_INT);     // shall _local help files be skipped?
 
 // Start the output.
 print_header(get_string('help'));
@@ -38,17 +39,18 @@ if (!empty($file)) {
         $langs = array($forcelang, 'en_utf8');
     }
     
-    // _local language packs take precedence with both forced language and non-forced language settings
-    $xlangs = array();
-    foreach ($langs as $lang) {
-        if (!empty($lang)) {
-            $xlangs[] = $lang . '_local';
-            $xlangs[] = $lang;
+    if (!$skiplocal) {
+        // _local language packs take precedence with both forced language and non-forced language settings
+        $xlangs = array();
+        foreach ($langs as $lang) {
+            if (!empty($lang)) {
+                $xlangs[] = $lang . '_local';
+                $xlangs[] = $lang;
+            }
         }
+        $langs = $xlangs;
+        unset($xlangs);
     }
-    $langs = $xlangs;
-    unset($xlangs);
-
 
 // Define possible locations for help file similar to locations for language strings
 // Note: Always retain module directory as before