print_error('unknowformat','', '', $data->format); } require_once($formatclassfile); $format = new $formatclass(); // Do anything before that we need to if (! $format->importpreprocess()) { print_error('preprocesserror', 'lesson'); } // Process the uploaded file if (! $format->importprocess($importfile, $lesson, $pageid)) { print_error('processerror', 'lesson'); } // In case anything needs to be done after if (! $format->importpostprocess()) { print_error('postprocesserror', 'lesson'); } echo "<hr>"; echo $OUTPUT->continue_button('view.php?id='.$PAGE->cm->id); } else { // Print upload form $mform->display(); } echo $OUTPUT->footer();