1
0
mirror of https://github.com/moodle/moodle.git synced 2025-03-15 05:00:06 +01:00

MDL-28657 backup: make automated backup filenames site admin-configurable

This commit is contained in:
Charles Fulton 2012-04-20 08:42:55 -07:00
parent ead4f180a0
commit 66150286b5
3 changed files with 4 additions and 1 deletions
admin/settings
backup/util/helper
lang/en

@ -138,6 +138,7 @@ if ($hassiteconfig
400 => '400', 400 => '400',
500 => '500'); 500 => '500');
$temp->add(new admin_setting_configselect('backup/backup_auto_keep', new lang_string('keep'), new lang_string('backupkeephelp'), 1, $keepoptoins)); $temp->add(new admin_setting_configselect('backup/backup_auto_keep', new lang_string('keep'), new lang_string('backupkeephelp'), 1, $keepoptoins));
$temp->add(new admin_setting_configcheckbox('backup/backup_shortname', new lang_string('backup_shortname', 'admin'), new lang_string('backup_shortnamehelp', 'admin'), 0));
$temp->add(new admin_setting_heading('automatedsettings', new lang_string('automatedsettings','backup'), '')); $temp->add(new admin_setting_heading('automatedsettings', new lang_string('automatedsettings','backup'), ''));

@ -356,7 +356,7 @@ abstract class backup_cron_automated_helper {
$dir = null; $dir = null;
} }
if (!empty($dir) && $storage !== 0) { if (!empty($dir) && $storage !== 0) {
$filename = backup_plan_dbops::get_default_backup_filename($format, $type, $course->id, $users, $anonymised, true); $filename = backup_plan_dbops::get_default_backup_filename($format, $type, $course->id, $users, $anonymised, !$config->backup_shortname);
$outcome = $file->copy_content_to($dir.'/'.$filename); $outcome = $file->copy_content_to($dir.'/'.$filename);
if ($outcome && $storage === 1) { if ($outcome && $storage === 1) {
$file->delete(); $file->delete();

@ -67,6 +67,8 @@ $string['availableto'] = 'Available to';
$string['availablelicenses'] = 'Available licences'; $string['availablelicenses'] = 'Available licences';
$string['backgroundcolour'] = 'Transparent colour'; $string['backgroundcolour'] = 'Transparent colour';
$string['backups'] = 'Backups'; $string['backups'] = 'Backups';
$string['backup_shortname'] = 'Use course name in backup filename';
$string['backup_shortnamehelp'] = 'Use the course name as part of the backup filename instead of the course id number.';
$string['badwordsconfig'] = 'Enter your list of bad words separated by commas.'; $string['badwordsconfig'] = 'Enter your list of bad words separated by commas.';
$string['badwordsdefault'] = 'If the custom list is empty, a default list from the language pack will be used.'; $string['badwordsdefault'] = 'If the custom list is empty, a default list from the language pack will be used.';
$string['badwordslist'] = 'Custom bad words list'; $string['badwordslist'] = 'Custom bad words list';