Permalink
Browse files

MDL-20451 - remove 'show advanced button' and display all options by …

…default.
  • Loading branch information...
1 parent 639ac85 commit c2a2b08fe1041272c348ae9f5464b018918d08d8 @rwijaya rwijaya committed Jun 23, 2010
Showing with 9 additions and 21 deletions.
  1. +5 −6 user/editadvanced_form.php
  2. +4 −15 user/editlib.php
View
@@ -43,8 +43,7 @@ function definition() {
$auth_options[$auth] = get_string('pluginname', "auth_{$auth}");
}
$mform->addElement('select', 'auth', get_string('chooseauthmethod','auth'), $auth_options);
- $mform->addHelpButton('auth', 'chooseauthmethod', 'auth');
- $mform->setAdvanced('auth');
+ $mform->addHelpButton('auth', 'chooseauthmethod', 'auth');
if (!empty($CFG->passwordpolicy)){
$mform->addElement('static', 'passwordpolicyinfo', '', print_password_policy());
@@ -118,9 +117,9 @@ function validation($usernew, $files) {
global $CFG, $DB;
$usernew = (object)$usernew;
- $usernew->username = trim($usernew->username);
-
- $user = $DB->get_record('user', array('id'=>$usernew->id));
+ $usernew->username = trim($usernew->username);
+
+ $user = $DB->get_record('user', array('id'=>$usernew->id));
$err = array();
if (!empty($usernew->newpassword)) {
@@ -138,7 +137,7 @@ function validation($usernew, $files) {
if ($DB->record_exists('user', array('username'=>$usernew->username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
$err['username'] = get_string('usernameexists');
}
- //check allowed characters
+ //check allowed characters
if ($usernew->username !== moodle_strtolower($usernew->username)) {
$err['username'] = get_string('usernamelowercase');
} else {
View
@@ -127,8 +127,7 @@ function useredit_shared_definition(&$mform, $editoroptions = null) {
$choices['0'] = get_string('textformat');
$choices['1'] = get_string('htmlformat');
$mform->addElement('select', 'mailformat', get_string('emailformat'), $choices);
- $mform->setDefault('mailformat', 1);
- $mform->setAdvanced('mailformat');
+ $mform->setDefault('mailformat', 1);
if (!empty($CFG->allowusermailcharset)) {
$choices = array();
@@ -139,8 +138,7 @@ function useredit_shared_definition(&$mform, $editoroptions = null) {
$choices['0'] = get_string('site').' (UTF-8)';
}
$choices = array_merge($choices, $charsets);
- $mform->addElement('select', 'preference_mailcharset', get_string('emailcharset'), $choices);
- $mform->setAdvanced('preference_mailcharset');
+ $mform->addElement('select', 'preference_mailcharset', get_string('emailcharset'), $choices);
}
$choices = array();
@@ -149,22 +147,19 @@ function useredit_shared_definition(&$mform, $editoroptions = null) {
$choices['2'] = get_string('emaildigestsubjects');
$mform->addElement('select', 'maildigest', get_string('emaildigest'), $choices);
$mform->setDefault('maildigest', 0);
- $mform->setAdvanced('maildigest');
$choices = array();
$choices['1'] = get_string('autosubscribeyes');
$choices['0'] = get_string('autosubscribeno');
$mform->addElement('select', 'autosubscribe', get_string('autosubscribe'), $choices);
$mform->setDefault('autosubscribe', 1);
- $mform->setAdvanced('autosubscribe');
if (!empty($CFG->forum_trackreadposts)) {
$choices = array();
$choices['0'] = get_string('trackforumsno');
$choices['1'] = get_string('trackforumsyes');
$mform->addElement('select', 'trackforums', get_string('trackforums'), $choices);
$mform->setDefault('trackforums', 0);
- $mform->setAdvanced('trackforums');
}
/* TODO: reimplement editor preferences
if (!empty($CFG->htmleditor)) {
@@ -173,27 +168,23 @@ function useredit_shared_definition(&$mform, $editoroptions = null) {
$choices['1'] = get_string('htmleditor');
$mform->addElement('select', 'htmleditor', get_string('textediting'), $choices);
$mform->setDefault('htmleditor', 1);
- $mform->setAdvanced('htmleditor');
}
*/
if (empty($CFG->enableajax)) {
$mform->addElement('static', 'ajaxdisabled', get_string('ajaxuse'), get_string('ajaxno'));
- $mform->setAdvanced('ajaxdisabled');
} else {
$choices = array();
$choices['0'] = get_string('ajaxno');
$choices['1'] = get_string('ajaxyes');
$mform->addElement('select', 'ajax', get_string('ajaxuse'), $choices);
$mform->setDefault('ajax', 0);
- $mform->setAdvanced('ajax');
}
$choices = array();
$choices['0'] = get_string('screenreaderno');
$choices['1'] = get_string('screenreaderyes');
$mform->addElement('select', 'screenreader', get_string('screenreaderuse'), $choices);
$mform->setDefault('screenreader', 0);
- $mform->setAdvanced('screenreader');
$mform->addElement('text', 'city', get_string('city'), 'maxlength="20" size="21"');
$mform->setType('city', PARAM_MULTILANG);
@@ -229,8 +220,7 @@ function useredit_shared_definition(&$mform, $editoroptions = null) {
$choices[$key] = $theme->name;
}
}
- $mform->addElement('select', 'theme', get_string('preferredtheme'), $choices);
- $mform->setAdvanced('theme');
+ $mform->addElement('select', 'theme', get_string('preferredtheme'), $choices);
}
$mform->addElement('editor', 'description_editor', get_string('userdescription'), null, $editoroptions);
@@ -260,8 +250,7 @@ function useredit_shared_definition(&$mform, $editoroptions = null) {
}
/// Moodle optional fields
- $mform->addElement('header', 'moodle_optional', get_string('optional', 'form'));
- $mform->setAdvanced('moodle_optional');
+ $mform->addElement('header', 'moodle_optional', get_string('optional', 'form'));
$mform->addElement('text', 'url', get_string('webpage'), 'maxlength="255" size="50"');
$mform->setType('url', PARAM_URL);

0 comments on commit c2a2b08

Please sign in to comment.