]> git.mjollnir.org Git - moodle.git/commitdiff
fixed file backup and converted other forgotten "assignments"; merged from MOODLE_16_...
authorskodak <skodak>
Tue, 23 May 2006 18:38:24 +0000 (18:38 +0000)
committerskodak <skodak>
Tue, 23 May 2006 18:38:24 +0000 (18:38 +0000)
mod/data/backuplib.php
mod/data/restorelib.php

index 9d86756d438b862e8f031983ae31bd1189395fb0..280cd09fac3a70918f8765776101b0b3ebea7851 100644 (file)
@@ -1,9 +1,8 @@
 <?php
 
-//This php script contains all the stuff to backup/restore
-    //assignment mods
+//This php script contains all the stuff to backup/restore data mod
 
-    //This is the "graphical" structure of the assignment mod:
+    //This is the "graphical" structure of the data mod:
     //
     //                     data
     //                    (CL,pk->id)
@@ -31,7 +30,7 @@
     //
     //-----------------------------------------------------------
 
-    //Backup assignment files because we've selected to backup user info
+    //Backup data files because we've selected to backup user info
     //and files are user info's level
 
 
@@ -66,7 +65,7 @@ function data_backup_one_mod($bf,$preferences,$data) {
 
 
     fwrite ($bf,start_tag("MOD",3,true));
-    //Print assignment data
+    //Print data data
     fwrite ($bf,full_tag("ID",4,false,$data->id));
     fwrite ($bf,full_tag("MODTYPE",4,false,"data"));
     fwrite ($bf,full_tag("NAME",4,false,$data->name));
@@ -103,14 +102,13 @@ function data_backup_one_mod($bf,$preferences,$data) {
         $status = backup_data_records($bf,$preferences,$data->id);
         $status = backup_data_fields($bf,$preferences,$data->id);
         if ($status) {
-            $status = backup_data_files_instance($bf,$preferences,$assignment->id);    //recursive copy
+            $status = backup_data_files_instance($bf,$preferences,$data->id);    //recursive copy
         }
     }
     fwrite ($bf,end_tag("MOD",3,true));
     return $status;
     
 }
-    //Backup assignment_submissions contents (executed from assignment_backup_mods)
 
 
 function backup_data_fields($bf,$preferences,$dataid){
@@ -252,7 +250,7 @@ function backup_data_files_instance($bf,$preferences,$instanceid) {
         //in temp/backup/$backup_code  dir
     $status = check_and_create_moddata_dir($preferences->backup_unique_code);
     $status = check_dir_exists($CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/moddata/data/",true);
-        //Now copy the assignment dir
+        //Now copy the data dir
     if ($status) {
             //Only if it exists !! Thanks to Daniel Miksik.
         if (is_dir($CFG->dataroot."/".$preferences->backup_course."/".$CFG->moddata."/data/".$instanceid)) {
@@ -309,7 +307,7 @@ function backup_data_files($bf,$preferences) {
         //First we check to moddata exists and create it as necessary
         //in temp/backup/$backup_code  dir
     $status = check_and_create_moddata_dir($preferences->backup_unique_code);
-        //Now copy the assignment dir
+        //Now copy the data dir
     if ($status) {
             //Only if it exists !! Thanks to Daniel Miksik.
         if (is_dir($CFG->dataroot."/".$preferences->backup_course."/".$CFG->moddata."/data")) {
@@ -330,7 +328,7 @@ function backup_data_file_instance($bf,$preferences,$instanceid) {
         //in temp/backup/$backup_code  dir
     $status = check_and_create_moddata_dir($preferences->backup_unique_code);
     $status = check_dir_exists($CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/moddata/data/",true);
-        //Now copy the assignment dir
+        //Now copy the data dir
     if ($status) {
             //Only if it exists !! Thanks to Daniel Miksik.
         if (is_dir($CFG->dataroot."/".$preferences->backup_course."/".$CFG->moddata."/data/".$instanceid)) {
index afe5f5453c73610d475e2fe2845d45df8359f9f0..4251ad04e2c0d9fbfcaf813aabcdb25b66f7e84d 100644 (file)
@@ -1,8 +1,7 @@
 <?php
-//This php script contains all the stuff to backup/restore
-    //assignment mods
+//This php script contains all the stuff to backup/restore data mod
 
-    //This is the "graphical" structure of the assignment mod:
+    //This is the "graphical" structure of the data mod:
     //
     //                     data
     //                    (CL,pk->id)
@@ -30,7 +29,7 @@
     //
     //-----------------------------------------------------------
 
-    //Backup assignment files because we've selected to backup user info
+    //Backup data files because we've selected to backup user info
     //and files are user info's level
 
 $fieldids = array();    //array in the format of $fieldids[$oldid]=$newid. This is needed because of double dependencies of multiple tables.
@@ -82,7 +81,7 @@ function data_restore_mods($mod,$restore) {
 
         //Do some output
         if (!defined('RESTORE_SILENTLY')) {
-            echo "<li>".get_string("modulename","data")." \"".format_string(stripslashes($assignment->name),true)."\"</li>";
+            echo "<li>".get_string("modulename","data")." \"".format_string(stripslashes($database->name),true)."\"</li>";
         }
         
         if ($newid) {
@@ -279,7 +278,7 @@ function data_restore_files ($old_data_id, $new_data_id, $old_field_id, $new_fie
     //Check it exists and create it
     $status = check_dir_exists($moddata_path,true);
 
-    //Now, locate assignment directory
+    //Now, locate data directory
     if ($status) {
         $data_path = $moddata_path."/data";
         //Check it exists and create it
@@ -293,9 +292,9 @@ function data_restore_files ($old_data_id, $new_data_id, $old_field_id, $new_fie
         $todo = check_dir_exists($temp_path);
     }
 
-    //If todo, we create the neccesary dirs in course moddata/assignment
+    //If todo, we create the neccesary dirs in course moddata/data
     if ($status and $todo) {
-        //First this assignment id
+        //First this data id
         $this_data_path = $data_path."/".$new_data_id;
 
         $status = check_dir_exists($this_data_path,true);
@@ -304,7 +303,7 @@ function data_restore_files ($old_data_id, $new_data_id, $old_field_id, $new_fie
         $status = check_dir_exists($this_field_path,true);
         $this_record_path = $this_field_path = $this_field_path."/".$new_record_id;
         $status = check_dir_exists($this_record_path,true);
-        //And now, copy temp_path to user_assignment_path
+        //And now, copy temp_path to user_data_path
         
         $status = @backup_copy_file($temp_path, $this_record_path);
     }