Skip to content

Commit

Permalink
MDL-54729 mod_forum: Deep link highlighting works in IE.
Browse files Browse the repository at this point in the history
  • Loading branch information
abgreeve authored and danpoltawski committed Jun 7, 2016
1 parent df4af29 commit 09fec72
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mod/forum/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 09fec72

Please sign in to comment.