mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
Merge branch 'MDL-26319' of git://github.com/nebgor/moodle
This commit is contained in:
commit
fa81a03257
@ -130,19 +130,7 @@ class backup_ui extends base_ui {
|
||||
}
|
||||
return $backupid;
|
||||
}
|
||||
/**
|
||||
* Cancels the current backup and redirects the user back to the relevant place
|
||||
*/
|
||||
public function cancel_backup() {
|
||||
global $PAGE;
|
||||
// Determine the approriate URL to redirect the user to
|
||||
if ($PAGE->context->contextlevel == CONTEXT_MODULE && $PAGE->cm !== null) {
|
||||
$relevanturl = new moodle_url('/mod/'.$PAGE->cm->modname.'/view.php', array('id'=>$PAGE->cm->id));
|
||||
} else {
|
||||
$relevanturl = new moodle_url('/course/view.php', array('id'=>$PAGE->course->id));
|
||||
}
|
||||
redirect($relevanturl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of progress bar items that can be displayed through the backup renderer.
|
||||
* @return array Array of items for the progress bar
|
||||
|
@ -81,7 +81,7 @@ class backup_ui_stage_initial extends backup_ui_stage {
|
||||
$form = $this->initialise_stage_form();
|
||||
|
||||
if ($form->is_cancelled()) {
|
||||
$this->ui->cancel_backup();
|
||||
$this->ui->cancel_process();
|
||||
}
|
||||
|
||||
$data = $form->get_data();
|
||||
@ -180,7 +180,7 @@ class backup_ui_stage_schema extends backup_ui_stage {
|
||||
$form = $this->initialise_stage_form();
|
||||
// Check it wasn't cancelled
|
||||
if ($form->is_cancelled()) {
|
||||
$this->ui->cancel_backup();
|
||||
$this->ui->cancel_process();
|
||||
}
|
||||
|
||||
// Check it has been submit
|
||||
@ -288,7 +288,7 @@ class backup_ui_stage_confirmation extends backup_ui_stage {
|
||||
$form = $this->initialise_stage_form();
|
||||
// Check it hasn't been cancelled
|
||||
if ($form->is_cancelled()) {
|
||||
$this->ui->cancel_backup();
|
||||
$this->ui->cancel_process();
|
||||
}
|
||||
|
||||
$data = $form->get_data();
|
||||
|
@ -226,6 +226,21 @@ abstract class base_ui {
|
||||
public static function load_controller($uniqueid=false) {
|
||||
throw new coding_exception('load_controller() method needs to be overridden in each subclass of base_ui');
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels the current backup/restore and redirects the user back to the relevant place
|
||||
*/
|
||||
public function cancel_process() {
|
||||
global $PAGE;
|
||||
// Determine the appropriate URL to redirect the user to
|
||||
if ($PAGE->context->contextlevel == CONTEXT_MODULE && $PAGE->cm !== null) {
|
||||
$relevanturl = new moodle_url('/mod/'.$PAGE->cm->modname.'/view.php', array('id'=>$PAGE->cm->id));
|
||||
} else {
|
||||
$relevanturl = new moodle_url('/course/view.php', array('id'=>$PAGE->course->id));
|
||||
}
|
||||
redirect($relevanturl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of progress bar items that can be displayed through the backup renderer.
|
||||
* @return array Array of items for the progress bar
|
||||
|
@ -392,7 +392,7 @@ class restore_ui_stage_schema extends restore_ui_stage {
|
||||
$form = $this->initialise_stage_form();
|
||||
// Check it wasn't cancelled
|
||||
if ($form->is_cancelled()) {
|
||||
$this->ui->cancel_backup();
|
||||
$this->ui->cancel_process();
|
||||
}
|
||||
|
||||
// Check it has been submit
|
||||
@ -500,7 +500,7 @@ class restore_ui_stage_review extends restore_ui_stage {
|
||||
$form = $this->initialise_stage_form();
|
||||
// Check it hasn't been cancelled
|
||||
if ($form->is_cancelled()) {
|
||||
$this->ui->cancel_backup();
|
||||
$this->ui->cancel_process();
|
||||
}
|
||||
|
||||
$data = $form->get_data();
|
||||
|
Loading…
x
Reference in New Issue
Block a user