MDL-16171 - Allow mdd/xxx/defaults.php to load data into the config_plugins table.

This commit is contained in:
tjhunt 2008-08-22 06:38:54 +00:00
parent f6812a21cf
commit 220a5c8721

View File

@ -685,9 +685,19 @@ function upgrade_activity_modules($return) {
unset($defaults);
include($fullmod .'/defaults.php'); // include here means execute, not library include
if (!empty($defaults)) {
foreach ($defaults as $name => $value) {
if (!isset($CFG->$name)) {
set_config($name, $value);
if (!empty($defaults['_use_config_plugins'])) {
unset($defaults['_use_config_plugins']);
$localcfg = get_config($module->name);
foreach ($defaults as $name => $value) {
if (!isset($localcfg->$name)) {
set_config($name, $value, $module->name);
}
}
} else {
foreach ($defaults as $name => $value) {
if (!isset($CFG->$name)) {
set_config($name, $value);
}
}
}
}