Skip to content
Browse files

MDL-43218 navigation: Remove link to blogs when they are disabled

  • Loading branch information...
1 parent 856be66 commit 139a8556e83d4c3ae6d2e954613df7723661a943 @simoncoggins simoncoggins committed with Sam Hemelryk Dec 5, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/navigationlib.php
View
10 lib/navigationlib.php
@@ -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)));

0 comments on commit 139a855

Please sign in to comment.
Something went wrong with that request. Please try again.