From fb7cae3bc30aadb857b2053ab264f14fafd00b2d Mon Sep 17 00:00:00 2001 From: dongsheng Date: Thu, 4 Sep 2008 06:50:44 +0000 Subject: [PATCH] "MDL-13766, donot create boxnet and flickr instances automatically, for local and upload plugin, the instance name should get from lang file" --- lib/db/upgrade.php | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 4f2c4ff3c1..a98a1845fc 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -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; -- 2.39.5