]> git.mjollnir.org Git - moodle.git/commitdiff
Now more characters are replaced in the backup filename.
authorstronk7 <stronk7>
Thu, 18 Sep 2003 17:43:52 +0000 (17:43 +0000)
committerstronk7 <stronk7>
Thu, 18 Sep 2003 17:43:52 +0000 (17:43 +0000)
And it's editable in the backup proccess, too.
Bug #763 closed.

backup/backup_check.html

index fdcce87c27a0f3542ac08d2b494c3796d15e98e4..8ac978b1184ebf1fcf853f89824b0d5ff7396d9c 100644 (file)
@@ -83,8 +83,9 @@
     echo get_string("name").":";
     echo "</B></td><td>";
     //Calculate the backup string
-    //Take off spaces in the filename !!
-    $backup_name = str_replace(" ","_",strtolower(get_string("backupfilename")));
+    //Take off some characters in the filename !!
+    $takeoff = array(" ", ":", "/", "\\", "|");
+    $backup_name = str_replace($takeoff,"_",strtolower(get_string("backupfilename")));
     //If non-translated, use "backup"
     if (substr($backup_name,0,1) == "[") {
         $backup_name = "backup";
     if (substr($backup_name_format,0,1) == "[") {
         $backup_name_format = "%%Y%%m%%d-%%H%%M";
     }
-    $backup_name .= str_replace(" ","_","-".strtolower($course->shortname)."-".userdate(time(),$backup_name_format,99,false).".zip");
-    echo $backup_name;
-    //Add as hidden name
-    echo "<input type=\"hidden\" name=\"backup_name\" value=\"".$backup_name."\">";
+    $backup_name .= str_replace($takeoff,"_","-".strtolower($course->shortname)."-".userdate(time(),$backup_name_format,99,false).".zip");
+    //Add as text field
+    echo "<input type=\"text\" name=\"backup_name\" size=\"40\" value=\"".$backup_name."\">";
     echo "</td></tr>";
 
     //Calculate the backup unique code to allow simultaneus backups (to define