mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-10589 - make the forum subscribe link a post form button.
This commit is contained in:
parent
40ce63cbb7
commit
e344003ad6
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user