mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
Take out more notices in restore process. Undefined variables, mainly.
This commit is contained in:
parent
428ab4b9bf
commit
142a6a46ca
@ -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."\">";
|
||||
|
@ -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>";
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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\">";
|
||||
|
Loading…
x
Reference in New Issue
Block a user