Skip to content

Commit

Permalink
MDL-43218 navigation: Remove link to blogs when they are disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncoggins authored and marinaglancy committed Dec 11, 2013
1 parent c36a240 commit 24f4bfc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2465,10 +2465,12 @@ public function add_course_essentials($coursenode, stdClass $course) {
$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', 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))) {
$participants->add(get_string('notes','notes'), new moodle_url('/notes/index.php', array('filtertype'=>'course', 'filterselect'=>$course->id)));
Expand Down

0 comments on commit 24f4bfc

Please sign in to comment.