Permalink
Browse files

MDL-36215 navigation: fixed blog URL within courses using groups

  • Loading branch information...
1 parent 19075a2 commit 49f853bfcb745bb5b8f7a9c905cb37d73f18289b Sam Hemelryk committed Feb 18, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/navigationlib.php
View
5 lib/navigationlib.php
@@ -2421,16 +2421,19 @@ public function add_course_essentials($coursenode, stdClass $course) {
$participants = $coursenode->add(get_string('participants'), new moodle_url('/user/index.php?id='.$course->id), self::TYPE_CONTAINER, get_string('participants'), 'participants');
$currentgroup = groups_get_course_group($course, true);
if ($course->id == $SITE->id) {
+ $filtervar = 'courseid';
$filterselect = '';
} else if ($course->id && !$currentgroup) {
+ $filtervar = 'courseid';
$filterselect = $course->id;
} else {
+ $filtervar = 'groupid';
$filterselect = $currentgroup;
}
$filterselect = clean_param($filterselect, PARAM_INT);
if (($CFG->bloglevel == BLOG_GLOBAL_LEVEL or ($CFG->bloglevel == BLOG_SITE_LEVEL and (isloggedin() and !isguestuser())))
and has_capability('moodle/blog:view', context_system::instance())) {
- $blogsurls = new moodle_url('/blog/index.php', array('courseid' => $filterselect));
+ $blogsurls = new moodle_url('/blog/index.php', array($filtervar => $filterselect));
$participants->add(get_string('blogscourse','blog'), $blogsurls->out());
}
if (!empty($CFG->enablenotes) && (has_capability('moodle/notes:manage', $this->page->context) || has_capability('moodle/notes:view', $this->page->context))) {

0 comments on commit 49f853b

Please sign in to comment.