mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-69010 tool_moodlenet: Migrate default MoodleNet instance setting
This commit is contained in:
parent
2223261586
commit
e5daf9c7fc
4 changed files with 21 additions and 3 deletions
|
@ -77,5 +77,23 @@ function xmldb_tool_moodlenet_upgrade(int $oldversion) {
|
||||||
upgrade_plugin_savepoint(true, 2020060500, 'tool', 'moodlenet');
|
upgrade_plugin_savepoint(true, 2020060500, 'tool', 'moodlenet');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($oldversion < 2020060500.01) {
|
||||||
|
// Change the domain.
|
||||||
|
$defaultmoodlenet = get_config('tool_moodlenet', 'defaultmoodlenet');
|
||||||
|
|
||||||
|
if ($defaultmoodlenet === 'https://home.moodle.net') {
|
||||||
|
set_config('defaultmoodlenet', 'https://moodle.net', 'tool_moodlenet');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Change the name.
|
||||||
|
$defaultmoodlenetname = get_config('tool_moodlenet', 'defaultmoodlenetname');
|
||||||
|
|
||||||
|
if ($defaultmoodlenetname === 'Moodle HQ MoodleNet') {
|
||||||
|
set_config('defaultmoodlenetname', 'MoodleNet Central', 'tool_moodlenet');
|
||||||
|
}
|
||||||
|
|
||||||
|
upgrade_plugin_savepoint(true, 2020060500.01, 'tool', 'moodlenet');
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ $string['connectandbrowse'] = "Connect to and browse:";
|
||||||
$string['defaultmoodlenet'] = "Default MoodleNet URL";
|
$string['defaultmoodlenet'] = "Default MoodleNet URL";
|
||||||
$string['defaultmoodlenet_desc'] = "The URL to either Moodle HQ's MoodleNet instance, or your preferred instance.";
|
$string['defaultmoodlenet_desc'] = "The URL to either Moodle HQ's MoodleNet instance, or your preferred instance.";
|
||||||
$string['defaultmoodlenetname'] = "MoodleNet instance name";
|
$string['defaultmoodlenetname'] = "MoodleNet instance name";
|
||||||
$string['defaultmoodlenetnamevalue'] = 'MoodleNet Home';
|
$string['defaultmoodlenetnamevalue'] = 'MoodleNet Central';
|
||||||
$string['defaultmoodlenetname_desc'] = 'The name of either Moodle HQ\'s MoodleNet instance or your preferred MoodleNet instance to browse on.';
|
$string['defaultmoodlenetname_desc'] = 'The name of either Moodle HQ\'s MoodleNet instance or your preferred MoodleNet instance to browse on.';
|
||||||
$string['enablemoodlenet'] = 'Enable MoodleNet integration';
|
$string['enablemoodlenet'] = 'Enable MoodleNet integration';
|
||||||
$string['enablemoodlenet_desc'] = 'Enabling the integration allows users with the capability to create and manage activities to
|
$string['enablemoodlenet_desc'] = 'Enabling the integration allows users with the capability to create and manage activities to
|
||||||
|
|
|
@ -41,6 +41,6 @@ if ($hassiteconfig) {
|
||||||
$settings->add($temp);
|
$settings->add($temp);
|
||||||
|
|
||||||
$temp = new admin_setting_configtext('tool_moodlenet/defaultmoodlenet', get_string('defaultmoodlenet', 'tool_moodlenet'),
|
$temp = new admin_setting_configtext('tool_moodlenet/defaultmoodlenet', get_string('defaultmoodlenet', 'tool_moodlenet'),
|
||||||
new lang_string('defaultmoodlenet_desc', 'tool_moodlenet'), 'https://home.moodle.net');
|
new lang_string('defaultmoodlenet_desc', 'tool_moodlenet'), 'https://moodle.net');
|
||||||
$settings->add($temp);
|
$settings->add($temp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,6 @@
|
||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
$plugin->component = 'tool_moodlenet';
|
$plugin->component = 'tool_moodlenet';
|
||||||
$plugin->version = 2020060500;
|
$plugin->version = 2020060500.01;
|
||||||
$plugin->requires = 2020022800.01;
|
$plugin->requires = 2020022800.01;
|
||||||
$plugin->maturity = MATURITY_ALPHA;
|
$plugin->maturity = MATURITY_ALPHA;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue