Permalink
Browse files

Fixed bug 1443: In the case of a "Teacher Forum" the "Subscribe every…

…one to this forum" button now only subscribes teachers.
  • Loading branch information...
1 parent 52c4ef8 commit f81be26aeeac9d6b9e50f80e3e31dbaa19c809b3 gustav_delius committed May 23, 2004
Showing with 7 additions and 5 deletions.
  1. +7 −5 mod/forum/subscribers.php
View
@@ -38,11 +38,11 @@
if ($course->category) {
$navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->
- <a href=\"index.php?id=$course->id\">$strforums</a> ->
- <a href=\"view.php?f=$forum->id\">$forum->name</a> -> $strsubscribers";
+ <a href=\"index.php?id=$course->id\">$strforums</a> ->
+ <a href=\"view.php?f=$forum->id\">$forum->name</a> -> $strsubscribers";
} else {
$navigation = "<a href=\"index.php?id=$course->id\">$strforums</a> ->
- <a href=\"view.php?f=$forum->id\">$forum->name</a> -> $strsubscribers";
+ <a href=\"view.php?f=$forum->id\">$forum->name</a> -> $strsubscribers";
}
print_header("$course->shortname: $strsubscribers", "$course->fullname", "$navigation");
@@ -56,7 +56,9 @@
}
if ($subscribe == 'all') {
- if ($currentgroup) {
+ if ($forum->type == 'teacher') {
+ $users = get_course_teachers($course->id);
+ } elseif ($currentgroup) {
$users = get_group_users($currentgroup);
} else {
$users = get_course_users($course->id);
@@ -70,7 +72,7 @@
if ($currentgroup) {
if ($users = get_group_users($currentgroup)) {
foreach ($users as $user) {
- forum_unsubscribe($user->id, $forum->id);
+ forum_unsubscribe($user->id, $forum->id);
}
}
} else {

0 comments on commit f81be26

Please sign in to comment.