Permalink
Browse files

Merge branch 'MDL-26319_MOODLE_20_STABLE' of git://github.com/nebgor/…

…moodle into MOODLE_20_STABLE
  • Loading branch information...
2 parents 0d66e33 + 52e1849 commit 96506c474a9d7e42f31749476fe99c5e6b097b1b @stronk7 stronk7 committed Apr 10, 2011
@@ -130,19 +130,7 @@ public function execute() {
}
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 @@ public function process(base_moodleform $m = null) {
$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 @@ public function process(base_moodleform $form = null) {
$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 @@ public function process(base_moodleform $form = null) {
$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 @@ public function enforce_changed_dependencies() {
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 @@ public function process(base_moodleform $form = null) {
$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 @@ public function process(base_moodleform $form = null) {
$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();

0 comments on commit 96506c4

Please sign in to comment.