MDL-55982 mod_forum: Allow discussion view in locked blog
This commit is contained in:
@@ -531,6 +531,7 @@ $string['unsubscribed'] = 'Unsubscribed';
|
||||
$string['unsubscribeshort'] = 'Unsubscribe';
|
||||
$string['usermarksread'] = 'Manual message read marking';
|
||||
$string['viewalldiscussions'] = 'View all discussions';
|
||||
$string['viewthediscussion'] = 'View the discussion';
|
||||
$string['warnafter'] = 'Post threshold for warning';
|
||||
$string['warnafter_help'] = 'Students can be warned as they approach the maximum number of posts allowed in a given period. This setting specifies after how many posts they are warned. Users with the capability mod/forum:postwithoutthrottling are exempt from post limits.';
|
||||
$string['warnformorepost'] = 'Warning! There is more than one discussion in this forum - using the most recent';
|
||||
|
||||
+7
-2
@@ -3449,7 +3449,12 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa
|
||||
$output .= html_writer::tag('div', implode(' | ', $commandhtml), array('class'=>'commands'));
|
||||
|
||||
// Output link to post if required
|
||||
if ($link && forum_user_can_post($forum, $discussion, $USER, $cm, $course, $modcontext)) {
|
||||
if ($link) {
|
||||
if (forum_user_can_post($forum, $discussion, $USER, $cm, $course, $modcontext)) {
|
||||
$langstring = 'discussthistopic';
|
||||
} else {
|
||||
$langstring = 'viewthediscussion';
|
||||
}
|
||||
if ($post->replies == 1) {
|
||||
$replystring = get_string('repliesone', 'forum', $post->replies);
|
||||
} else {
|
||||
@@ -3466,7 +3471,7 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa
|
||||
}
|
||||
|
||||
$output .= html_writer::start_tag('div', array('class'=>'link'));
|
||||
$output .= html_writer::link($discussionlink, get_string('discussthistopic', 'forum'));
|
||||
$output .= html_writer::link($discussionlink, get_string($langstring, 'forum'));
|
||||
$output .= ' ('.$replystring.')';
|
||||
$output .= html_writer::end_tag('div'); // link
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user