Skip to content

Commit

Permalink
MDL-12291 help.php is now able to skip _local langpacks. Merged from …
Browse files Browse the repository at this point in the history
…MOODLE_19_STABLE
  • Loading branch information
mudrd8mz committed Jan 19, 2008
1 parent ff396fd commit 45f5cfd
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions help.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
$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'));
Expand All @@ -38,17 +39,18 @@
$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
Expand Down

0 comments on commit 45f5cfd

Please sign in to comment.