MDL-67264 core_course: Activity chooser new feature
[moodle.git] / course / report.php
CommitLineData
aa6c1ced 1<?php
3bf7fc74 2 // Display all the interfaces for importing data into a specific course
3
4 require_once('../config.php');
5
6 $id = required_param('id', PARAM_INT); // course id to import TO
74df2951 7 $course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
3bf7fc74 8
080d447d 9 $PAGE->set_pagelayout('standard');
95f04461 10 require_login($course);
a0501fc3 11
9a5e297b 12 $context = context_course::instance($course->id);
a2e4bf7f 13 require_capability('moodle/site:viewreports', $context); // basic capability for listing of reports
17f829a7 14
3bf7fc74 15 $strreports = get_string('reports');
16
080d447d 17 $PAGE->set_url(new moodle_url('/course/report.php', array('id'=>$id)));
0a122046 18 $PAGE->set_title($course->fullname.': '.$strreports);
19 $PAGE->set_heading($course->fullname.': '.$strreports);
20 echo $OUTPUT->header();
3bf7fc74 21
bd3b3bba 22 $reports = core_component::get_plugin_list('coursereport');
3bf7fc74 23
17da2e6f 24 foreach ($reports as $report => $reportdirectory) {
25 $pluginfile = $reportdirectory.'/mod.php';
4379c8e9 26 if (file_exists($pluginfile)) {
95f04461 27 ob_start();
28 include($pluginfile); // Fragment for listing
29 $html = ob_get_contents();
30 ob_end_clean();
31 // add div only if plugin accessible
32 if ($html !== '') {
33 echo '<div class="plugin">';
34 echo $html;
35 echo '</div>';
36 }
4379c8e9 37 }
3bf7fc74 38 }
0be6f678 39
d60c1124 40 echo $OUTPUT->footer();
aa6c1ced 41