2 // Display all the interfaces for importing data into a specific course
4 require_once('../config.php');
6 $id = required_param('id', PARAM_INT
); // course id to import TO
8 if (!$course = get_record('course', 'id', $id)) {
9 error("That's an invalid course id");
12 require_login($course);
14 $context = get_context_instance(CONTEXT_COURSE
, $course->id
);
15 require_capability('moodle/site:viewreports', $context); // basic capability for listing of reports
17 $strreports = get_string('reports');
20 $navlinks[] = array('name' => $strreports, 'link' => null, 'type' => 'misc');
21 $navigation = build_navigation($navlinks);
22 print_header($course->fullname
.': '.$strreports, $course->fullname
.': '.$strreports, $navigation);
24 $directories = get_list_of_plugins('course/report');
26 foreach ($directories as $directory) {
27 $pluginfile = $CFG->dirroot
.'/course/report/'.$directory.'/mod.php';
28 if (file_exists($pluginfile)) {
30 include($pluginfile); // Fragment for listing
31 $html = ob_get_contents();
33 // add div only if plugin accessible
35 echo '<div class="plugin">';