* @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">';
$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;
$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);
}
}