Permalink
Browse files

Merge branch 'MDL-39825_master' of https://github.com/totara/openbadges

… into MOODLE_25_STABLE
  • Loading branch information...
2 parents e38c379 + 8b7c33a commit 160e432aee9cb09c076379d486d90bc214f78cb9 @danpoltawski danpoltawski committed Jun 17, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/navigationlib.php
View
@@ -2448,9 +2448,9 @@ public function add_course_essentials($coursenode, stdClass $course) {
}
// Badges.
- if (!empty($CFG->enablebadges) && has_capability('moodle/badges:viewbadges', $this->page->context)) {
- $url = new moodle_url($CFG->wwwroot . '/badges/view.php',
- array('type' => 2, 'id' => $course->id));
+ if (!empty($CFG->enablebadges) && !empty($CFG->badges_allowcoursebadges) &&
+ has_capability('moodle/badges:viewbadges', $this->page->context)) {
+ $url = new moodle_url('/badges/view.php', array('type' => 2, 'id' => $course->id));
$coursenode->add(get_string('coursebadges', 'badges'), null,
navigation_node::TYPE_CONTAINER, null, 'coursebadges');
@@ -2499,7 +2499,7 @@ public function add_front_page_course_essentials(navigation_node $coursenode, st
}
//Badges
- if (!empty($CFG->enablebadges) && !empty($CFG->badges_allowcoursebadges) && has_capability('moodle/badges:viewbadges', $this->page->context)) {
+ if (!empty($CFG->enablebadges) && has_capability('moodle/badges:viewbadges', $this->page->context)) {
$url = new moodle_url($CFG->wwwroot . '/badges/view.php', array('type' => 1));
$coursenode->add(get_string('sitebadges', 'badges'), $url, navigation_node::TYPE_CUSTOM);
}

0 comments on commit 160e432

Please sign in to comment.