$exist = "exists_".$modname;
$restore_var = "restore_".$modname;
$user_info_var = "restore_user_info_".$modname;
- if ($$exist) {
- //Now check that we have that module info in the backup file
- if ($info->mods[$modname]->backup == "true") {
- //Print the full tr
- echo "<tr>";
- echo "<td align=\"right\"><P><B>";
- echo get_string("include")." ". get_string("modulenameplural",$modname).":";
- echo "</td><td>";
- $restore_options[0] = get_string("no");
- $restore_options[1] = get_string("yes");
- choose_from_menu($restore_options, $restore_var, $$restore_var, "");
- //If backup contains user data, then show menu, else fix it to
- //without user data
- if ($info->mods[$modname]->userinfo == "true") {
- $restore_user_options[0] = get_string("withoutuserdata");
- $restore_user_options[1] = get_string("withuserdata");
- choose_from_menu($restore_user_options, $user_info_var, $$user_info_var, "");
+ if (isset($$exist)) {
+ if ($$exist) {
+ //Now check that we have that module info in the backup file
+ if (isset($info->mods[$modname]) && $info->mods[$modname]->backup == "true") {
+ //Print the full tr
+ echo "<tr>";
+ echo "<td align=\"right\"><P><B>";
+ echo get_string("include")." ". get_string("modulenameplural",$modname).":";
+ echo "</td><td>";
+ $restore_options[0] = get_string("no");
+ $restore_options[1] = get_string("yes");
+ choose_from_menu($restore_options, $restore_var, $$restore_var, "");
+ //If backup contains user data, then show menu, else fix it to
+ //without user data
+ if ($info->mods[$modname]->userinfo == "true") {
+ $restore_user_options[0] = get_string("withoutuserdata");
+ $restore_user_options[1] = get_string("withuserdata");
+ choose_from_menu($restore_user_options, $user_info_var, $$user_info_var, "");
+ } else {
+ //Module haven't userdata
+ echo get_string("withoutuserdata");
+ echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\">";
+ }
+ echo "</td></tr>";
} else {
- //Module haven't userdata
- echo get_string("withoutuserdata");
+ //Module isn't restorable
+ echo "<input type=\"hidden\" name=\"$restore_var\" value=\"0\">";
echo "<input type=\"hidden\" name=\"$user_info_var\" value=\"0\">";
}
- echo "</td></tr>";
} else {
//Module isn't restorable
echo "<input type=\"hidden\" name=\"$restore_var\" value=\"0\">";