Merge branch 'MDL-76970-master' of https://github.com/laurentdavid/moodle

This commit is contained in:
Andrew Nicols 2023-03-09 22:22:32 +08:00
commit 43f5bfdbe4
3 changed files with 14 additions and 10 deletions

View file

@ -466,7 +466,8 @@ $string['noattachments'] = 'There are no attachments to this post';
$string['nodiscussions'] = 'There are no discussion topics yet in this forum';
$string['nodiscussionsstartedby'] = '{$a} has not started any discussions';
$string['nodiscussionsstartedbyyou'] = 'You haven\'t started any discussions yet';
$string['noguestpost'] = 'Sorry, guests are not allowed to post.';
$string['noguestpost'] = 'Only logged in users can post to this forum.';
$string['noguestpost:title'] = 'Log in to continue';
$string['noguestsubscribe'] = 'Sorry, guests are not allowed to subscribe.';
$string['noguesttracking'] = 'Sorry, guests are not allowed to set tracking options.';
$string['nomorepostscontaining'] = 'No more posts containing \'{$a}\' were found';

View file

@ -105,7 +105,10 @@ if (!isloggedin() or isguestuser()) {
$referer = get_local_referer(false);
echo $OUTPUT->header();
echo $OUTPUT->confirm(get_string('noguestpost', 'forum').'<br /><br />'.get_string('liketologin'), get_login_url(), $referer);
echo $OUTPUT->confirm(get_string('noguestpost', 'forum'), get_login_url(), $referer, [
'confirmtitle' => get_string('noguestpost:title', 'forum'),
'continuestr' => get_string('login')
]);
echo $OUTPUT->footer();
exit;
}

View file

@ -83,14 +83,14 @@ Feature: Guest and not logged users could see the option to add new post or repl
And I am on the "Forum" "forum activity" page
Then I should see "Add discussion topic"
And I click on "Add discussion topic" "link"
And I should see "Sorry, guests are not allowed to post"
And I should see "Only logged in users can post to this forum"
And I click on "Cancel" "button"
And I should see "Forum discussion 1"
And I click on "Forum discussion 1" "link"
And I should see "Reply"
And I click on "Reply" "link"
And I should see "Sorry, guests are not allowed to post"
And I click on "Continue" "button"
And I should see "Only logged in users can post to this forum"
And I click on "Log in" "button"
And I should see "Log in"
Examples:
@ -112,11 +112,11 @@ Feature: Guest and not logged users could see the option to add new post or repl
And I should see "Forum (single discussion)"
Then I should see "Reply"
And I click on "Reply" "link"
And I should see "Sorry, guests are not allowed to post"
And I should see "Only logged in users can post to this forum"
And I click on "Cancel" "button"
And I should see "Reply"
And I click on "Reply" "link"
And I click on "Continue" "button"
And I click on "Log in" "button"
And I should see "Log in"
Scenario: As an enrolled guest I see the option to reply in a blog type forum
@ -134,10 +134,10 @@ Feature: Guest and not logged users could see the option to add new post or repl
And I am on the "Forum" "forum activity" page
Then I should see "Add discussion topic"
And I click on "Add discussion topic" "link"
And I should see "Sorry, guests are not allowed to post"
And I should see "Only logged in users can post to this forum"
And I click on "Cancel" "button"
And I should see "Forum discussion 1"
And I click on "Add discussion topic" "link"
And I should see "Sorry, guests are not allowed to post"
And I click on "Continue" "button"
And I should see "Only logged in users can post to this forum"
And I click on "Log in" "button"
And I should see "Log in"