function certificate_backup_one_mod($bf, $preferences, $certificate) { global $CFG; if (is_numeric($certificate)) { $certificate = get_record('certificate', 'id', $certificate); } $status = true; //Start mod fwrite($bf, start_tag("MOD", 3, true)); //Print certificate data fwrite($bf, full_tag("ID", 4, false, $certificate->id)); fwrite($bf, full_tag("MODTYPE", 4, false, "certificate")); fwrite($bf, full_tag("NAME", 4, false, $certificate->name)); fwrite($bf, full_tag("INTRO", 4, false, $certificate->intro)); fwrite($bf, full_tag("EMAILTEACHERS", 4, false, $certificate->emailteachers)); fwrite($bf, full_tag("EMAILOTHERS", 4, false, $certificate->emailothers)); fwrite($bf, full_tag("SAVECERT", 4, false, $certificate->savecert)); fwrite($bf, full_tag("REPORTCERT", 4, false, $certificate->reportcert)); fwrite($bf, full_tag("DELIVERY", 4, false, $certificate->delivery)); fwrite($bf, full_tag("TYPE", 4, false, $certificate->certificatetype)); fwrite($bf, full_tag("BORDERSTYLE", 4, false, $certificate->borderstyle)); fwrite($bf, full_tag("BORDERCOLOR", 4, false, $certificate->bordercolor)); fwrite($bf, full_tag("PRINTWMARK", 4, false, $certificate->printwmark)); fwrite($bf, full_tag("PRINTDATE", 4, false, $certificate->printdate)); fwrite($bf, full_tag("DATEFMT", 4, false, $certificate->datefmt)); fwrite($bf, full_tag("PRINTOUTCOME", 4, false, $certificate->printoutcome)); fwrite($bf, full_tag("PRINTNUMBER", 4, false, $certificate->printnumber)); fwrite($bf, full_tag("PRINTGRADE", 4, false, $certificate->printgrade)); fwrite($bf, full_tag("GRADEFMT", 4, false, $certificate->gradefmt)); fwrite($bf, full_tag("PRINTHOURS", 4, false, $certificate->printhours)); fwrite($bf, full_tag("SETCERTIFICATION", 4, false, $certificate->setcertification)); fwrite($bf, full_tag("REQUIREDCERTIFICATION", 4, false, $certificate->requiredcertification)); fwrite($bf, full_tag("LOCKGRADE", 4, false, $certificate->lockgrade)); fwrite($bf, full_tag("REQUIREDGRADE", 4, false, $certificate->requiredgrade)); fwrite($bf, full_tag("PRINTTEACHER", 4, false, $certificate->printteacher)); fwrite($bf, full_tag("CUSTOMTEXT", 4, false, $certificate->customtext)); fwrite($bf, full_tag("PRINTSIGNATURE", 4, false, $certificate->printsignature)); fwrite($bf, full_tag("PRINTSEAL", 4, false, $certificate->printseal)); fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $certificate->timemodified)); //if we've selected to backup users info, then execute backup_certificate_issues and //backup_certificate_files_instance if (backup_userdata_selected($preferences, 'certificate', $certificate->id)) { $status = backup_certificate_issues($bf, $preferences, $certificate->id); if ($status) { $status = backup_certificate_file_instance($bf, $preferences, $certificate->id); } } //now backup the linked stuff $status = backup_certificate_linked_modules($bf, $preferences, $certificate->id); //End mod fwrite($bf, end_tag("MOD", 3, true)); return $status; }
function certificate_backup_one_mod($bf, $preferences, $certificate) { global $CFG; if (is_numeric($certificate)) { $certificate = get_record('certificate', 'id', $certificate); } $status = true; //Start mod fwrite($bf, start_tag("MOD", 3, true)); //Print certificate data fwrite($bf, full_tag("MODTYPE", 4, false, "certificate")); fwrite($bf, full_tag("ID", 4, false, $certificate->id)); fwrite($bf, full_tag("COURSE", 4, false, $certificate->course)); fwrite($bf, full_tag("NAME", 4, false, $certificate->name)); fwrite($bf, full_tag("EMAILTEACHERS", 4, false, $certificate->emailteachers)); fwrite($bf, full_tag("SAVECERT", 4, false, $certificate->savecert)); fwrite($bf, full_tag("DELIVERY", 4, false, $certificate->delivery)); fwrite($bf, full_tag("CERTIFICATETYPE", 4, false, $certificate->certificatetype)); fwrite($bf, full_tag("BORDERSTYLE", 4, false, $certificate->borderstyle)); fwrite($bf, full_tag("BORDERCOLOR", 4, false, $certificate->bordercolor)); fwrite($bf, full_tag("PRINTWMARK", 4, false, $certificate->printwmark)); fwrite($bf, full_tag("PRINTDATE", 4, false, $certificate->printdate)); fwrite($bf, full_tag("DATEFMT", 4, false, $certificate->datefmt)); fwrite($bf, full_tag("PRINTNUMBER", 4, false, $certificate->printnumber)); fwrite($bf, full_tag("PRINTGRADE", 4, false, $certificate->printgrade)); fwrite($bf, full_tag("GRADEFMT", 4, false, $certificate->gradefmt)); fwrite($bf, full_tag("PRINTTEACHER", 4, false, $certificate->printteacher)); fwrite($bf, full_tag("PRINTSIGNATURE", 4, false, $certificate->printsignature)); fwrite($bf, full_tag("PRINTSEAL", 4, false, $certificate->printseal)); fwrite($bf, full_tag("GRADECONDITION", 4, false, $certificate->gradecondition)); fwrite($bf, full_tag("PRINTCREDITHOURS", 4, false, $certificate->printcredithours)); fwrite($bf, full_tag("CREDITHOURS", 4, false, $certificate->credithours)); fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $certificate->timemodified)); fwrite($bf, full_tag("UNENROL", 4, false, $certificate->unenrol)); fwrite($bf, full_tag("ACTIVECONDIOTION", 4, false, $certificate->activecondition)); fwrite($bf, full_tag("PRINTGRADESTD", 4, false, $certificate->printgradestd)); //if we've selected to backup users info, then execute backup_certificate_issues and //backup_certificate_files_instance if (backup_userdata_selected($preferences, 'certificate', $certificate->id)) { $status = backup_certificate_issues($bf, $preferences, $certificate->id); if ($status) { $status = backup_certificate_file_instance($bf, $preferences, $certificate->id); } } //End mod fwrite($bf, end_tag("MOD", 3, true)); return $status; }