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
7 $course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST
);
9 $PAGE->set_pagelayout('standard');
10 require_login($course);
12 $context = get_context_instance(CONTEXT_COURSE
, $course->id
);
13 require_capability('moodle/site:viewreports', $context); // basic capability for listing of reports
15 $strreports = get_string('reports');
17 $PAGE->set_url(new moodle_url('/course/report.php', array('id'=>$id)));
18 $PAGE->set_title($course->fullname
.': '.$strreports);
19 $PAGE->set_heading($course->fullname
.': '.$strreports);
20 echo $OUTPUT->header();
22 $reports = get_plugin_list('coursereport');
24 foreach ($reports as $report => $reportdirectory) {
25 $pluginfile = $reportdirectory.'/mod.php';
26 if (file_exists($pluginfile)) {
28 include($pluginfile); // Fragment for listing
29 $html = ob_get_contents();
31 // add div only if plugin accessible
33 echo '<div class="plugin">';
40 echo $OUTPUT->footer();