Skip to content

Commit

Permalink
help.php: related to MDL-13816. Clean up the URLs used for help files…
Browse files Browse the repository at this point in the history
… by removing unused parameters.
  • Loading branch information
tjhunt committed Mar 30, 2009
1 parent c3935ad commit e79079d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion help.php
Expand Up @@ -103,7 +103,7 @@

// 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');
Expand Down
20 changes: 8 additions & 12 deletions lib/weblib.php
Expand Up @@ -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'))) {
Expand Down Expand Up @@ -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 .'&text='. s(urlencode($text).'&forcelang='.$forcelang);
$url = '/help.php?text='. s(urlencode($text));
} else {
$url = '/help.php?module='. $module .'&file='. $page .'.html&forcelang='.$forcelang;
$url = '/help.php?module='. $module .'&file='. $page .'.html';
// fix for MDL-7734
if (!empty($COURSE->lang)) {
$url .= '&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;
Expand Down

0 comments on commit e79079d

Please sign in to comment.