From 77a7b86529212595c79f1167e081fbe95722b0e8 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Fri, 22 May 2009 10:32:34 +0000 Subject: [PATCH] MDL-19246 restore - cleanup of "restoreto" options. Some more extra uses updated. Merged from 19_STABLE --- course/import/activities/index.php | 3 ++- mod/hotpot/restorelib.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/course/import/activities/index.php b/course/import/activities/index.php index 12e418889f..0b497e4d4b 100644 --- a/course/import/activities/index.php +++ b/course/import/activities/index.php @@ -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. diff --git a/mod/hotpot/restorelib.php b/mod/hotpot/restorelib.php index 4aa1ebe5b9..5f3fc394b7 100644 --- a/mod/hotpot/restorelib.php +++ b/mod/hotpot/restorelib.php @@ -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) -- 2.39.5