diff --git a/lib/weblib.php b/lib/weblib.php index 505a56459a9..cc71944e3ff 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3487,7 +3487,7 @@ function print_box_end($return=false) { * @param string $method ? * @todo Finish documenting this function */ -function print_single_button($link, $options, $label='OK', $method='get', $target='_self', $return=false) { +function print_single_button($link, $options, $label='OK', $method='get', $target='_self', $return=false, $tooltip='') { $output = ''; $link = str_replace('"', '"', $link); //basic XSS protection $output .= '<div class="singlebutton">'; @@ -3499,7 +3499,12 @@ function print_single_button($link, $options, $label='OK', $method='get', $targe $output .= '<input type="hidden" name="'. $name .'" value="'. s($value) .'" />'; } } - $output .= '<input type="submit" value="'. s($label) .'" /></div></form></div>'; + if ($tooltip) { + $tooltip = 'title="' . s($tooltip) . '"'; + } else { + $tooltip = ''; + } + $output .= '<input type="submit" value="'. s($label) .'" ' . $tooltip . ' /></div></form></div>'; if ($return) { return $output; diff --git a/mod/forum/lib.php b/mod/forum/lib.php index e97fc3cecf8..fafd10dc32d 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -3249,8 +3249,8 @@ function forum_get_subscribe_link($forum, $context, $messages = array(), $cantac $linktext = $messages['unsubscribed']; $linktitle = get_string('subscribestart', 'forum'); } - return '<a title="' . $linktitle . '" href="' . $CFG->wwwroot . - '/mod/forum/subscribe.php?id=' . $forum->id . '">' . $linktext . '</a>'; + return print_single_button($CFG->wwwroot . '/mod/forum/subscribe.php?id=' . $forum->id, + '', $linktext, 'post', '_self', true, $linktitle); } }