From: toyomoyo Date: Thu, 7 Dec 2006 02:19:13 +0000 (+0000) Subject: merged fix for MDL-7734, making help links respect course langs X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2ca05411a9b5b0ffec89f38ada74809910fd3f4b;p=moodle.git merged fix for MDL-7734, making help links respect course langs --- diff --git a/lib/weblib.php b/lib/weblib.php index e14fcb7e97..baf5392e41 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -4504,7 +4504,14 @@ function print_error ($errorcode, $module='', $link='', $a=NULL) { */ function helpbutton ($page, $title='', $module='moodle', $image=true, $linktext=false, $text='', $return=false, $imagetext='') { - global $CFG; + global $CFG, $course; + + // fix for MDL-7734 + if ($course->lang) { + $forcelang = $course->lang; + } else { + $forcelang = ''; + } if ($module == '') { $module = 'moodle'; @@ -4532,10 +4539,11 @@ function helpbutton ($page, $title='', $module='moodle', $image=true, $linktext= $linkobject .= $tooltip; } + // fix for MDL-7734 if ($text) { - $url = '/help.php?module='. $module .'&text='. s(urlencode($text)); + $url = '/help.php?module='. $module .'&text='. s(urlencode($text).'&forcelang='.$forcelang); } else { - $url = '/help.php?module='. $module .'&file='. $page .'.html'; + $url = '/help.php?module='. $module .'&file='. $page .'.html&forcelang='.$forcelang; } $link = ''.