From: moodler Date: Mon, 12 Apr 2004 09:57:14 +0000 (+0000) Subject: Fixed a bad bug where the Recent News block wasn't obeying Groups properly. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=196ca3fe593f501c73ca23598eaf2f92ec8e6cba;p=moodle.git Fixed a bad bug where the Recent News block wasn't obeying Groups properly. --- diff --git a/course/format/social/format.php b/course/format/social/format.php index 787144e962..305eeffc15 100644 --- a/course/format/social/format.php +++ b/course/format/social/format.php @@ -23,7 +23,7 @@ $modicon[]="pixpath/i/group.gif\" height=16 width=16 alt=\"\">"; } else if ($course->groupmode == SEPARATEGROUPS and $course->groupmodeforce) { // Show nothing - } else if ($currentgroup = get_current_group($course->id)) { + } else if ($currentgroup) { $moddata[]="id\">$strgroupmy"; $modicon[]="pixpath/i/group.gif\" height=16 width=16 alt=\"\">"; } @@ -87,7 +87,7 @@ print_heading_block($headertext); echo "\"\"
"; - forum_print_latest_discussions($social->id, 10, "plain", "", false); + forum_print_latest_discussions($social->id, 10, "plain", "", $currentgroup); } else { notify("Could not find or create a social forum here"); diff --git a/course/format/topics/format.php b/course/format/topics/format.php index 634674a55d..7cfbe476f4 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -64,7 +64,7 @@ $modicon[]="pixpath/i/group.gif\" height=16 width=16 alt=\"\">"; } else if ($course->groupmode == SEPARATEGROUPS and $course->groupmodeforce) { // Show nothing - } else if ($currentgroup = get_current_group($course->id)) { + } else if ($currentgroup) { $moddata[]="id\">$strgroupmy"; $modicon[]="pixpath/i/group.gif\" height=16 width=16 alt=\"\">"; } @@ -317,7 +317,7 @@ if (!empty($news)) { print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews"); echo ""; - forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", false); + forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", $currentgroup); echo ""; print_side_block_end(); } diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index d243ec50d6..2d6dd1eda5 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -52,7 +52,7 @@ $modicon[]="pixpath/i/group.gif\" height=16 width=16 alt=\"\">"; } else if ($course->groupmode == SEPARATEGROUPS and $course->groupmodeforce) { // Show nothing - } else if ($currentgroup = get_current_group($course->id)) { + } else if ($currentgroup) { $moddata[]="id\">$strgroupmy"; $modicon[]="pixpath/i/group.gif\" height=16 width=16 alt=\"\">"; } @@ -298,7 +298,7 @@ if (!empty($news)) { print_side_block_start(get_string("latestnews"), 210, "sideblocklatestnews"); echo ""; - forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", false); + forum_print_latest_discussions($news->id, $course->newsitems, "minimal", "", $currentgroup); echo ""; print_side_block_end(); } diff --git a/course/view.php b/course/view.php index bc4b858c73..f9d8501f8f 100644 --- a/course/view.php +++ b/course/view.php @@ -61,6 +61,8 @@ redirect("$CFG->wwwroot/"); } + $currentgroup = get_current_group($course->id); + $strcourse = get_string("course"); $loggedinas = "

".user_login_string($course, $USER)."

";