Take out more notices in restore process. Undefined variables, mainly.

This commit is contained in:
stronk7 2003-10-14 17:26:37 +00:00
parent 428ab4b9bf
commit 142a6a46ca
4 changed files with 29 additions and 23 deletions

View File

@ -125,7 +125,7 @@
$modbackup = $modname."_backup_mods";
//If exists the lib & function
$var = "exists_".$modname;
if ($$var) {
if (isset($$var) && $$var) {
//Add hidden fields
$var = "backup_".$modname;
echo "<input type=\"hidden\" name=\"".$var."\" value=\"".$$var."\">";

View File

@ -83,7 +83,7 @@
$modbackup = $modname."_backup_mods";
//If exists the lib & function
$var = "exists_".$modname;
if ($$var) {
if (isset($$var) && $$var) {
//Print the full tr
echo "<tr>";
echo "<td align=\"right\"><P><B>";

View File

@ -16,7 +16,7 @@
//If restore session info exists, but we are posting parameters
//manually, this has prioriry
if ($restore and isset($restore_restoreto)) {
if (isset($restore) and isset($restore_restoreto)) {
unset($restore);
}

View File

@ -130,29 +130,35 @@
$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\">";