From: stronk7 Date: Tue, 14 Oct 2003 17:26:37 +0000 (+0000) Subject: Take out more notices in restore process. Undefined variables, mainly. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=142a6a46ca19213a651b0587ff44109a8f5576a4;p=moodle.git Take out more notices in restore process. Undefined variables, mainly. --- diff --git a/backup/backup_check.html b/backup/backup_check.html index c286c8ce41..472df23de4 100644 --- a/backup/backup_check.html +++ b/backup/backup_check.html @@ -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 ""; diff --git a/backup/backup_form.html b/backup/backup_form.html index ccbde30791..379b5bf49a 100644 --- a/backup/backup_form.html +++ b/backup/backup_form.html @@ -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 ""; echo "

"; diff --git a/backup/restore_check.html b/backup/restore_check.html index 54989538c4..48c9c5c605 100644 --- a/backup/restore_check.html +++ b/backup/restore_check.html @@ -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); } diff --git a/backup/restore_form.html b/backup/restore_form.html index 5d9efea0a4..e89acc6f6a 100644 --- a/backup/restore_form.html +++ b/backup/restore_form.html @@ -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 ""; - echo "

"; - echo get_string("include")." ". get_string("modulenameplural",$modname).":"; - echo ""; - $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 ""; + echo "

"; + echo get_string("include")." ". get_string("modulenameplural",$modname).":"; + echo ""; + $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 ""; + } + echo ""; } else { - //Module haven't userdata - echo get_string("withoutuserdata"); + //Module isn't restorable + echo ""; echo ""; } - echo ""; } else { //Module isn't restorable echo "";