MDL-54729 mod_forum: Deep link highlighting works in IE.

This commit is contained in:
Adrian Greeve
2016-06-07 10:30:18 +01:00
committed by Dan Poltawski
parent df4af29945
commit 09fec72819
+8 -1
View File
@@ -3078,6 +3078,9 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa
// String cache
static $str;
// As we should only have one element with the id of unread we keep track of whether this post is the first
// unread post.
static $firstunread = true;
$modcontext = context_module::instance($cm->id);
@@ -3293,7 +3296,11 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa
$forumpostclass = ' read';
} else {
$forumpostclass = ' unread';
$output .= html_writer::tag('a', '', array('name'=>'unread'));
// If this is the first unread post then give it an anchor and id of unread.
if ($firstunread) {
$output .= html_writer::tag('a', '', array('id' => 'unread'));
$firstunread = false;
}
}
} else {
// ignore trackign status if not tracked or tracked param missing