From: Sam Hemelryk Date: Wed, 11 Dec 2013 02:32:29 +0000 (+1300) Subject: Merge branch 'wip-MDL-43218-master' of git://github.com/marinaglancy/moodle X-Git-Tag: v2.7.0-beta~930 X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=commitdiff_plain;h=445e63ecd8b2b5d052949cb30269bc7ea745967a;hp=939aedfe3073aa8532afa97b4df1d707b9dc74db Merge branch 'wip-MDL-43218-master' of git://github.com/marinaglancy/moodle --- diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 748bddf0eae..f6915be66c0 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -2453,22 +2453,19 @@ class global_navigation extends navigation_node { //Participants if (has_capability('moodle/course:viewparticipants', $this->page->context)) { $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($filtervar => $filterselect)); - $participants->add(get_string('blogscourse','blog'), $blogsurls->out()); + if (!empty($CFG->enableblogs)) { + 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'); + if ($course->id == $SITE->id) { + $blogsurls->param('courseid', 0); + } else if ($currentgroup = groups_get_course_group($course, true)) { + $blogsurls->param('groupid', $currentgroup); + } else { + $blogsurls->param('courseid', $course->id); + } + $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))) { $participants->add(get_string('notes','notes'), new moodle_url('/notes/index.php', array('filtertype'=>'course', 'filterselect'=>$course->id)));