$string['bynameondate'] = 'by $a->name - $a->date';
$string['cannotviewpostyet'] = 'You cannot read other students questions in this discussion yet because you haven\'t posted';
$string['cannotadddiscussion'] = 'Adding discussions to this forum requires group membership.';
-$stirng['cannotdeleteforummudule'] = 'You can not delete the forum module!!';
+$string['cannotadddiscussionall'] = 'Can not add discussions for all participants to this forum.';
$string['cleanreadtime'] = 'Mark old posts as read hour';
$string['configcleanreadtime'] = 'The hour of the day to clean old posts from the \'read\' table.';
$string['configdisplaymode'] = 'The default display mode for discussions if one isn\'t set.';
echo '</div>';
echo '</form>';
echo "</div>\n";
- } else if (!isguestuser() and isloggedin() and $forum->type != 'news' and $groupmode == SEPARATEGROUPS and !groups_is_member($currentgroup)) {
- notify(get_string('cannotadddiscussion', 'forum'));
+
+ } else if (isguestuser() or !isloggedin() or $forum->type == 'news') {
+ // no button and no info
+
+ } else if ($groupmode and has_capability('mod/forum:startdiscussion', $context)) {
+ // inform users why they can not post new discussion
+ if ($currentgroup) {
+ notify(get_string('cannotadddiscussion', 'forum'));
+ } else {
+ notify(get_string('cannotadddiscussionall', 'forum'));
+ }
}
// Get all the recent discussions we're allowed to see