backup/restore Support for 4 new fields in data module

This commit is contained in:
moodler 2007-08-14 04:21:16 +00:00
parent 7db989230f
commit b6aeb9ba31
2 changed files with 8 additions and 0 deletions

View file

@ -98,6 +98,10 @@ function data_backup_one_mod($bf,$preferences,$data) {
fwrite ($bf,full_tag("APPROVAL",4,false,$data->approval));
fwrite ($bf,full_tag("SCALE",4,false,$data->scale));
fwrite ($bf,full_tag("ASSESSED",4,false,$data->assessed));
fwrite ($bf,full_tag("DEFAULTSORT",4,false,$data->defaultsort));
fwrite ($bf,full_tag("DEFAULTSORTDIR",4,false,$data->defaultsortdir));
fwrite ($bf,full_tag("EDITANY",4,false,$data->editany));
fwrite ($bf,full_tag("NOTIFICATION",4,false,$data->notification));
// if we've selected to backup users info, then call any other functions we need
// including backing up individual files

View file

@ -92,6 +92,10 @@ function data_restore_mods($mod,$restore) {
if (isset($info['MOD']['#']['ASSESSPUBLIC']['0']['#'])) {
$database->assesspublic = backup_todb($info['MOD']['#']['ASSESSPUBLIC']['0']['#']);
}
$database->defaultsort = backup_todb($info['MOD']['#']['DEFAULTSORT']['0']['#']);
$database->defaultsortdir = backup_todb($info['MOD']['#']['DEFAULTSORTDIR']['0']['#']);
$database->editany = backup_todb($info['MOD']['#']['EDITANY']['0']['#']);
$database->notification = backup_todb($info['MOD']['#']['NOTIFICATION']['0']['#']);
$newid = insert_record ('data', $database);