Updated the 19 build version to 20100610
[moodle.git] / course / report.php
blob02c326becda3f21af1ae1407b308df4fe848c5a8
1 <?php // $Id$
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');
19 $navlinks = array();
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)) {
29 ob_start();
30 include($pluginfile); // Fragment for listing
31 $html = ob_get_contents();
32 ob_end_clean();
33 // add div only if plugin accessible
34 if ($html !== '') {
35 echo '<div class="plugin">';
36 echo $html;
37 echo '</div>';
42 print_footer();