MDL-46692 forum: fix defaultpreference_trackforums to not depend on forum settings

Existence of admin settings must not depend on other settings,
especially not from other plugins.

In any case somebody should cleaup the preference mess and allow
plugins to setup user preferences instead of hardcoding everything in
core.
This commit is contained in:
Petr Skoda 2014-08-06 09:08:06 +12:00
parent d29fb4ac65
commit d9b60e315e

View File

@ -54,13 +54,11 @@ if ($hassiteconfig
$temp->add(new admin_setting_configselect('defaultpreference_autosubscribe', new lang_string('autosubscribe'),
'', 1, $choices));
if (!empty($CFG->forum_trackreadposts)) {
$choices = array();
$choices['0'] = new lang_string('trackforumsno');
$choices['1'] = new lang_string('trackforumsyes');
$temp->add(new admin_setting_configselect('defaultpreference_trackforums', new lang_string('trackforums'),
'', 0, $choices));
}
$choices = array();
$choices['0'] = new lang_string('trackforumsno');
$choices['1'] = new lang_string('trackforumsyes');
$temp->add(new admin_setting_configselect('defaultpreference_trackforums', new lang_string('trackforums'),
'', 0, $choices));
}
$ADMIN->add('accounts', $temp);