]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20591 IMS-CC import: Integration committed. Next weeklies will include it. Merged...
authorEloy Lafuente <stronk7@moodle.org>
Mon, 26 Oct 2009 09:21:50 +0000 (09:21 +0000)
committerEloy Lafuente <stronk7@moodle.org>
Mon, 26 Oct 2009 09:21:50 +0000 (09:21 +0000)
admin/settings/development.php
backup/restorelib.php

index e1a37cccdb27659f25539e49f993b59f7dc8edd4..ad3174e2299949c203ad62911726537ddc9d45f1 100644 (file)
@@ -14,6 +14,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
     $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);
index 96c084bc27971e52fc2ad700b25716b099416695..772058d6b370a9126071583b381adb8b19f6f9bd 100644 (file)
@@ -7875,6 +7875,16 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
             }
         }
 
+        // 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");