]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-13766, donot create boxnet and flickr instances automatically, for local and...
authordongsheng <dongsheng>
Thu, 4 Sep 2008 06:50:44 +0000 (06:50 +0000)
committerdongsheng <dongsheng>
Thu, 4 Sep 2008 06:50:44 +0000 (06:50 +0000)
lib/db/upgrade.php

index 4f2c4ff3c184341697c932b76ceafe182090aea4..a98a1845fc34161081cf60d783dfb54d0a61419c 100644 (file)
@@ -764,7 +764,7 @@ function xmldb_main_upgrade($oldversion) {
         }
         if (!$DB->record_exists('repository_instances', array('typeid'=>$typeid))) {
             $instance = new object();
-            $instance->name      = 'Upload instance';
+            $instance->name      = get_string('repositoryname', 'repository_upload');
             $instance->typeid    = $typeid;
             $instance->userid    = 0;
             $instance->contextid = SITEID;
@@ -783,45 +783,7 @@ function xmldb_main_upgrade($oldversion) {
         }
         if (!$DB->record_exists('repository_instances', array('typeid'=>$typeid))) {
             $instance = new object();
-            $instance->name      = 'Local Moodle';
-            $instance->typeid    = $typeid;
-            $instance->userid    = 0;
-            $instance->contextid = SITEID;
-            $instance->timecreated  = time();
-            $instance->timemodified = time();
-            $result = $result && $DB->insert_record('repository_instances', $instance);
-        }
-        $repo->type      = 'boxnet';
-        $repo->visible   = 1;
-        $repo->sortorder = 1;
-        if (!$DB->record_exists('repository', array('type'=>'boxnet'))) {
-            $typeid = $DB->insert_record('repository', $repo);
-        }else{
-            $record = $DB->get_record('repository', array('type'=>'local'));
-            $typeid = $record->id;
-        }
-        if (!$DB->record_exists('repository_instances', array('typeid'=>$typeid))) {
-            $instance = new object();
-            $instance->name      = 'Box.net';
-            $instance->typeid    = $typeid;
-            $instance->userid    = 0;
-            $instance->contextid = SITEID;
-            $instance->timecreated  = time();
-            $instance->timemodified = time();
-            $result = $result && $DB->insert_record('repository_instances', $instance);
-        }
-        $repo->type      = 'flickr';
-        $repo->visible   = 1;
-        $repo->sortorder = 1;
-        if (!$DB->record_exists('repository', array('type'=>'flickr'))) {
-            $typeid = $DB->insert_record('repository', $repo);
-        }else{
-            $record = $DB->get_record('repository', array('type'=>'local'));
-            $typeid = $record->id;
-        }
-        if (!$DB->record_exists('repository_instances', array('typeid'=>$typeid))) {
-            $instance = new object();
-            $instance->name      = 'Flickr!';
+            $instance->name      = get_string('repositoryname', 'repository_local');
             $instance->typeid    = $typeid;
             $instance->userid    = 0;
             $instance->contextid = SITEID;