<?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)
//
//-----------------------------------------------------------
- //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
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));
$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){
//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)) {
//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")) {
//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)) {
<?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)
//
//-----------------------------------------------------------
- //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.
//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) {
//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
$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);
$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);
}