Browse files

MDL-20591 IMS-CC import: Integration committed. Next weeklies will in…

…clude it.
  • Loading branch information...
1 parent 4978b25 commit 9ff9dc4a68fba27e9c11e5273530c067319654f0 @stronk7 stronk7 committed Oct 26, 2009
Showing with 11 additions and 0 deletions.
  1. +1 −0 admin/settings/misc.php
  2. +10 −0 backup/restorelib.php
View
1 admin/settings/misc.php
@@ -16,6 +16,7 @@
$rqsetting->plugin = 'qtype_random';
$temp->add($rqsetting);
$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('misc', $temp);
View
10 backup/restorelib.php
@@ -7658,6 +7658,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 "<li>".get_string('checkingforimscc', 'imscc').'</li>';
+ }
+ $status = cc_convert($CFG->dataroot. DIRECTORY_SEPARATOR .'temp'. DIRECTORY_SEPARATOR . 'backup'. DIRECTORY_SEPARATOR . $backup_unique_code);
+ }
+
//Check for Blackboard backups and convert
if ($status){
require_once("$CFG->dirroot/backup/bb/restore_bb.php");

0 comments on commit 9ff9dc4

Please sign in to comment.