'theme' => 'standardwhite',
'filter_multilang_converted' => 1));
- // Write default settings unconditionally (i.e. even if a setting is already set, overwrite it)
- // (this should only have any effect during initial install).
- admin_apply_default_settings(NULL, true);
-
// store main version
if (!set_config('version', $version)) {
print_error('cannotupdateversion', 'debug');
}
+ // Write default settings unconditionally (i.e. even if a setting is already set, overwrite it)
+ // (this should only have any effect during initial install).
+ admin_apply_default_settings(NULL, true);
+
notify($strdatabasesuccess, 'notifysuccess');
/// do not show certificates in log ;-)
function get_setting() {
$result = $this->config_read($this->name);
+
if (is_null($result)) {
return NULL;
}
if ($result === '') {
return array();
}
- return explode(',', $result);
+ $enabled = explode(',', $result);
+ $setting = array();
+ foreach ($enabled as $option) {
+ $setting[$option] = 1;
+ }
+ return $setting;
}
function write_setting($data) {
}
$options = array();
$defaults = array();
- foreach($this->choices as $key=>$description) {
- if (in_array($key, $data)) {
+ foreach ($this->choices as $key=>$description) {
+ if (!empty($data[$key])) {
$checked = 'checked="checked"';
} else {
$checked = '';
}
- if (in_array($key,$default)) {
+ if (!empty($default[$key])) {
$defaults[] = $description;
}
foreach ($this->choices as $key=>$unused) {
$value = array_shift($result);
if ($value) {
- $setting[] = $key;
+ $setting[$key] = 1;
}
}
return $setting;
function get_defaultsetting() {
global $CFG;
+
if (empty($CFG->rolesactive)) {
return null;
}
foreach($this->types as $capability) {
if ($caproles = get_roles_with_capability($capability, CAP_ALLOW)) {
foreach ($caproles as $caprole) {
- if (!in_array($caprole->id, $result)) {
- $result[] = $caprole->id;
- }
+ $result[$caprole->id] = 1;
}
}
}
global $CFG;
if (is_null($node)) {
- $node =& admin_get_root();
+ $node =& admin_get_root(true, true);
}
if (is_a($node, 'admin_category')) {