MDL-30394 Backup: Removed popup, inserted by 27790 during restore in new course
authorRajesh Taneja <rajesh@moodle.org>
Tue, 22 Nov 2011 04:03:26 +0000 (12:03 +0800)
committerRajesh Taneja <rajesh@moodle.org>
Tue, 22 Nov 2011 04:03:26 +0000 (12:03 +0800)
backup/util/ui/renderer.php
backup/util/ui/yui/confirmcancel/confirmcancel.js

index 4ca5414..0845440 100644 (file)
@@ -232,15 +232,9 @@ class core_backup_renderer extends plugin_renderer_base {
             $html .= $this->output->heading(get_string('restoretonewcourse', 'backup'), 2, array('class'=>'header'));
             $html .= $this->backup_detail_input(get_string('restoretonewcourse', 'backup'), 'radio', 'target', backup::TARGET_NEW_COURSE, array('checked'=>'checked'));
             $html .= $this->backup_detail_pair(get_string('selectacategory', 'backup'), $this->render($categories));
-            $html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('continue'), 'class'=>'newcoursecontinue')));
+            $html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('continue'))));
             $html .= html_writer::end_tag('div');
             $html .= html_writer::end_tag('form');
-            $config = new stdClass;
-            $config->title = get_string('confirmnewcoursecontinue', 'backup');
-            $config->question = get_string('confirmnewcoursecontinuequestion', 'backup');
-            $config->yesLabel = get_string('continue');
-            $config->noLabel = get_string('cancel');
-            $PAGE->requires->yui_module('moodle-backup-confirmcancel', 'M.core_backup.watch_newcoursecontinue_buttons', array($config));
         }
 
         if ($wholecourse && !empty($currentcourse)) {
index 05395e4..267b853 100644 (file)
@@ -27,24 +27,4 @@ M.core_backup.watch_cancel_buttons = function(config) {
     });
 }
 
-M.core_backup.watch_newcoursecontinue_buttons = function(config) {
-    Y.all('.newcoursecontinue').each(function(){
-        this._confirmationListener = this._confirmationListener || this.on('click', function(e){
-            // Prevent the default event (sumbit) from firing
-            e.preventDefault();
-            // Create the confirm box
-            var confirm = new M.core.confirm(config);
-            // If the user clicks yes
-            confirm.on('complete-yes', function(e){
-                // Detach the listener for the confirm box so it doesn't fire again.
-                this._confirmationListener.detach();
-                // Simulate the original cancel button click
-                this.simulate('click');
-            }, this);
-            // Show the confirm box
-            confirm.show();
-        }, this);
-    });
-}
-
 }, '@VERSION@', {'requires':['base','node','node-event-simulate','moodle-enrol-notification']});
\ No newline at end of file