Permalink
Browse files

Now MIM is restored completely too!!!

It was more complex than I thought!
  • Loading branch information...
stronk7
stronk7 committed Feb 13, 2005
1 parent 9597a4d commit 6d1e4162085c4b1268cb7d7c006fdfb3cc529fa7
Showing with 389 additions and 3 deletions.
  1. +7 −2 backup/restore_check.html
  2. +9 −0 backup/restore_execute.html
  3. +23 −0 backup/restore_form.html
  4. +349 −0 backup/restorelib.php
  5. +1 −1 backup/version.php
@@ -59,8 +59,8 @@
require_variable($restore_user_files);
//restore_course_files
require_variable($restore_course_files);
//restore_course_files
require_variable($restore_course_files);
//restore_messages
require_variable($restore_messages);
//Check we've selected a course
if (!isset($course_id)) {
@@ -86,6 +86,7 @@
$restore->logs=$restore_logs;
$restore->user_files=$restore_user_files;
$restore->course_files=$restore_course_files;
$restore->messages=$restore_messages;
$restore->course_id=$course_id;
} else {
//We have the object, so check if we have a new course_id
@@ -175,6 +176,10 @@
$changed = true;
}
}
//If we have selected user files or messages, then users must be restored too
if ($restore->user_files || $restore->messages) {
$changed = 1;
}
if ($changed) {
echo get_string ("noteuserschangednonetocourse");
echo "<hr noshade size=\"1\">";
@@ -257,6 +257,15 @@
}
}
//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>';
View
@@ -87,6 +87,10 @@
$restore_course_files = 1;
}
if (!isset($restore_messages)) {
$restore_messages = 1;
}
if (!isset($restore_restoreto)) {
if (isteacheredit($id) and !isadmin()) {
$restore_restoreto = 1;
@@ -288,6 +292,25 @@
echo "<input type=\"hidden\" name=\"restore_course_files\" value=\"0\" />";
}
echo "</td></tr>";
//Now print the Messages tr
echo "<tr>";
echo "<td align=\"right\"><b>";
//This tr is slighty different. Everything becomes hidden if
//we haven't messages is the backup, to avoid confusions to users.
//If messages are in the backup file, show menu, else fixed to no and show nothing
if ($info->backup_messages == "true") {
echo get_string ('messages','message').":";
echo "</b></td><td>";
$message_options[0] = get_string("no");
$message_options[1] = get_string("yes");
choose_from_menu($message_options, "restore_messages", $restore_messages, "");
} else {
echo "&nbsp;</b></td><td>";
echo "<input type=\"hidden\" name=\"restore_messages\" value=\"0\" />";
}
echo "</td></tr>";
}
?>
</table>
Oops, something went wrong.

0 comments on commit 6d1e416

Please sign in to comment.