From: stronk7 Date: Wed, 14 May 2003 23:09:34 +0000 (+0000) Subject: Minor changes to support the "restore" option with zip files. Only X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=476fd9c716ca9b1fcac213b2b55322ba73ea7806;p=moodle.git Minor changes to support the "restore" option with zip files. Only showed if the backup utility is installed ($CFG->backup_version exists) and the user is an admin. Sent email to Martin to say him this !! --- diff --git a/files/index.php b/files/index.php index 8e2d800a4b..31cecb1deb 100644 --- a/files/index.php +++ b/files/index.php @@ -494,7 +494,26 @@ html_footer(); break; - + case "restore": + html_header($course, $wdir); + if (!empty($file)) { + echo "

".get_string("youaregoingtorestorefrom")."

"; + print_simple_box_start("center"); + echo $file; + print_simple_box_end(); + echo "
"; + //MODIFY RELATIVE PATH TO restore.php + $restore_path = "../contrib/stronk7/backup/restore.php"; + //END MODIFY + notice_yesno (get_string("areyousuretorestorethis"), + $restore_path."?file=".$id.$wdir."/".$file, + "index.php?id=$id&wdir=$wdir&action=cancel"); + } else { + displaydir($wdir); + } + html_footer(); + break; + case "cancel"; clearfilelist(); @@ -634,6 +653,7 @@ function displaydir ($wdir) { $stredit = get_string("edit"); $strunzip = get_string("unzip"); $strlist = get_string("list"); + $strrestore= get_string("restore"); echo "
"; @@ -716,6 +736,9 @@ function displaydir ($wdir) { } else if ($icon == "zip.gif") { $edittext = "$strunzip "; $edittext .= "$strlist "; + if ($CFG->backup_version && isadmin()) { + $edittext .= "$strrestore "; + } } else { $edittext = ""; }