X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=blobdiff_plain;f=user%2Feditlib.php;h=9704a789e82ec9909877c4c38e84bb03a2b3ae43;hp=b071e25b644e0708253ab48ce230bded9057df8c;hb=ffa17ad17da6ac3745aa6df4ba24087858de9261;hpb=521ebb76b08c3a151b1a583a5f2d4d99201355e5 diff --git a/user/editlib.php b/user/editlib.php index b071e25b644..9704a789e82 100644 --- a/user/editlib.php +++ b/user/editlib.php @@ -22,6 +22,8 @@ * @package core_user */ +require_once($CFG->dirroot . '/user/lib.php'); + /** * Cancels the requirement for a user to update their email address. * @@ -258,7 +260,8 @@ function useredit_shared_definition(&$mform, $editoroptions, $filemanageroptions // Add the necessary names. foreach (useredit_get_required_name_fields() as $fullname) { - $mform->addElement('text', $fullname, get_string($fullname), 'maxlength="100" size="30"'); + $purpose = user_edit_map_field_purpose($user->id, $fullname); + $mform->addElement('text', $fullname, get_string($fullname), 'maxlength="100" size="30"' . $purpose); if ($stringman->string_exists('missing'.$fullname, 'core')) { $strmissingfield = get_string('missing'.$fullname, 'core'); } else { @@ -271,7 +274,8 @@ function useredit_shared_definition(&$mform, $editoroptions, $filemanageroptions $enabledusernamefields = useredit_get_enabled_name_fields(); // Add the enabled additional name fields. foreach ($enabledusernamefields as $addname) { - $mform->addElement('text', $addname, get_string($addname), 'maxlength="100" size="30"'); + $purpose = user_edit_map_field_purpose($user->id, $addname); + $mform->addElement('text', $addname, get_string($addname), 'maxlength="100" size="30"' . $purpose); $mform->setType($addname, PARAM_NOTAGS); } @@ -282,7 +286,8 @@ function useredit_shared_definition(&$mform, $editoroptions, $filemanageroptions . get_string('emailchangecancel', 'auth') . ''; $mform->addElement('static', 'emailpending', get_string('email'), $notice); } else { - $mform->addElement('text', 'email', get_string('email'), 'maxlength="100" size="30"'); + $purpose = user_edit_map_field_purpose($user->id, 'email'); + $mform->addElement('text', 'email', get_string('email'), 'maxlength="100" size="30"' . $purpose); $mform->addRule('email', $strrequired, 'required', null, 'client'); $mform->setType('email', PARAM_RAW_TRIMMED); } @@ -295,15 +300,20 @@ function useredit_shared_definition(&$mform, $editoroptions, $filemanageroptions $mform->setDefault('maildisplay', core_user::get_property_default('maildisplay')); $mform->addHelpButton('maildisplay', 'emaildisplay'); + $mform->addElement('text', 'moodlenetprofile', get_string('moodlenetprofile', 'user')); + $mform->setType('moodlenetprofile', PARAM_NOTAGS); + $mform->addHelpButton('moodlenetprofile', 'moodlenetprofile', 'user'); + $mform->addElement('text', 'city', get_string('city'), 'maxlength="120" size="21"'); $mform->setType('city', PARAM_TEXT); if (!empty($CFG->defaultcity)) { $mform->setDefault('city', $CFG->defaultcity); } + $purpose = user_edit_map_field_purpose($user->id, 'country'); $choices = get_string_manager()->get_list_of_countries(); $choices = array('' => get_string('selectacountry') . '...') + $choices; - $mform->addElement('select', 'country', get_string('selectacountry'), $choices); + $mform->addElement('select', 'country', get_string('selectacountry'), $choices, $purpose); if (!empty($CFG->country)) { $mform->setDefault('country', core_user::get_property_default('country')); } @@ -319,7 +329,9 @@ function useredit_shared_definition(&$mform, $editoroptions, $filemanageroptions } if ($user->id < 0) { - $mform->addElement('select', 'lang', get_string('preferredlanguage'), get_string_manager()->get_list_of_translations()); + $purpose = user_edit_map_field_purpose($user->id, 'lang'); + $translations = get_string_manager()->get_list_of_translations(); + $mform->addElement('select', 'lang', get_string('preferredlanguage'), $translations, $purpose); $lang = empty($user->lang) ? $CFG->lang : $user->lang; $mform->setDefault('lang', $lang); } @@ -366,7 +378,8 @@ function useredit_shared_definition(&$mform, $editoroptions, $filemanageroptions if (count($disabledusernamefields) > 0) { $mform->addElement('header', 'moodle_additional_names', get_string('additionalnames')); foreach ($disabledusernamefields as $allname) { - $mform->addElement('text', $allname, get_string($allname), 'maxlength="100" size="30"'); + $purpose = user_edit_map_field_purpose($user->id, $allname); + $mform->addElement('text', $allname, get_string($allname), 'maxlength="100" size="30"' . $purpose); $mform->setType($allname, PARAM_NOTAGS); } }