]> git.mjollnir.org Git - moodle.git/commitdiff
help.php: related to MDL-13816. Clean up the URLs used for help files by removing...
authortjhunt <tjhunt>
Mon, 30 Mar 2009 06:11:32 +0000 (06:11 +0000)
committertjhunt <tjhunt>
Mon, 30 Mar 2009 06:11:32 +0000 (06:11 +0000)
help.php
lib/weblib.php

index 3c9844de8168eb42472596085ce926b37233efb4..cbe2b22534eaeffebdf9e3d580446dd8bb71e7d4 100644 (file)
--- a/help.php
+++ b/help.php
@@ -103,7 +103,7 @@ echo '<p class="helpindex"><a href="help.php?file=index.html">'. get_string('hel
 
 // Offer a link to the alternative help file language
 $currentlang = current_language();
-if ($helpfound && ($foundlang != 'en_utf8' || ($forcelang == 'en_utf8' && current_language() != 'en_utf8'))) {
+if ($file && $helpfound && ($foundlang != 'en_utf8' || ($forcelang == 'en_utf8' && current_language() != 'en_utf8'))) {
     $url = new moodle_url();
     if ($foundlang != 'en_utf8') {
         $url->param('forcelang', 'en_utf8');
index be16aeffbf21401984f10d9fee141ee93a9d9f51..ce82070c5921e0b25c3c34b168a449a13f200f86 100644 (file)
@@ -5948,13 +5948,6 @@ function helpbutton($page, $title, $module='moodle', $image=true, $linktext=fals
         debugging('Warning: it\'s not recommended to use $text parameter in helpbutton ($page=' . $page . ', $module=' . $module . ') function', DEBUG_DEVELOPER);
     }
 
-    // fix for MDL-7734
-    if (!empty($COURSE->lang)) {
-        $forcelang = $COURSE->lang;
-    } else {
-        $forcelang = '';
-    }
-
     // Catch references to the old text.html and emoticons.html help files that
     // were renamed in MDL-13233.
     if (in_array($page, array('text', 'emoticons', 'richtext'))) {
@@ -5996,14 +5989,17 @@ function helpbutton($page, $title, $module='moodle', $image=true, $linktext=fals
 
     // fix for MDL-7734
     if ($text) {
-        $url = '/help.php?module='. $module .'&amp;text='. s(urlencode($text).'&amp;forcelang='.$forcelang);
+        $url = '/help.php?text='. s(urlencode($text));
     } else {
-        $url = '/help.php?module='. $module .'&amp;file='. $page .'.html&amp;forcelang='.$forcelang;
+        $url = '/help.php?module='. $module .'&amp;file='. $page .'.html';
+        // fix for MDL-7734
+        if (!empty($COURSE->lang)) {
+            $url .= '&amp;forcelang=' . $COURSE->lang;
+        }
     }
 
-    $link = '<span class="helplink">'.
-            link_to_popup_window ($url, 'popup', $linkobject, 400, 500, $tooltip, 'none', true).
-            '</span>';
+    $link = '<span class="helplink">' . link_to_popup_window($url, 'popup',
+            $linkobject, 400, 500, $tooltip, 'none', true) . '</span>';
 
     if ($return) {
         return $link;