mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 02:46:40 +02:00
MDL-33756 backup: converters only available in general course backups.
This commit is contained in:
parent
f8dfdb524b
commit
936402278b
3 changed files with 28 additions and 21 deletions
|
@ -70,12 +70,15 @@ class backup_root_task extends backup_task {
|
|||
$filename->set_ui_filename(get_string('filename', 'backup'), 'backup.mbz', array('size'=>50));
|
||||
$this->add_setting($filename);
|
||||
|
||||
//Sample custom settings
|
||||
$converters = convert_helper::available_converters(false);
|
||||
foreach ($converters as $cnv) {
|
||||
$formatcnv = new backup_users_setting($cnv, base_setting::IS_BOOLEAN, false);
|
||||
$formatcnv->set_ui(new backup_setting_ui_checkbox($formatcnv, get_string('backupformat'.$cnv, 'backup')));
|
||||
$this->add_setting($formatcnv);
|
||||
// Present converter settings only in type course and mode general backup operations.
|
||||
$converters = array();
|
||||
if ($this->plan->get_type() == backup::TYPE_1COURSE and $this->plan->get_mode() == backup::MODE_GENERAL) {
|
||||
$converters = convert_helper::available_converters(false);
|
||||
foreach ($converters as $cnv) {
|
||||
$formatcnv = new backup_users_setting($cnv, base_setting::IS_BOOLEAN, false);
|
||||
$formatcnv->set_ui(new backup_setting_ui_checkbox($formatcnv, get_string('backupformat'.$cnv, 'backup')));
|
||||
$this->add_setting($formatcnv);
|
||||
}
|
||||
}
|
||||
|
||||
// Define users setting (keeping it on hand to define dependencies)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue