From: tjhunt Date: Tue, 24 Jul 2007 17:17:52 +0000 (+0000) Subject: MDL-10589 - make the forum subscribe link a post form button. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e344003ad67c544b57c1f314982d9ce723652f45;p=moodle.git MDL-10589 - make the forum subscribe link a post form button. --- diff --git a/lib/weblib.php b/lib/weblib.php index 505a56459a..cc71944e3f 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 .= '
'; @@ -3499,7 +3499,12 @@ function print_single_button($link, $options, $label='OK', $method='get', $targe $output .= ''; } } - $output .= '
'; + if ($tooltip) { + $tooltip = 'title="' . s($tooltip) . '"'; + } else { + $tooltip = ''; + } + $output .= ''; if ($return) { return $output; diff --git a/mod/forum/lib.php b/mod/forum/lib.php index e97fc3cecf..fafd10dc32 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 '' . $linktext . ''; + return print_single_button($CFG->wwwroot . '/mod/forum/subscribe.php?id=' . $forum->id, + '', $linktext, 'post', '_self', true, $linktitle); } }