MDL-12055 Tweaked forum subscribe 'continue' address
This commit is contained in:
+1
-1
@@ -376,7 +376,7 @@
|
||||
if ($can_subscribe) {
|
||||
$row[] = forum_get_subscribe_link($forum, $context, array('subscribed' => $stryes,
|
||||
'unsubscribed' => $strno, 'forcesubscribed' => $stryes,
|
||||
'cantsubscribe' => '-'), $cantaccessagroup, false);
|
||||
'cantsubscribe' => '-'), $cantaccessagroup, false, true);
|
||||
}
|
||||
|
||||
//If this forum has RSS activated, calculate it
|
||||
|
||||
+4
-3
@@ -3299,7 +3299,7 @@ function forum_post_subscription($post) {
|
||||
* at the top of the function.
|
||||
* @param
|
||||
*/
|
||||
function forum_get_subscribe_link($forum, $context, $messages = array(), $cantaccessagroup = false, $fakelink=true) {
|
||||
function forum_get_subscribe_link($forum, $context, $messages = array(), $cantaccessagroup = false, $fakelink=true, $backtoindex=false) {
|
||||
global $CFG, $USER;
|
||||
$defaultmessages = array(
|
||||
'subscribed' => get_string('unsubscribe', 'forum'),
|
||||
@@ -3325,18 +3325,19 @@ function forum_get_subscribe_link($forum, $context, $messages = array(), $cantac
|
||||
$linktitle = get_string('subscribestart', 'forum');
|
||||
}
|
||||
|
||||
$backtoindexlink=($backtoindex ? '&backtoindex=1' : '');
|
||||
$link = '';
|
||||
if ($fakelink) {
|
||||
$link .= '<script type="text/javascript">';
|
||||
$link .= '//<![CDATA['."\n";
|
||||
$link .= 'document.getElementById("subscriptionlink").innerHTML = "<a title=\"' . $linktitle . '\" href=\"' . $CFG->wwwroot .
|
||||
'/mod/forum/subscribe.php?id=' . $forum->id . '\">' . $linktext . '<\/a>";';
|
||||
'/mod/forum/subscribe.php?id=' . $forum->id . $backtoindexlink.'\">' . $linktext . '<\/a>";';
|
||||
$link .= '//]]>';
|
||||
$link .= '</script>';
|
||||
// use <noscript> to print button in case javascript is not enabled
|
||||
$link .= '<noscript>';
|
||||
}
|
||||
$link .= print_single_button($CFG->wwwroot . '/mod/forum/subscribe.php?id=' . $forum->id,
|
||||
$link .= print_single_button($CFG->wwwroot . '/mod/forum/subscribe.php?id=' . $forum->id.$backtoindexlink,
|
||||
'', $linktext, 'post', '_self', true, $linktitle);
|
||||
if ($fakelink) {
|
||||
$link .= '</noscript>';
|
||||
|
||||
@@ -60,7 +60,9 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
$returnto = forum_go_back_to("view.php?f=$id");
|
||||
$returnto = optional_param('backtoindex',0,PARAM_INT)
|
||||
? "index.php?id=".$course->id
|
||||
: "view.php?f=$id";
|
||||
|
||||
if ($force and has_capability('mod/forum:managesubscriptions', $context)) {
|
||||
if (forum_is_forcesubscribed($forum->id)) {
|
||||
|
||||
Reference in New Issue
Block a user