]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19246 restore - cleanup of "restoreto" options. Some more extra uses updated...
authorstronk7 <stronk7>
Fri, 22 May 2009 10:32:34 +0000 (10:32 +0000)
committerstronk7 <stronk7>
Fri, 22 May 2009 10:32:34 +0000 (10:32 +0000)
course/import/activities/index.php
mod/hotpot/restorelib.php

index 12e418889f65f21b0d37e117a8d938b654bc71e4..0b497e4d4bdc8607c6d70166d7abdb1007ffe1e5 100644 (file)
@@ -2,6 +2,7 @@
 
     require_once('../../../config.php');
     require_once('../../lib.php');
+    require_once($CFG->dirroot.'/backup/lib.php');
     require_once($CFG->dirroot.'/backup/restorelib.php');
 
     $id               = required_param('id', PARAM_INT);   // course id to import TO
@@ -42,7 +43,7 @@
         }
         if (!empty($filename) && file_exists($CFG->dataroot.'/'.$filename) && !empty($SESSION->import_preferences)) {
             $restore = backup_to_restore_array($SESSION->import_preferences);
-            $restore->restoreto = 1;
+            $restore->restoreto = RESTORETO_CURRENT_ADDING;
             $restore->course_id = $id;
             $restore->importing = 1; // magic variable so we know that we're importing rather than just restoring.
 
index 4aa1ebe5b909e05ce6cbb9065a387361d37bbcbb..5f3fc394b702a9dde396435e83860a0cb7ae365f 100644 (file)
@@ -49,13 +49,13 @@ function hotpot_restore_mods($mod, $restore) {
     //     backup_unique_code : xxxxxxxxxx
     //     file         : '/full/path/to/backupfile.zip'
     //     mods         : an array of $modinfo's (see below)
-    //     restoreto    : 0=existing course (replace), 1=existing course (append), 2=new course
+    //     restoreto    : See RESTORETO_XXX constants in backup/lib.php
     //     users        : 0=all, 1=course, 2=none
     //     logs         : 0=no, 1=yes
     //     user_files   : 0=no, 1=yes
     //     course_files : 0=no, 1=yes
     //     course_id    : id of course into which data is to be restored
-    //     deleting     : true if 'restoreto'==0, otherwise false
+    //     deleting     : true if 'restoreto'==RESTORETO_NEW_COURSE, otherwise false
     //     original_wwwroot : 'http://your.server.com/moodle'
     // $modinfo is an array
     //    'modname'    : array( 'restore'=> 0=no 1=yes, 'userinfo' => 0=no 1=yes)