]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14743 offer a link to the English help file. Merged from 1.9 stable
authormudrd8mz <mudrd8mz>
Mon, 2 Mar 2009 14:14:19 +0000 (14:14 +0000)
committermudrd8mz <mudrd8mz>
Mon, 2 Mar 2009 14:14:19 +0000 (14:14 +0000)
help.php
lang/en_utf8/moodle.php

index 88fcfd8fefbcd91765f96344c5e87fb242992f34..86d07211e94703ed0e8e6143ab4b3d4dc72270be 100644 (file)
--- a/help.php
+++ b/help.php
@@ -161,7 +161,27 @@ if (!$helpfound) {
 
 // End of page.
 close_window_button();
-echo '<p class="helpindex"><a href="help.php?file=index.html">'. get_string('helpindex') .'</a></p>';
+echo '<p class="helpindex"><a href="help.php?file=index.html">'. get_string('helpindex') .'</a>';
+
+// 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&amp;" : '';
+    $linklang .= !empty($file)      ? "file=$file&amp;" : '';
+    $linklang .= !empty($skiplocal) ? "skiplocal=$skiplocal&amp;" : '';
+
+    if (empty($forcelang) or $forcelang === current_language()) {
+        $nextlang = 'en_utf8';
+        $nextlangname = 'English';
+    } else {
+        $nextlang = current_language();
+        $nextlangname = get_string('thislanguage');
+    }
+
+    $linklang .= "forcelang=$nextlang";
+    echo "<br /><a href=\"$linklang\">" . get_string('showthishelpinlanguage', 'moodle', $nextlangname) . '</a>';
+}
+echo '</p>';
 
 $CFG->docroot = '';   // We don't want a doc link here
 print_footer('none');
index 499d5a26ddf3ad39e8fc42911f42d1c25df3db57..a5949e82a891e065f535ebc2833a82b1f5e4a9b1 100644 (file)
@@ -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';