MDL-13114 tool_uploadcourse: Optimised the import form
[moodle.git] / admin / tool / uploadcourse / index.php
index 7dc0864..152579b 100644 (file)
@@ -28,8 +28,6 @@ require_once($CFG->libdir . '/adminlib.php');
 require_once($CFG->libdir . '/clilib.php');
 require_once($CFG->libdir . '/coursecatlib.php');
 require_once($CFG->libdir . '/csvlib.class.php');
-require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
-require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
 
 admin_externalpage_setup('tooluploadcourse');
 
@@ -89,7 +87,6 @@ if ($form2data = $mform2->is_cancelled()) {
         echo $OUTPUT->heading(get_string('uploadcoursespreview', 'tool_uploadcourse'));
         $processor->preview($previewrows, new tool_uploadcourse_tracker(tool_uploadcourse_tracker::OUTPUT_HTML));
         $mform2->display();
-        echo $OUTPUT->footer();
     } else {
         echo $OUTPUT->heading(get_string('uploadcoursesresult', 'tool_uploadcourse'));
         $processor->execute(new tool_uploadcourse_tracker(tool_uploadcourse_tracker::OUTPUT_HTML));
@@ -99,6 +96,8 @@ if ($form2data = $mform2->is_cancelled()) {
 } else {
     $processor = new tool_uploadcourse_processor($cir, $form1data->options, array());
     echo $OUTPUT->header();
+    echo $OUTPUT->heading(get_string('uploadcoursespreview', 'tool_uploadcourse'));
+    $processor->preview($previewrows, new tool_uploadcourse_tracker(tool_uploadcourse_tracker::OUTPUT_HTML));
     $mform2->display();
 }