MDL-35514 mod_forum: Fixed warning message to students in forums with groups
This commit is contained in:
committed by
Eloy Lafuente (stronk7)
parent
d73b1f3e71
commit
ae916b5d6a
+7
-5
@@ -5640,15 +5640,17 @@ function forum_print_latest_discussions($course, $forum, $maxdiscussions=-1, $di
|
||||
echo '</form>';
|
||||
echo "</div>\n";
|
||||
|
||||
} else if (isguestuser() or !isloggedin() or $forum->type == 'news') {
|
||||
} else if (isguestuser() or !isloggedin() or $forum->type == 'news' or
|
||||
$forum->type == 'qanda' and !has_capability('mod/forum:addquestion', $context) or
|
||||
$forum->type != 'qanda' and !has_capability('mod/forum:startdiscussion', $context)) {
|
||||
// no button and no info
|
||||
|
||||
} else if ($groupmode and has_capability('mod/forum:startdiscussion', $context)) {
|
||||
} else if ($groupmode and !has_capability('moodle/site:accessallgroups', $context)) {
|
||||
// inform users why they can not post new discussion
|
||||
if ($currentgroup) {
|
||||
echo $OUTPUT->notification(get_string('cannotadddiscussion', 'forum'));
|
||||
} else {
|
||||
if (!$currentgroup) {
|
||||
echo $OUTPUT->notification(get_string('cannotadddiscussionall', 'forum'));
|
||||
} else if (!groups_is_member($currentgroup)) {
|
||||
echo $OUTPUT->notification(get_string('cannotadddiscussion', 'forum'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user