2009-11-04 08:11:02 +00:00
|
|
|
<?php
|
2006-03-09 07:37:40 +00:00
|
|
|
// Display all the interfaces for importing data into a specific course
|
|
|
|
|
|
|
|
require_once('../config.php');
|
|
|
|
|
|
|
|
$id = required_param('id', PARAM_INT); // course id to import TO
|
2013-08-21 13:42:30 +08:00
|
|
|
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
|
2006-03-09 07:37:40 +00:00
|
|
|
|
2010-07-23 03:44:03 +00:00
|
|
|
$PAGE->set_pagelayout('standard');
|
2008-11-27 20:30:14 +00:00
|
|
|
require_login($course);
|
2007-08-13 13:45:14 +00:00
|
|
|
|
2012-07-23 15:59:04 +08:00
|
|
|
$context = context_course::instance($course->id);
|
2008-11-29 14:22:10 +00:00
|
|
|
require_capability('moodle/site:viewreports', $context); // basic capability for listing of reports
|
2006-03-09 16:34:24 +00:00
|
|
|
|
2006-03-09 07:37:40 +00:00
|
|
|
$strreports = get_string('reports');
|
|
|
|
|
2010-07-23 03:44:03 +00:00
|
|
|
$PAGE->set_url(new moodle_url('/course/report.php', array('id'=>$id)));
|
2009-09-03 08:47:24 +00:00
|
|
|
$PAGE->set_title($course->fullname.': '.$strreports);
|
|
|
|
$PAGE->set_heading($course->fullname.': '.$strreports);
|
|
|
|
echo $OUTPUT->header();
|
2006-03-09 07:37:40 +00:00
|
|
|
|
2013-07-16 22:36:11 +02:00
|
|
|
$reports = core_component::get_plugin_list('coursereport');
|
2006-03-09 07:37:40 +00:00
|
|
|
|
2009-06-19 14:25:56 +00:00
|
|
|
foreach ($reports as $report => $reportdirectory) {
|
|
|
|
$pluginfile = $reportdirectory.'/mod.php';
|
2006-03-16 08:49:20 +00:00
|
|
|
if (file_exists($pluginfile)) {
|
2008-11-27 20:30:14 +00:00
|
|
|
ob_start();
|
|
|
|
include($pluginfile); // Fragment for listing
|
|
|
|
$html = ob_get_contents();
|
|
|
|
ob_end_clean();
|
|
|
|
// add div only if plugin accessible
|
|
|
|
if ($html !== '') {
|
|
|
|
echo '<div class="plugin">';
|
|
|
|
echo $html;
|
|
|
|
echo '</div>';
|
|
|
|
}
|
2006-03-16 08:49:20 +00:00
|
|
|
}
|
2006-03-09 07:37:40 +00:00
|
|
|
}
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2009-08-06 14:10:33 +00:00
|
|
|
echo $OUTPUT->footer();
|
2009-11-04 08:11:02 +00:00
|
|
|
|