mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
Now more characters are replaced in the backup filename.
And it's editable in the backup proccess, too. Bug #763 closed.
This commit is contained in:
parent
45d525422e
commit
11db6f92a2
@ -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";
|
||||
@ -95,10 +96,9 @@
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user