2005-11-05 08:06:36 +00:00
|
|
|
<?php // $Id$
|
|
|
|
// Display all the interfaces for importing data into a specific course
|
2005-01-31 04:26:22 +00:00
|
|
|
|
2005-11-05 08:06:36 +00:00
|
|
|
require_once('../config.php');
|
2005-01-31 04:26:22 +00:00
|
|
|
|
2005-11-05 08:06:36 +00:00
|
|
|
$id = required_param('id', PARAM_INT); // course id to import TO
|
2005-01-31 04:26:22 +00:00
|
|
|
|
2005-11-05 08:06:36 +00:00
|
|
|
if (!$course = get_record('course', 'id', $id)) {
|
2005-01-31 04:26:22 +00:00
|
|
|
error("That's an invalid course id");
|
|
|
|
}
|
|
|
|
|
2006-03-09 16:34:24 +00:00
|
|
|
if (!isteacher($course->id)) {
|
|
|
|
error("You are not allowed to look at this page");
|
|
|
|
}
|
|
|
|
|
2006-04-10 18:13:18 +00:00
|
|
|
/// Always we begin an import, we delete all backup/restore/import session structures
|
|
|
|
if (isset($SESSION->course_header)) {
|
|
|
|
unset ($SESSION->course_header);
|
|
|
|
}
|
|
|
|
if (isset($SESSION->info)) {
|
|
|
|
unset ($SESSION->info);
|
|
|
|
}
|
|
|
|
if (isset($SESSION->backupprefs)) {
|
|
|
|
unset ($SESSION->backupprefs);
|
|
|
|
}
|
|
|
|
if (isset($SESSION->restore)) {
|
|
|
|
unset ($SESSION->restore);
|
|
|
|
}
|
|
|
|
if (isset($SESSION->import_preferences)) {
|
|
|
|
unset ($SESSION->import_preferences);
|
|
|
|
}
|
|
|
|
|
2005-11-05 08:06:36 +00:00
|
|
|
$strimport = get_string('import');
|
2005-11-02 21:09:12 +00:00
|
|
|
|
2005-11-05 08:06:36 +00:00
|
|
|
print_header($course->fullname.': '.$strimport, $course->fullname.': '.$strimport,
|
|
|
|
'<a href="view.php?id='.$course->id.'">'.$course->shortname.'</a> -> '.$strimport);
|
2005-11-02 21:09:12 +00:00
|
|
|
|
2005-11-05 08:06:36 +00:00
|
|
|
$directories = get_list_of_plugins('course/import');
|
2005-10-20 00:19:42 +00:00
|
|
|
|
2005-11-05 08:06:36 +00:00
|
|
|
foreach ($directories as $directory) {
|
|
|
|
echo '<div class="plugin">';
|
2006-03-09 07:41:59 +00:00
|
|
|
include_once($CFG->dirroot.'/course/import/'.$directory.'/mod.php');
|
2005-11-05 08:06:36 +00:00
|
|
|
echo '</div>';
|
2005-01-31 04:26:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
print_footer();
|
2005-06-15 09:39:26 +00:00
|
|
|
?>
|