} $backup = new backup_ui($bc); $PAGE->set_title($heading); $PAGE->set_heading($heading); $renderer = $PAGE->get_renderer('core', 'backup'); echo $OUTPUT->header(); // Prepare a progress bar which can display optionally during long-running // operations while setting up the UI. $slowprogress = new core_backup_display_progress_if_slow(get_string('preparingui', 'backup')); $previous = optional_param('previous', false, PARAM_BOOL); if ($backup->get_stage() == backup_ui::STAGE_SCHEMA && !$previous) { // After schema stage, we are probably going to get to the confirmation stage, // The confirmation stage has 2 sets of progress, so this is needed to prevent // it showing 2 progress bars. $twobars = true; $slowprogress->start_progress('', 2); } else { $twobars = false; } $backup->get_controller()->set_progress($slowprogress); $backup->process(); if ($backup->enforce_changed_dependencies()) { debugging('Your settings have been altered due to unmet dependencies', DEBUG_DEVELOPER); } $loghtml = ''; if ($backup->get_stage() == backup_ui::STAGE_FINAL) { // Display an extra backup step bar so that we can show the 'processing' step first. echo html_writer::start_div('', array('id' => 'executionprogress')); echo $renderer->progress_bar($backup->get_progress_bar()); $backup->get_controller()->set_progress(new core_backup_display_progress()); // Prepare logger and add to end of chain.
$courseshortname = $course->shortname; } // Show page header. $PAGE->set_title($courseshortname . ': ' . get_string('restore')); $PAGE->set_heading($coursefullname); $renderer = $PAGE->get_renderer('core','backup'); echo $OUTPUT->header(); // Prepare a progress bar which can display optionally during long-running // operations while setting up the UI. $slowprogress = new core_backup_display_progress_if_slow(get_string('preparingui', 'backup')); // Overall, allow 10 units of progress. $slowprogress->start_progress('', 10); // This progress section counts for loading the restore controller. $slowprogress->start_progress('', 1, 1); // Restore of large courses requires extra memory. Use the amount configured // in admin settings. raise_memory_limit(MEMORY_EXTRA); if ($stage & restore_ui::STAGE_CONFIRM + restore_ui::STAGE_DESTINATION) { $restore = restore_ui::engage_independent_stage($stage, $contextid); } else { $restoreid = optional_param('restore', false, PARAM_ALPHANUM); $rc = restore_ui::load_controller($restoreid); if (!$rc) { $restore = restore_ui::engage_independent_stage($stage/2, $contextid);