From 9dc1fb4ddeab85fecd12e6cf8b63c93a7486800b Mon Sep 17 00:00:00 2001 From: mudrd8mz Date: Mon, 2 Mar 2009 14:14:19 +0000 Subject: [PATCH] MDL-14743 offer a link to the English help file. Merged from 1.9 stable --- help.php | 22 +++++++++++++++++++++- lang/en_utf8/moodle.php | 1 + 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/help.php b/help.php index 88fcfd8fef..86d07211e9 100644 --- a/help.php +++ b/help.php @@ -161,7 +161,27 @@ if (!$helpfound) { // End of page. close_window_button(); -echo '

'. get_string('helpindex') .'

'; +echo '

'. get_string('helpindex') .''; + +// Offer a link to the alternative help file language +if (($helpfound) and (((current_language() != 'en_utf8') and $lang != 'en_utf8') or ($forcelang === 'en_utf8'))) { + $linklang = "{$CFG->wwwroot}/help.php?"; + $linklang .= !empty($module) ? "module=$module&" : ''; + $linklang .= !empty($file) ? "file=$file&" : ''; + $linklang .= !empty($skiplocal) ? "skiplocal=$skiplocal&" : ''; + + if (empty($forcelang) or $forcelang === current_language()) { + $nextlang = 'en_utf8'; + $nextlangname = 'English'; + } else { + $nextlang = current_language(); + $nextlangname = get_string('thislanguage'); + } + + $linklang .= "forcelang=$nextlang"; + echo "
" . get_string('showthishelpinlanguage', 'moodle', $nextlangname) . ''; +} +echo '

'; $CFG->docroot = ''; // We don't want a doc link here print_footer('none'); diff --git a/lang/en_utf8/moodle.php b/lang/en_utf8/moodle.php index 499d5a26dd..a5949e82a8 100644 --- a/lang/en_utf8/moodle.php +++ b/lang/en_utf8/moodle.php @@ -1423,6 +1423,7 @@ $string['showrecent'] = 'Show recent activity'; $string['showreports'] = 'Show activity reports'; $string['showsettings'] = 'Show settings'; $string['showtheselogs'] = 'Show these logs'; +$string['showthishelpinlanguage'] = 'Show this help in language: $a'; $string['showtopicfromothers'] = 'Show topic from others'; $string['showweekfromothers'] = 'Show week from others'; $string['since'] = 'Since'; -- 2.39.5