|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 // Display all the interfaces for importing data into a specific course 00003 00004 require_once('../config.php'); 00005 00006 $id = required_param('id', PARAM_INT); // course id to import TO 00007 $course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST); 00008 00009 $PAGE->set_pagelayout('standard'); 00010 require_login($course); 00011 00012 $context = get_context_instance(CONTEXT_COURSE, $course->id); 00013 require_capability('moodle/site:viewreports', $context); // basic capability for listing of reports 00014 00015 $strreports = get_string('reports'); 00016 00017 $PAGE->set_url(new moodle_url('/course/report.php', array('id'=>$id))); 00018 $PAGE->set_title($course->fullname.': '.$strreports); 00019 $PAGE->set_heading($course->fullname.': '.$strreports); 00020 echo $OUTPUT->header(); 00021 00022 $reports = get_plugin_list('coursereport'); 00023 00024 foreach ($reports as $report => $reportdirectory) { 00025 $pluginfile = $reportdirectory.'/mod.php'; 00026 if (file_exists($pluginfile)) { 00027 ob_start(); 00028 include($pluginfile); // Fragment for listing 00029 $html = ob_get_contents(); 00030 ob_end_clean(); 00031 // add div only if plugin accessible 00032 if ($html !== '') { 00033 echo '<div class="plugin">'; 00034 echo $html; 00035 echo '</div>'; 00036 } 00037 } 00038 } 00039 00040 echo $OUTPUT->footer(); 00041