";
+ }
+
if (!defined('RESTORE_SILENTLY')) {
//End the main ul
echo "";
@@ -5383,5 +5403,62 @@
return $status;
}
+ //Create, open and write header of the html log file
+ function restore_open_html($restore,$course_header) {
+
+ global $CFG;
+
+ $status = true;
+
+ //Open file for writing
+ //First, we check the "course_id" folder exists and create it as necessary in CFG->dataroot
+ $dest_dir = $CFG->dataroot."/".$restore->course_id;
+ $status = check_dir_exists($dest_dir,true);
+ $file = $dest_dir."/restorelog.html";
+ $restorelog_file = fopen($file,"a");
+ //Write the header in the new logging file
+ fwrite ($restorelog_file," ");
+ fwrite ($restorelog_file,"");
+ fwrite ($restorelog_file,"");
+ fwrite ($restorelog_file,"".$course_header->course_shortname." Restored ");
+ fwrite ($restorelog_file,"
The following changes were made during the Restoration of this Course.
");
+ fwrite ($restorelog_file,"The Course ShortName is now - ".$course_header->course_shortname." The FullName is now - ".$course_header->course_fullname."
");
+ $startdate = addslashes($course_header->course_startdate);
+ $date = usergetdate($startdate);
+ fwrite ($restorelog_file,"The Originating Courses Start Date was " .$date['weekday'].", ".$date['mday']." ".$date['month']." ".$date['year']."");
+ $startdate += $restore->course_startdateoffset;
+ $date = usergetdate($startdate);
+ fwrite ($restorelog_file," This Courses Start Date is now " .$date['weekday'].", ".$date['mday']." ".$date['month']." ".$date['year']."
");
+
+ if ($status) {
+ return $restorelog_file;
+ } else {
+ return false;
+ }
+ }
+ //Create & close footer of the html log file
+ function restore_close_html($restore) {
+
+ global $CFG;
+
+ $status = true;
+
+ //Open file for writing
+ //First, check that "course_id" folder exists
+ $dest_dir = $CFG->dataroot."/".$restore->course_id;
+ $status = check_dir_exists($dest_dir,true);
+ $file = $dest_dir."/restorelog.html";
+ $restorelog_file = fopen($file,"a");
+ //Write the footer to close the logging file
+ fwrite ($restorelog_file," This file was written to directly by each modules restore process.");
+ fwrite ($restorelog_file,"