mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-29596 use optgroups to highlight enabled auth plugins
This commit is contained in:
parent
ca48fe5f97
commit
c5772ede5b
@ -47,11 +47,17 @@ class user_editadvanced_form extends moodleform {
|
||||
$mform->setType('username', PARAM_RAW);
|
||||
|
||||
$auths = get_plugin_list('auth');
|
||||
$auth_options = array();
|
||||
$enabled = get_string('pluginenabled', 'core_plugin');
|
||||
$disabled = get_string('plugindisabled', 'core_plugin');
|
||||
$auth_options = array($enabled=>array(), $disabled=>array());
|
||||
foreach ($auths as $auth => $unused) {
|
||||
$auth_options[$auth] = get_string('pluginname', "auth_{$auth}");
|
||||
if (is_enabled_auth($auth)) {
|
||||
$auth_options[$enabled][$auth] = get_string('pluginname', "auth_{$auth}");
|
||||
} else {
|
||||
$auth_options[$disabled][$auth] = get_string('pluginname', "auth_{$auth}");
|
||||
}
|
||||
}
|
||||
$mform->addElement('select', 'auth', get_string('chooseauthmethod','auth'), $auth_options);
|
||||
$mform->addElement('selectgroups', 'auth', get_string('chooseauthmethod','auth'), $auth_options);
|
||||
$mform->addHelpButton('auth', 'chooseauthmethod', 'auth');
|
||||
|
||||
$mform->addElement('advcheckbox', 'suspended', get_string('suspended','auth'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user