From 9a3adb2032c0b44c58473329310172c7ded7903b Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Tue, 7 Dec 2010 12:34:11 +0000 Subject: [PATCH] NOMDL forum: fixed the string wording to match the current code condition Previous string was used together with the legacy:guest capability. However, the current code checks is_enrolled() instead. This led to a weird situation when non-enrolled admin or manager could not subscribe to a forum and the error message was completely confusing for them. --- mod/forum/lang/en/forum.php | 2 +- mod/forum/subscribe.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/forum/lang/en/forum.php b/mod/forum/lang/en/forum.php index 6e3711dd4df..684390a4759 100644 --- a/mod/forum/lang/en/forum.php +++ b/mod/forum/lang/en/forum.php @@ -238,7 +238,6 @@ $string['noattachments'] = 'There are no attachments to this post'; $string['nodiscussions'] = 'There are no discussion topics yet in this forum'; $string['nodiscussionsstartedby'] = 'No discussions started by this user'; $string['noguestpost'] = 'Sorry, guests are not allowed to post.'; -$string['noguestsubscribe'] = 'Sorry, guests are not allowed to subscribe to receive forum postings by email.'; $string['noguesttracking'] = 'Sorry, guests are not allowed to set tracking options.'; $string['nomorepostscontaining'] = 'No more posts containing \'{$a}\' were found'; $string['nonews'] = 'No news has been posted yet'; @@ -340,6 +339,7 @@ $string['startedby'] = 'Started by'; $string['subject'] = 'Subject'; $string['subscribe'] = 'Subscribe to this forum'; $string['subscribeall'] = 'Subscribe everyone to this forum'; +$string['subscribeenrolledonly'] = 'Sorry, only enrolled users are allowed to subscribe to receive forum postings by email.'; $string['subscribed'] = 'Subscribed'; $string['subscribenone'] = 'Unsubscribe everyone from this forum'; $string['subscribers'] = 'Subscribers'; diff --git a/mod/forum/subscribe.php b/mod/forum/subscribe.php index 9d3fbb3398b..9d7345af17a 100644 --- a/mod/forum/subscribe.php +++ b/mod/forum/subscribe.php @@ -78,7 +78,7 @@ if (!is_enrolled($context)) { // Guests and visitors can't subscribe - only en $PAGE->set_title($course->shortname); $PAGE->set_heading($course->fullname); echo $OUTPUT->header(); - echo $OUTPUT->confirm(get_string('noguestsubscribe', 'forum').'

'.get_string('liketologin'), + echo $OUTPUT->confirm(get_string('subscribeenrolledonly', 'forum').'

'.get_string('liketologin'), get_login_url(), new moodle_url('/mod/forum/view.php', array('f'=>$id))); echo $OUTPUT->footer(); exit;