diff --git a/admin/settings/development.php b/admin/settings/development.php index e1a37cccdb276..ad3174e229994 100644 --- a/admin/settings/development.php +++ b/admin/settings/development.php @@ -14,6 +14,7 @@ $item->set_updatedcallback('reset_text_filters_cache'); $temp->add($item); $temp->add(new admin_setting_configcheckbox('experimentalsplitrestore', get_string('experimentalsplitrestore', 'admin'), get_string('configexperimentalsplitrestore', 'admin'), 0)); + $temp->add(new admin_setting_configcheckbox('enableimsccimport', get_string('enable_cc_import', 'imscc'), get_string('enable_cc_import_description', 'imscc'), 0)); $temp->add(new admin_setting_configcheckbox('enablesafebrowserintegration', get_string('enablesafebrowserintegration', 'admin'), get_string('configenablesafebrowserintegration', 'admin'), 0)); $ADMIN->add('experimental', $temp); diff --git a/backup/restorelib.php b/backup/restorelib.php index 96c084bc27971..772058d6b370a 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -7875,6 +7875,16 @@ function restore_precheck($id,$file,&$errorstr,$noredirect=false) { } } + // If experimental option is enabled (enableimsccimport) + // check for Common Cartridge packages and convert to Moodle format + if ($status && isset($CFG->enableimsccimport) && $CFG->enableimsccimport == 1) { + require_once($CFG->dirroot. '/backup/cc/restore_cc.php'); + if (!defined('RESTORE_SILENTLY')) { + echo "