Merge branch 'integration_MDL-38997' of github.com:totara/moodle
authorDan Poltawski <dan@moodle.com>
Fri, 12 Apr 2013 01:59:49 +0000 (09:59 +0800)
committerDan Poltawski <dan@moodle.com>
Fri, 12 Apr 2013 01:59:49 +0000 (09:59 +0800)
1  2 
badges/renderer.php
lib/navigationlib.php

Simple merge
@@@ -2444,8 -2438,29 +2444,8 @@@ class global_navigation extends navigat
              $participants = $coursenode->add(get_string('participants'), null, self::TYPE_CONTAINER, get_string('participants'), 'participants');
          }
  
 -        // View course reports
 -        if (has_capability('moodle/site:viewreports', $this->page->context)) { // basic capability for listing of reports
 -            $reportnav = $coursenode->add(get_string('reports'), null, self::TYPE_CONTAINER, null, null, new pix_icon('i/stats', ''));
 -            $coursereports = get_plugin_list('coursereport'); // deprecated
 -            foreach ($coursereports as $report=>$dir) {
 -                $libfile = $CFG->dirroot.'/course/report/'.$report.'/lib.php';
 -                if (file_exists($libfile)) {
 -                    require_once($libfile);
 -                    $reportfunction = $report.'_report_extend_navigation';
 -                    if (function_exists($report.'_report_extend_navigation')) {
 -                        $reportfunction($reportnav, $course, $this->page->context);
 -                    }
 -                }
 -            }
 -
 -            $reports = get_plugin_list_with_function('report', 'extend_navigation_course', 'lib.php');
 -            foreach ($reports as $reportfunction) {
 -                $reportfunction($reportnav, $course, $this->page->context);
 -            }
 -        }
 -
          // Badges.
-         if ($CFG->enablebadges && 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' => 2, 'id' => $course->id));