mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
MDL-48338 forum: Missing #unread in discussion post url
When a user user selects the unread messages link from the forum discussion page, the link does not include '#unread' in the url. This patch appends '#unread' to the url by changing the appropriate value in the reference link assigned to $out within the function forum_cm_info_view() of the 'lib.php'file. A similar change is on the forum index.
This commit is contained in:
parent
be521ca625
commit
4e9c2677e5
2 changed files with 3 additions and 3 deletions
|
@ -240,7 +240,7 @@ if ($generalforums) {
|
|||
if (isset($untracked[$forum->id])) {
|
||||
$unreadlink = '-';
|
||||
} else if ($unread = forum_tp_count_forum_unread_posts($cm, $course)) {
|
||||
$unreadlink = '<span class="unread"><a href="view.php?f='.$forum->id.'">'.$unread.'</a>';
|
||||
$unreadlink = '<span class="unread"><a href="view.php?f='.$forum->id.'#unread">'.$unread.'</a>';
|
||||
$icon = $OUTPUT->pix_icon('t/markasread', $strmarkallread);
|
||||
$unreadlink .= '<a title="'.$strmarkallread.'" href="markposts.php?f='.
|
||||
$forum->id.'&mark=read&sesskey=' . sesskey() . '">' . $icon . '</a></span>';
|
||||
|
@ -371,7 +371,7 @@ if ($course->id != SITEID) { // Only real courses have learning forums
|
|||
if (isset($untracked[$forum->id])) {
|
||||
$unreadlink = '-';
|
||||
} else if ($unread = forum_tp_count_forum_unread_posts($cm, $course)) {
|
||||
$unreadlink = '<span class="unread"><a href="view.php?f='.$forum->id.'">'.$unread.'</a>';
|
||||
$unreadlink = '<span class="unread"><a href="view.php?f='.$forum->id.'#unread">'.$unread.'</a>';
|
||||
$icon = $OUTPUT->pix_icon('t/markasread', $strmarkallread);
|
||||
$unreadlink .= '<a title="'.$strmarkallread.'" href="markposts.php?f='.
|
||||
$forum->id.'&mark=read&sesskey=' . sesskey() . '">' . $icon . '</a></span>';
|
||||
|
|
|
@ -7497,7 +7497,7 @@ function forum_cm_info_view(cm_info $cm) {
|
|||
|
||||
if (forum_tp_can_track_forums()) {
|
||||
if ($unread = forum_tp_count_forum_unread_posts($cm, $cm->get_course())) {
|
||||
$out = '<span class="unread"> <a href="' . $cm->url . '">';
|
||||
$out = '<span class="unread"> <a href="' . $cm->url . '#unread">';
|
||||
if ($unread == 1) {
|
||||
$out .= get_string('unreadpostsone', 'forum');
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue