From a90e92a538b542e3dafece7f0568706e8ec1c56c Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 24 Feb 2008 10:54:21 +0000 Subject: [PATCH] MDL-13565 Tracking forum fixes; merged from MOODLE_19_STABLE --- mod/forum/index.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mod/forum/index.php b/mod/forum/index.php index 85d866de31..7e90b3d1af 100644 --- a/mod/forum/index.php +++ b/mod/forum/index.php @@ -189,7 +189,10 @@ } if ($usetracking) { - if (($forum->trackingtype == FORUM_TRACKING_ON) || !isset($untracked[$forum->id])) { + if ($forum->trackingtype == FORUM_TRACKING_OFF) { + $unreadlink = '-'; + $trackedlink = '-'; + } else if (($forum->trackingtype == FORUM_TRACKING_ON) || !isset($untracked[$forum->id])) { $groupid = ($groupmode==SEPARATEGROUPS && !has_capability('moodle/site:accessallgroups', $context)) ? $currentgroup : false; $unread = forum_tp_count_forum_unread_posts($USER->id, $forum->id, $groupid); if ($unread > 0) { @@ -203,8 +206,7 @@ if ($forum->trackingtype == FORUM_TRACKING_OPTIONAL) { $trackedlink = print_single_button($CFG->wwwroot . '/mod/forum/settracking.php?id=' . $forum->id, '', $stryes, 'post', '_self', true, $strnotrackforum); - } - else { + } else { $trackedlink = $stryes; } } else { @@ -326,7 +328,11 @@ } if ($usetracking) { - if (($forum->trackingtype == FORUM_TRACKING_ON) || + if ($forum->trackingtype == FORUM_TRACKING_OFF) { + $unreadlink = '-'; + $trackedlink = '-'; + + } else if (($forum->trackingtype == FORUM_TRACKING_ON) || !isset($untracked[$forum->id])) { $groupid = ($groupmode==SEPARATEGROUPS && !has_capability('moodle/site:accessallgroups', $context)) @@ -341,6 +347,8 @@ } if ($forum->trackingtype == FORUM_TRACKING_OPTIONAL) { $trackedlink = print_single_button($CFG->wwwroot . '/mod/forum/settracking.php?id=' . $forum->id, '', $stryes, 'post', '_self', true, $strnotrackforum); + } else { + $trackedlink = $stryes; } } else { $unreadlink = '-'; -- 2.39.5