MDL-10838 Applied standard table classes and scopes to tr, th and tds of the grader...
[moodle-pu.git] / course / import.php
blobeef47dc477761ec4e80d40ede798fe06eb303efd
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->id);
14 require_capability('moodle/site:import', get_context_instance(CONTEXT_COURSE, $id));
16 /// Always we begin an import, we delete all backup/restore/import session structures
17 if (isset($SESSION->course_header)) {
18 unset ($SESSION->course_header);
20 if (isset($SESSION->info)) {
21 unset ($SESSION->info);
23 if (isset($SESSION->backupprefs)) {
24 unset ($SESSION->backupprefs);
26 if (isset($SESSION->restore)) {
27 unset ($SESSION->restore);
29 if (isset($SESSION->import_preferences)) {
30 unset ($SESSION->import_preferences);
33 $strimport = get_string('import');
35 print_header($course->fullname.': '.$strimport, $course->fullname.': '.$strimport,
36 '<a href="view.php?id='.$course->id.'">'.$course->shortname.'</a> -> '.$strimport);
38 $directories = get_list_of_plugins('course/import');
40 foreach ($directories as $directory) {
41 echo '<div class="plugin">';
42 include_once($CFG->dirroot.'/course/import/'.$directory.'/mod.php');
43 echo '</div>';
46 print_footer();