Abstracted a bit of the restore procedure to allow for silent restoring.
Added new function, import_backup_file_silently Changed everything that prints stuff to check for a constant first. Backup_flush checks a different constant, this is so that output can still get flushed to the browser when necessary but not print <li>s everywhere. Please test this!
This commit is contained in:
+114
-2
@@ -497,17 +497,25 @@
|
||||
//This function is used to check that every necessary function to
|
||||
//backup/restore exists in the current php installation. Thanks to
|
||||
//[email protected] by the idea.
|
||||
function backup_required_functions() {
|
||||
function backup_required_functions($justcheck=false) {
|
||||
|
||||
if(!function_exists('utf8_encode')) {
|
||||
error('You need to add XML support to your PHP installation');
|
||||
if (empty($justcheck)) {
|
||||
error('You need to add XML support to your PHP installation');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//This function send n white characters to the browser and flush the
|
||||
//output buffer. Used to avoid browser timeouts and to show the progress.
|
||||
function backup_flush($n=0,$time=false) {
|
||||
if (defined('RESTORE_SILENTLY_NOFLUSH')) {
|
||||
return;
|
||||
}
|
||||
if ($time) {
|
||||
$ti = strftime("%X",time());
|
||||
} else {
|
||||
@@ -543,4 +551,108 @@
|
||||
|
||||
return ($status && $status2);
|
||||
}
|
||||
|
||||
/** this function will restore an entire backup.zip into the specified course
|
||||
* using standard moodle backup/restore functions, but silently.
|
||||
* @param string $pathtofile the absolute path to the backup file.
|
||||
* @param int $destinationcourse the course id to restore to.
|
||||
* @param boolean $emptyfirst whether to delete all coursedata first.
|
||||
* @param boolean $userdata whether to include any userdata that may be in the backup file.
|
||||
*/
|
||||
function import_backup_file_silently($pathtofile,$destinationcourse,$emptyfirst=false,$userdata=false) {
|
||||
global $CFG,$SESSION,$USER; // is there such a thing on cron? I guess so..
|
||||
|
||||
if (empty($USER)) {
|
||||
$USER = get_admin();
|
||||
$USER->admin = 1; // not sure why, but this doesn't get set
|
||||
}
|
||||
|
||||
define('RESTORE_SILENTLY',true); // don't output all the stuff to us.
|
||||
|
||||
$debuginfo = 'import_backup_file_silently: ';
|
||||
$cleanupafter = false;
|
||||
$errorstr = ''; // passed by reference to restore_precheck to get errors from.
|
||||
|
||||
if (!$course = get_record('course','id',$destinationcourse)) {
|
||||
mtrace($debuginfo.'Course with id $destinationcourse was not a valid course!');
|
||||
return false;
|
||||
}
|
||||
|
||||
// first check we have a valid file.
|
||||
if (!file_exists($pathtofile) || !is_readable($pathtofile)) {
|
||||
mtrace($debuginfo.'File '.$pathtofile.' either didn\'t exist or wasn\'t readable');
|
||||
return false;
|
||||
}
|
||||
|
||||
// now make sure it's a zip file
|
||||
require_once($CFG->dirroot.'/lib/filelib.php');
|
||||
$filename = substr($pathtofile,strrpos($pathtofile,'/')+1);
|
||||
$mimetype = mimeinfo("type", $filename);
|
||||
if ($mimetype != 'application/zip') {
|
||||
mtrace($debuginfo.'File '.$pathtofile.' was of wrong mimetype ('.$mimetype.')' );
|
||||
return false;
|
||||
}
|
||||
|
||||
// restore_precheck wants this within dataroot, so lets put it there if it's not already..
|
||||
if (strstr($pathtofile,$CFG->dataroot) === false) {
|
||||
// first try and actually move it..
|
||||
if (!check_dir_exists($CFG->dataroot.'/temp/backup/',true)) {
|
||||
mtrace($debuginfo.'File '.$pathtofile.' outside of dataroot and couldn\'t move it! ');
|
||||
return false;
|
||||
}
|
||||
if (!copy($pathtofile,$CFG->dataroot.'/temp/backup/'.$filename)) {
|
||||
mtrace($debuginfo.'File '.$pathtofile.' outside of dataroot and couldn\'t move it! ');
|
||||
return false;
|
||||
} else {
|
||||
$pathtofile = 'temp/backup/'.$filename;
|
||||
$cleanupafter = true;
|
||||
}
|
||||
} else {
|
||||
// it is within dataroot, so take it off the path for restore_precheck.
|
||||
$pathtofile = substr($pathtofile,strlen($CFG->dataroot.'/'));
|
||||
}
|
||||
|
||||
if (!backup_required_functions()) {
|
||||
mtrace($debuginfo.'Required function check failed (see backup_required_functions)');
|
||||
return false;
|
||||
}
|
||||
|
||||
@ini_set("max_execution_time","3000");
|
||||
raise_memory_limit("128M");
|
||||
|
||||
if (!$backup_unique_code = restore_precheck($destinationcourse,$pathtofile,$errorstr,true)) {
|
||||
mtrace($debuginfo.'Failed restore_precheck (error was '.$errorstr.')');
|
||||
return false;
|
||||
}
|
||||
|
||||
restore_setup_for_check($SESSION->restore,$backup_unique_code);
|
||||
|
||||
// add on some extra stuff we need...
|
||||
$SESSION->restore->restoreto = 1;
|
||||
$SESSION->restore->course_id = $destinationcourse;
|
||||
$SESSION->restore->deleting = $emptyfirst;
|
||||
|
||||
// maybe we need users (defaults to 2 in restore_setup_for_check)
|
||||
if (!empty($userdata)) {
|
||||
$SESSION->restore->users = 1;
|
||||
}
|
||||
|
||||
// we also need modules...
|
||||
if ($allmods = get_records("modules")) {
|
||||
foreach ($allmods as $mod) {
|
||||
$modname = $mod->name;
|
||||
//Now check that we have that module info in the backup file
|
||||
if (isset($SESSION->info->mods[$modname]) && $SESSION->info->mods[$modname]->backup == "true") {
|
||||
$SESSION->restore->mods[$modname]->restore = true;
|
||||
$SESSION->restore->mods[$modname]->userinfo = $userdata;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!restore_execute($SESSION->restore,$SESSION->info,$SESSION->course_header,$errorstr)) {
|
||||
mtrace($debuginfo.'Failed restore_execute (error was '.$errorstr.')');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
+2
-344
@@ -41,350 +41,8 @@
|
||||
if (!$site = get_site()) {
|
||||
error("Site not found!");
|
||||
}
|
||||
|
||||
//Checks for the required files/functions to restore every module
|
||||
//and include them
|
||||
if ($allmods = get_records("modules") ) {
|
||||
foreach ($allmods as $mod) {
|
||||
$modname = $mod->name;
|
||||
$modfile = "$CFG->dirroot/mod/$modname/restorelib.php";
|
||||
//If file exists and we have selected to restore that type of module
|
||||
if ((file_exists($modfile)) and ($restore->mods[$modname]->restore)) {
|
||||
include_once($modfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Start the main table
|
||||
echo "<table cellpadding=\"5\">";
|
||||
echo "<tr><td>";
|
||||
|
||||
//Start the main ul
|
||||
echo "<ul>";
|
||||
|
||||
//Init status
|
||||
$status = true;
|
||||
|
||||
//Localtion of the xml file
|
||||
$xml_file = $CFG->dataroot."/temp/backup/".$restore->backup_unique_code."/moodle.xml";
|
||||
|
||||
//If we've selected to restore into new course
|
||||
//create it (course)
|
||||
//Saving conversion id variables into backup_tables
|
||||
if ($restore->restoreto == 2) {
|
||||
echo "<li>".get_string("creatingnewcourse");
|
||||
$oldidnumber = $course_header->course_idnumber;
|
||||
if (!$status = restore_create_new_course($restore,$course_header)) {
|
||||
notify("Error while creating the new empty course.");
|
||||
}
|
||||
//Print course fullname and shortname and category
|
||||
if ($status) {
|
||||
echo "<ul>";
|
||||
echo "<li>".$course_header->course_fullname." (".$course_header->course_shortname.")".'</li>';
|
||||
echo "<li>".get_string("category").": ".$course_header->category->name.'</li>';
|
||||
if (!empty($oldidnumber)) {
|
||||
echo "<li>".get_string("nomoreidnumber","moodle",$oldidnumber)."</li>";
|
||||
}
|
||||
echo "</ul></li>";
|
||||
//Put the destination course_id
|
||||
$restore->course_id = $course_header->course_id;
|
||||
}
|
||||
} else {
|
||||
$course = get_record("course","id",$restore->course_id);
|
||||
if ($course) {
|
||||
echo "<li>".get_string("usingexistingcourse");
|
||||
echo "<ul>";
|
||||
echo "<li>".get_string("from").": ".$course_header->course_fullname." (".$course_header->course_shortname.")".'</li>';
|
||||
echo "<li>".get_string("to").": ".$course->fullname." (".$course->shortname.")".'</li>';
|
||||
if (($restore->deleting)) {
|
||||
echo "<li>".get_string("deletingexistingcoursedata").'</li>';
|
||||
} else {
|
||||
echo "<li>".get_string("addingdatatoexisting").'</li>';
|
||||
}
|
||||
echo "</ul></li>";
|
||||
//If we have selected to restore deleting, we do it now.
|
||||
if ($restore->deleting) {
|
||||
echo "<li>".get_string("deletingolddata").'</li>';
|
||||
$status = remove_course_contents($restore->course_id,false) and
|
||||
delete_dir_contents($CFG->dataroot."/".$restore->course_id,"backupdata");
|
||||
if ($status) {
|
||||
//Now , this situation is equivalent to the "restore to new course" one (we
|
||||
//have a course record and nothing more), so define it as "to new course"
|
||||
$restore->restoreto = 2;
|
||||
} else {
|
||||
notify("An error occurred while deleting some of the course contents.");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notify("Error opening existing course.");
|
||||
$status = false;
|
||||
}
|
||||
}
|
||||
|
||||
//Now create the course_sections and their associated course_modules
|
||||
if ($status) {
|
||||
//Into new course
|
||||
if ($restore->restoreto == 2) {
|
||||
echo "<li>".get_string("creatingsections").'</li>';
|
||||
if (!$status = restore_create_sections($restore,$xml_file)) {
|
||||
notify("Error creating sections in the existing course.");
|
||||
}
|
||||
//Into existing course
|
||||
} else if ($restore->restoreto == 0 or $restore->restoreto == 1) {
|
||||
echo "<li>".get_string("checkingsections").'</li>';
|
||||
if (!$status = restore_create_sections($restore,$xml_file)) {
|
||||
notify("Error creating sections in the existing course.");
|
||||
}
|
||||
//Error
|
||||
} else {
|
||||
notify("Neither a new course or an existing one was specified.");
|
||||
$status = false;
|
||||
}
|
||||
}
|
||||
|
||||
//Now create users as needed
|
||||
if ($status and ($restore->users == 0 or $restore->users == 1)) {
|
||||
echo "<li>".get_string("creatingusers")."<br />";
|
||||
if (!$status = restore_create_users($restore,$xml_file)) {
|
||||
notify("Could not restore users.");
|
||||
}
|
||||
//Now print info about the work done
|
||||
if ($status) {
|
||||
$recs = get_records_sql("select old_id, new_id from {$CFG->prefix}backup_ids
|
||||
where backup_code = '$restore->backup_unique_code' and
|
||||
table_name = 'user'");
|
||||
//We've records
|
||||
if ($recs) {
|
||||
$new_count = 0;
|
||||
$exists_count = 0;
|
||||
$student_count = 0;
|
||||
$teacher_count = 0;
|
||||
$counter = 0;
|
||||
//Iterate, filling counters
|
||||
foreach ($recs as $rec) {
|
||||
//Get full record, using backup_getids
|
||||
$record = backup_getid($restore->backup_unique_code,"user",$rec->old_id);
|
||||
if (strpos($record->info,"new") !== false) {
|
||||
$new_count++;
|
||||
}
|
||||
if (strpos($record->info,"exists") !== false) {
|
||||
$exists_count++;
|
||||
}
|
||||
if (strpos($record->info,"student") !== false) {
|
||||
$student_count++;
|
||||
} else if (strpos($record->info,"teacher") !== false) {
|
||||
$teacher_count++;
|
||||
}
|
||||
//Do some output
|
||||
$counter++;
|
||||
if ($counter % 10 == 0) {
|
||||
echo ".";
|
||||
if ($counter % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
}
|
||||
//Now print information gathered
|
||||
echo " (".get_string("new").": ".$new_count.", ".get_string("existing").": ".$exists_count.")";
|
||||
echo "<ul>";
|
||||
echo "<li>".get_string("students").": ".$student_count.'</li>';
|
||||
echo "<li>".get_string("teachers").": ".$teacher_count.'</li>';
|
||||
echo "</ul>";
|
||||
} else {
|
||||
notify("No users were found!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Now create metacourse info
|
||||
if ($status and $restore->metacourse) {
|
||||
//Only to new courses!
|
||||
if ($restore->restoreto == 2) {
|
||||
echo "</li><li>".get_string("creatingmetacoursedata");
|
||||
if (!$status = restore_create_metacourse($restore,$xml_file)) {
|
||||
notify("Error creating metacourse in the course.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Now create categories and questions as needed (STEP1)
|
||||
if ($status and ($restore->mods['quiz']->restore)) {
|
||||
echo "</li><li>".get_string("creatingcategoriesandquestions");
|
||||
echo "<ul>";
|
||||
if (!$status = restore_create_questions($restore,$xml_file)) {
|
||||
notify("Could not restore categories and questions!");
|
||||
}
|
||||
echo "</ul></li>";
|
||||
}
|
||||
|
||||
//Now create user_files as needed
|
||||
if ($status and ($restore->user_files)) {
|
||||
echo "<li>".get_string("copyinguserfiles");
|
||||
if (!$status = restore_user_files($restore)) {
|
||||
notify("Could not restore user files!");
|
||||
}
|
||||
//If all is ok (and we have a counter)
|
||||
if ($status and ($status !== true)) {
|
||||
//Inform about user dirs created from backup
|
||||
echo "<ul>";
|
||||
echo "<li>".get_string("userzones").": ".$status;
|
||||
echo "</li></ul>";
|
||||
}
|
||||
}
|
||||
|
||||
//Now create course files as needed
|
||||
if ($status and ($restore->course_files)) {
|
||||
echo "</li><li>".get_string("copyingcoursefiles")."</li>";
|
||||
if (!$status = restore_course_files($restore)) {
|
||||
notify("Could not restore course files!");
|
||||
}
|
||||
//If all is ok (and we have a counter)
|
||||
if ($status and ($status !== true)) {
|
||||
//Inform about user dirs created from backup
|
||||
echo "<ul>";
|
||||
echo "<li>".get_string("filesfolders").": ".$status;
|
||||
echo "</ul>";
|
||||
}
|
||||
}
|
||||
|
||||
//Now create messages as needed
|
||||
if ($status and ($restore->messages)) {
|
||||
echo "<li>".get_string("creatingmessagesinfo");
|
||||
if (!$status = restore_create_messages($restore,$xml_file)) {
|
||||
notify("Could not restore messages!");
|
||||
}
|
||||
echo "</li>";
|
||||
}
|
||||
|
||||
//Now create scales as needed
|
||||
if ($status) {
|
||||
echo "<li>".get_string("creatingscales").'</li>';
|
||||
if (!$status = restore_create_scales($restore,$xml_file)) {
|
||||
notify("Could not restore custom scales!");
|
||||
}
|
||||
}
|
||||
|
||||
//Now create groups as needed
|
||||
if ($status) {
|
||||
echo "<li>".get_string("creatinggroups").'</li>';
|
||||
if (!$status = restore_create_groups($restore,$xml_file)) {
|
||||
notify("Could not restore groups!");
|
||||
}
|
||||
}
|
||||
|
||||
//Now create events as needed
|
||||
if ($status) {
|
||||
echo "<li>".get_string("creatingevents").'</li>';
|
||||
if (!$status = restore_create_events($restore,$xml_file)) {
|
||||
notify("Could not restore course events!");
|
||||
}
|
||||
}
|
||||
|
||||
//Now create course modules as needed
|
||||
if ($status) {
|
||||
echo "<li>".get_string("creatingcoursemodules");
|
||||
if (!$status = restore_create_modules($restore,$xml_file)) {
|
||||
notify("Could not restore modules!");
|
||||
}
|
||||
}
|
||||
|
||||
//Now create gradebook as needed -- AFTER modules!!!
|
||||
if ($status) {
|
||||
echo "<li>".get_string("creatinggradebook");
|
||||
if (!$status = restore_create_gradebook($restore,$xml_file)) {
|
||||
notify("Could not restore gradebook!");
|
||||
}
|
||||
}
|
||||
|
||||
//Bring back the course blocks -- do it AFTER the modules!!!
|
||||
if($status) {
|
||||
//If we are deleting and bringing into a course or making a new course, same situation
|
||||
if($restore->restoreto == 0 || $restore->restoreto == 2) {
|
||||
echo '<li>'.get_string('creatingblocks').'</li>';
|
||||
if (!$status = restore_create_blocks($restore, $info->backup_block_format, $course_header->blockinfo, $xml_file)) {
|
||||
notify('Error while creating the course blocks');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Now create log entries as needed
|
||||
if ($status and ($restore->logs)) {
|
||||
echo "</li><li>".get_string("creatinglogentries");
|
||||
if (!$status = restore_create_logs($restore,$xml_file)) {
|
||||
notify("Could not restore logs!");
|
||||
}
|
||||
}
|
||||
|
||||
//Now, if all is OK, adjust the instance field in course_modules !!
|
||||
if ($status) {
|
||||
echo "</li><li>".get_string("checkinginstances").'</li>';
|
||||
if (!$status = restore_check_instances($restore)) {
|
||||
notify("Could not adjust instances in course_modules!");
|
||||
}
|
||||
}
|
||||
|
||||
//Now, if all is OK, adjust activity events
|
||||
if ($status) {
|
||||
echo "<li>".get_string("refreshingevents").'</li>';
|
||||
if (!$status = restore_refresh_events($restore)) {
|
||||
notify("Could not refresh events for activities!");
|
||||
}
|
||||
}
|
||||
|
||||
//Now, if all is OK, adjust inter-activity links
|
||||
if ($status) {
|
||||
echo "<li>".get_string("decodinginternallinks");
|
||||
if (!$status = restore_decode_content_links($restore)) {
|
||||
notify("Could not refresh events for activities!");
|
||||
}
|
||||
}
|
||||
|
||||
//Now, with backup files prior to version 2005041100,
|
||||
//convert all the wiki texts in the course to markdown
|
||||
if ($status && $restore->backup_version < 2005041100) {
|
||||
echo "<li>".get_string("convertingwikitomarkdown");
|
||||
if (!$status = restore_convert_wiki2markdown($restore)) {
|
||||
notify("Could not convert wiki texts to markdown!");
|
||||
}
|
||||
}
|
||||
|
||||
//Now if all is OK, update:
|
||||
// - course modinfo field
|
||||
// - categories table
|
||||
// - add user as teacher
|
||||
if ($status) {
|
||||
echo "</li><li>".get_string("checkingcourse").'</li>';
|
||||
//modinfo field
|
||||
rebuild_course_cache($restore->course_id);
|
||||
//categories table
|
||||
$course = get_record("course","id",$restore->course_id);
|
||||
fix_course_sortorder();
|
||||
//Make the user a teacher if the course hasn't teachers (bug 2381)
|
||||
if (!isadmin()) {
|
||||
if (!$checktea = get_records('user_teachers','course', $restore->course_id)) {
|
||||
//Add the teacher to the course
|
||||
$status = add_teacher($USER->id, $restore->course_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Cleanup temps (files and db)
|
||||
if ($status) {
|
||||
echo "<li>".get_string("cleaningtempdata").'</li>';
|
||||
if (!$status = clean_temp_data ($restore)) {
|
||||
notify("Could not clean up temporary data from files and database");
|
||||
}
|
||||
}
|
||||
|
||||
//End the main ul
|
||||
echo "</ul>";
|
||||
|
||||
|
||||
//End the main table
|
||||
echo "</td></tr>";
|
||||
echo "</table>";
|
||||
$errorstr = '';
|
||||
$status = restore_execute($restore,$info,$course_header,$errorstr);
|
||||
|
||||
if (!$status) {
|
||||
error ("An error has occurred and the restore could not be completed!");
|
||||
|
||||
@@ -34,7 +34,11 @@
|
||||
error("Site not found!");
|
||||
}
|
||||
|
||||
$status = restore_precheck($id,$file,!empty($SESSION->restore->importing));
|
||||
$errorstr = '';
|
||||
if (!empty($SESSION->restore->importing)) {
|
||||
define('RESTORE_SILENTLY',true);
|
||||
}
|
||||
$status = restore_precheck($id,$file,$errorstr);
|
||||
|
||||
if (!$status) {
|
||||
error("An error occured");
|
||||
|
||||
+747
-92
File diff suppressed because it is too large
Load Diff
@@ -79,7 +79,9 @@
|
||||
$newid = insert_record ("assignment",$assignment);
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","assignment")." \"".format_string(stripslashes($assignment->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","assignment")." \"".format_string(stripslashes($assignment->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
if ($newid) {
|
||||
@@ -154,9 +156,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -319,14 +323,18 @@
|
||||
$assignment->description = addslashes($result);
|
||||
$status = update_record("assignment",$assignment);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -363,9 +371,11 @@
|
||||
//Do some output
|
||||
$i++;
|
||||
if (($i+1) % 1 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -455,7 +465,9 @@
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+20
-10
@@ -52,7 +52,9 @@
|
||||
$newid = insert_record ("chat",$chat);
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","chat")." \"".format_string(stripslashes($chat->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","chat")." \"".format_string(stripslashes($chat->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
if ($newid) {
|
||||
@@ -120,9 +122,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -217,17 +221,21 @@
|
||||
$chat->intro = addslashes($result);
|
||||
$status = update_record("chat",$chat);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,7 +310,9 @@
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+30
-16
@@ -125,7 +125,9 @@
|
||||
}
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","choice")." \"".format_string(stripslashes($choice->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","choice")." \"".format_string(stripslashes($choice->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
} else {
|
||||
@@ -164,9 +166,11 @@ function choice_options_restore_mods($choiceid,$info,$restore) {
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -232,9 +236,11 @@ function choice_options_restore_mods($choiceid,$info,$restore) {
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -338,17 +344,21 @@ function choice_options_restore_mods($choiceid,$info,$restore) {
|
||||
$choice->text = addslashes($result);
|
||||
$status = update_record("choice",$choice);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,9 +393,11 @@ function choice_options_restore_mods($choiceid,$info,$restore) {
|
||||
//Do some output
|
||||
$i++;
|
||||
if (($i+1) % 1 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -474,7 +486,9 @@ function choice_options_restore_mods($choiceid,$info,$restore) {
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+28
-16
@@ -75,7 +75,9 @@
|
||||
$newid = insert_record ("exercise",$exercise);
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","exercise")." \"".format_string(stripslashes($exercise->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","exercise")." \"".format_string(stripslashes($exercise->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
if ($newid) {
|
||||
@@ -126,9 +128,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -174,9 +178,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -233,9 +239,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -305,9 +313,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -360,9 +370,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
|
||||
+52
-28
@@ -92,7 +92,9 @@
|
||||
}
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","forum")." \"".format_string(stripslashes($forum->name),true)."\"";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","forum")." \"".format_string(stripslashes($forum->name),true)."\"";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
if ($newid) {
|
||||
@@ -158,9 +160,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -232,9 +236,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -337,9 +343,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -401,9 +409,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -548,9 +558,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -599,9 +611,11 @@
|
||||
//Do some output
|
||||
$i++;
|
||||
if (($i+1) % 1 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -817,7 +831,9 @@
|
||||
$status = true;
|
||||
break;
|
||||
default:
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1021,14 +1037,18 @@
|
||||
$post->message = addslashes($result);
|
||||
$status = update_record("forum_posts",$post);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1051,14 +1071,18 @@
|
||||
$forum->intro = addslashes($result);
|
||||
$status = update_record("forum",$forum);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
|
||||
+63
-35
@@ -113,7 +113,9 @@
|
||||
$newid = insert_record ("glossary",$glossary);
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","glossary")." \"".format_string(stripslashes($glossary->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","glossary")." \"".format_string(stripslashes($glossary->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
if ($newid) {
|
||||
@@ -188,9 +190,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -255,9 +259,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -306,9 +312,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -344,9 +352,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -388,9 +398,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -440,9 +452,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -599,14 +613,18 @@
|
||||
$entry->definition = addslashes($result);
|
||||
$status = update_record("glossary_entries",$entry);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -629,17 +647,21 @@
|
||||
$glossary->intro = addslashes($result);
|
||||
$status = update_record("glossary",$glossary);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -678,9 +700,11 @@
|
||||
//Do some output
|
||||
$i++;
|
||||
if (($i+1) % 1 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -710,9 +734,11 @@
|
||||
//Do some output
|
||||
$i++;
|
||||
if (($i+1) % 1 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -902,7 +928,9 @@
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+25
-13
@@ -71,7 +71,9 @@ function hotpot_restore_mods($mod, $restore) {
|
||||
$foreign_keys = array('course' => $restore->course_id);
|
||||
$more_restore = '';
|
||||
// print a message after each hotpot is backed up
|
||||
$more_restore .= 'print "<li>".get_string("modulename", "hotpot")." "".$record->name.""</li>";';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
$more_restore .= 'print "<li>".get_string("modulename", "hotpot")." "".$record->name.""</li>";';
|
||||
}
|
||||
$more_restore .= 'backup_flush(300);';
|
||||
if (restore_userdata_selected($restore,'hotpot',$mod->id)) {
|
||||
if (isset($xml["STRING_DATA"]) && isset($xml["QUESTION_DATA"])) {
|
||||
@@ -160,7 +162,9 @@ function hotpot_restore_clickreportids(&$restore, $status) {
|
||||
$status = execute_sql("UPDATE {$CFG->prefix}hotpot_attempts SET clickreportid=$new_clickreportid WHERE id=$id", false);
|
||||
} else {
|
||||
// New clickreport id could not be found
|
||||
print "<ul><li>New clickreportid could not be found: attempt id=$id, clickreportid=$clickreportid</li></ul>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
print "<ul><li>New clickreportid could not be found: attempt id=$id, clickreportid=$clickreportid</li></ul>";
|
||||
}
|
||||
$status = false;
|
||||
}
|
||||
}
|
||||
@@ -193,7 +197,9 @@ function hotpot_restore_details(&$restore, $status, &$xml, &$record) {
|
||||
if (insert_record('hotpot_details', $details)) {
|
||||
$status = true;
|
||||
} else {
|
||||
print "<ul><li>Details record could not be updated: attempt=$record->attempt</li></ul>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
print "<ul><li>Details record could not be updated: attempt=$record->attempt</li></ul>";
|
||||
}
|
||||
$status = false;
|
||||
}
|
||||
}
|
||||
@@ -291,14 +297,16 @@ function hotpot_restore_record(&$restore, $status, &$xml, $table, $foreign_keys,
|
||||
$new_ids[] = $key_record->new_id;
|
||||
} else {
|
||||
// foreign key could not be updated
|
||||
print "<ul><li><b>Warning:</b><br>Foreign key could not be updated:<br>";
|
||||
print "'$key_table' record (old id=$old_id) is missing from backup data<br>";
|
||||
print "'$table' record ";
|
||||
if (isset($record->id)) {
|
||||
print "(old id=$record->id) ";
|
||||
}
|
||||
print "was not restored</li></ul>";
|
||||
$ok = false;
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
print "<ul><li><b>Warning:</b><br>Foreign key could not be updated:<br>";
|
||||
print "'$key_table' record (old id=$old_id) is missing from backup data<br>";
|
||||
print "'$table' record ";
|
||||
if (isset($record->id)) {
|
||||
print "(old id=$record->id) ";
|
||||
}
|
||||
print "was not restored</li></ul>";
|
||||
}
|
||||
$ok = false;
|
||||
}
|
||||
}
|
||||
$record->$key = implode(',', $new_ids);
|
||||
@@ -333,7 +341,9 @@ function hotpot_restore_record(&$restore, $status, &$xml, $table, $foreign_keys,
|
||||
}
|
||||
} else {
|
||||
// failed to add (or find) $record
|
||||
print "<ul><li>Record could not be added: table=$table</li></ul>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
print "<ul><li>Record could not be added: table=$table</li></ul>";
|
||||
}
|
||||
$status = false;
|
||||
}
|
||||
// restore related records, if required
|
||||
@@ -398,7 +408,9 @@ function hotpot_restore_logs($restore, $log) {
|
||||
break;
|
||||
default:
|
||||
// Oops, unknown $log->action
|
||||
print "<p>action (".$log->module."-".$log->action.") unknown. Not restored</p>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
print "<p>action (".$log->module."-".$log->action.") unknown. Not restored</p>";
|
||||
}
|
||||
break;
|
||||
} // end switch
|
||||
return $status ? $log : false;
|
||||
|
||||
+21
-11
@@ -59,7 +59,9 @@
|
||||
$newid = insert_record ("journal",$journal);
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","journal")." \"".format_string(stripslashes($journal->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","journal")." \"".format_string(stripslashes($journal->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
if ($newid) {
|
||||
@@ -132,9 +134,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -181,9 +185,11 @@
|
||||
//Do some output
|
||||
$i++;
|
||||
if (($i+1) % 1 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -211,9 +217,11 @@
|
||||
//Do some output
|
||||
$i++;
|
||||
if (($i+1) % 1 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -309,7 +317,9 @@
|
||||
$status = true;
|
||||
break;
|
||||
default:
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,9 @@
|
||||
$newid = insert_record ("label",$label);
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","label")." \"".format_string(stripslashes($label->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","label")." \"".format_string(stripslashes($label->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
if ($newid) {
|
||||
@@ -80,14 +82,18 @@
|
||||
$label->content = addslashes($result);
|
||||
$status = update_record("label", $label);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -127,7 +133,9 @@
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+54
-30
@@ -90,7 +90,9 @@
|
||||
$newid = insert_record("lesson", $lesson);
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","lesson")." \"".format_string(stripslashes($lesson->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","lesson")." \"".format_string(stripslashes($lesson->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
if ($newid) {
|
||||
@@ -172,9 +174,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br>";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -300,9 +304,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br>";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -366,9 +372,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br>";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -417,9 +425,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br>";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -474,9 +484,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br>";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -522,9 +534,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br>";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -575,9 +589,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br>";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -642,9 +658,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br>";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -748,14 +766,18 @@
|
||||
$page->contents = addslashes($result);
|
||||
$status = update_record("lesson_pages",$page);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -833,7 +855,9 @@
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br>"; //Debug
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br>"; //Debug
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -339,7 +339,7 @@
|
||||
|
||||
echo '<br />';
|
||||
print_simple_box_start('center');
|
||||
require('questiontypes/'.$QUIZ_QTYPES[$qtype]->name().'/editquestion.php');
|
||||
require_once('questiontypes/'.$QUIZ_QTYPES[$qtype]->name().'/editquestion.php');
|
||||
print_simple_box_end();
|
||||
|
||||
if ($usehtmleditor) {
|
||||
|
||||
+124
-70
@@ -146,10 +146,14 @@
|
||||
|
||||
//Do some output
|
||||
if ($newid) {
|
||||
echo "<li>".get_string('category', 'quiz')." \"".$quiz_cat->name."\"<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string('category', 'quiz')." \"".$quiz_cat->name."\"<br />";
|
||||
}
|
||||
} else {
|
||||
//We must never arrive here !!
|
||||
echo "<li>".get_string('category', 'quiz')." \"".$quiz_cat->name."\" Error!<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string('category', 'quiz')." \"".$quiz_cat->name."\" Error!<br />";
|
||||
}
|
||||
$status = false;
|
||||
}
|
||||
backup_flush(300);
|
||||
@@ -164,7 +168,9 @@
|
||||
} else {
|
||||
$status = false;
|
||||
}
|
||||
echo '</li>';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
return $status;
|
||||
@@ -315,9 +321,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 2 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 40 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 40 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -356,9 +364,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -416,9 +426,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -483,9 +495,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -536,9 +550,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -600,9 +616,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -648,9 +666,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -724,9 +744,11 @@
|
||||
"answertext",$match_sub->answertext);
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -779,9 +801,11 @@
|
||||
"positionkey",$multianswer->positionkey);
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -824,9 +848,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -871,9 +897,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -924,9 +952,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1001,9 +1031,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1056,9 +1088,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1324,7 +1358,9 @@
|
||||
$newid = insert_record ("quiz",$quiz);
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","quiz")." \"".format_string(stripslashes($quiz->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","quiz")." \"".format_string(stripslashes($quiz->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
if ($newid) {
|
||||
@@ -1390,9 +1426,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1461,9 +1499,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1534,9 +1574,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1772,9 +1814,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1919,9 +1963,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -2025,17 +2071,21 @@
|
||||
$quiz->intro = addslashes($result);
|
||||
$status = update_record("quiz",$quiz);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2069,9 +2119,11 @@
|
||||
//Do some output
|
||||
$i++;
|
||||
if (($i+1) % 1 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -2199,7 +2251,9 @@
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+106
-60
@@ -132,10 +132,14 @@
|
||||
|
||||
//Do some output
|
||||
if ($newid) {
|
||||
echo "<li>".get_string('category', 'quiz')." \"".$quiz_cat->name."\"<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string('category', 'quiz')." \"".$quiz_cat->name."\"<br />";
|
||||
}
|
||||
} else {
|
||||
//We must never arrive here !!
|
||||
echo "<li>".get_string('category', 'quiz')." \"".$quiz_cat->name."\" Error!<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
//We must never arrive here !!
|
||||
echo "<li>".get_string('category', 'quiz')." \"".$quiz_cat->name."\" Error!<br />";
|
||||
}
|
||||
$status = false;
|
||||
}
|
||||
backup_flush(300);
|
||||
@@ -150,7 +154,9 @@
|
||||
} else {
|
||||
$status = false;
|
||||
}
|
||||
echo '</li>';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
return $status;
|
||||
@@ -247,9 +253,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 2 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 40 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 40 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -350,9 +358,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -411,9 +421,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -481,9 +493,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -534,9 +548,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -601,9 +617,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -649,9 +667,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -725,9 +745,11 @@
|
||||
"answertext",$match_sub->answertext);
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -770,9 +792,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -828,9 +852,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -888,9 +914,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -983,9 +1011,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1262,7 +1292,9 @@
|
||||
$newid = insert_record ("quiz",$quiz);
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","quiz")." \"".format_string(stripslashes($quiz->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","quiz")." \"".format_string(stripslashes($quiz->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
if ($newid) {
|
||||
@@ -1328,9 +1360,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1399,9 +1433,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1470,9 +1506,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1718,9 +1756,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1775,9 +1815,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1821,9 +1863,11 @@
|
||||
//Do some output
|
||||
$i++;
|
||||
if (($i+1) % 1 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -1951,7 +1995,9 @@
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+20
-10
@@ -82,7 +82,9 @@
|
||||
$newid = insert_record ("resource",$resource);
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","resource")." \"".format_string(stripslashes($resource->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","resource")." \"".format_string(stripslashes($resource->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
if ($newid) {
|
||||
@@ -196,15 +198,19 @@
|
||||
$resource->summary = addslashes($result2);
|
||||
$status = update_record("resource",$resource);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content1).'<br />changed to<br />'.htmlentities($result1).'<hr /><br />';
|
||||
echo '<br /><hr />'.htmlentities($content2).'<br />changed to<br />'.htmlentities($result2).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content1).'<br />changed to<br />'.htmlentities($result1).'<hr /><br />';
|
||||
echo '<br /><hr />'.htmlentities($content2).'<br />changed to<br />'.htmlentities($result2).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -241,9 +247,11 @@
|
||||
//Do some output
|
||||
$i++;
|
||||
if (($i+1) % 1 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -300,7 +308,9 @@
|
||||
$status = true;
|
||||
break;
|
||||
default:
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+21
-11
@@ -113,7 +113,9 @@
|
||||
//The structure is equal to the db, so insert the scorm
|
||||
$newid = insert_record ("scorm",$scorm);
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","scorm")." \"".format_string(stripslashes($scorm->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","scorm")." \"".format_string(stripslashes($scorm->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
if ($newid) {
|
||||
@@ -248,9 +250,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -327,9 +331,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -477,14 +483,18 @@
|
||||
$scorm->summary = addslashes($result);
|
||||
$status = update_record("scorm",$scorm);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
|
||||
+25
-13
@@ -53,7 +53,9 @@
|
||||
$newid = insert_record ("survey",$survey);
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","survey")." \"".format_string(stripslashes($survey->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","survey")." \"".format_string(stripslashes($survey->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
if ($newid) {
|
||||
@@ -119,9 +121,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -175,9 +179,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -281,17 +287,21 @@
|
||||
$survey->intro = addslashes($result);
|
||||
$status = update_record("survey",$survey);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,7 +400,9 @@
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+30
-16
@@ -59,7 +59,9 @@
|
||||
$newid = insert_record ("wiki",$wiki);
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","wiki")." \"".format_string(stripslashes($wiki->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","wiki")." \"".format_string(stripslashes($wiki->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
if ($newid) {
|
||||
@@ -125,9 +127,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -192,9 +196,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -350,14 +356,18 @@
|
||||
$page->content = addslashes($result);
|
||||
$status = update_record("wiki_pages",$page);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -380,17 +390,21 @@
|
||||
$wiki->summary = addslashes($result);
|
||||
$status = update_record("wiki",$wiki);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+56
-32
@@ -138,9 +138,11 @@
|
||||
$newid = insert_record ("workshop",$workshop);
|
||||
|
||||
//Do some output
|
||||
echo "<li>".get_string("modulename","workshop")." \"".format_string(stripslashes($workshop->name),true)."\"</li>";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "<li>".get_string("modulename","workshop")." \"".format_string(stripslashes($workshop->name),true)."\"</li>";
|
||||
}
|
||||
backup_flush(300);
|
||||
|
||||
|
||||
if ($newid) {
|
||||
//We have the newid, update backup_ids
|
||||
backup_putid($restore->backup_unique_code,$mod->modtype,
|
||||
@@ -194,9 +196,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -244,9 +248,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 10 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 200 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -288,9 +294,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -348,9 +356,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -422,9 +432,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -491,9 +503,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -537,9 +551,11 @@
|
||||
|
||||
//Do some output
|
||||
if (($i+1) % 50 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 1000 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -633,9 +649,11 @@
|
||||
//Do some output
|
||||
$i++;
|
||||
if (($i+1) % 1 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 20 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
@@ -733,17 +751,21 @@
|
||||
$workshop->description = addslashes($result);
|
||||
$status = update_record("workshop",$workshop);
|
||||
if ($CFG->debug>7) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo '<br /><hr />'.htmlentities($content).'<br />changed to<br />'.htmlentities($result).'<hr /><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Do some output
|
||||
if (($i+1) % 5 == 0) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo ".";
|
||||
if (($i+1) % 100 == 0) {
|
||||
echo "<br />";
|
||||
}
|
||||
}
|
||||
backup_flush(300);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -928,7 +950,9 @@
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
if (!defined('RESTORE_SILENTLY')) {
|
||||
echo "action (".$log->module."-".$log->action.") unknow. Not restored<br />"; //Debug
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user