Skip to content

Commit

Permalink
MDL-71889 user: help text for profile field max length/user identity.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden committed Jan 19, 2022
1 parent a01f1fa commit f69077a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lang/en/admin.php
Expand Up @@ -1010,7 +1010,8 @@
$string['profilefieldlink'] = 'Link';
$string['profilefieldlink_help'] = 'To transform the text into a link, enter a URL containing $$, where $$ will be replaced with the text. For example, to transform a Twitter ID to a link, enter https://twitter.com/$$.';
$string['profilefieldlinktarget'] = 'Link target';
$string['profilefieldmaxlength'] = 'Maximum length';
$string['profilefieldmaxlength'] = 'Character limit';
$string['profilefieldmaxlength_help'] = 'To use this field in the setting \'Show user identity\', the limit must be 255 characters or less.';
$string['profilefieldrows'] = 'Rows';
$string['profilefields'] = 'User profile fields';
$string['profilefieldsize'] = 'Display size';
Expand Down
4 changes: 3 additions & 1 deletion user/profile/field/text/define.class.php
Expand Up @@ -32,7 +32,8 @@ class profile_define_text extends profile_define_base {

/**
* Add elements for creating/editing a text profile field.
* @param moodleform $form
*
* @param MoodleQuickForm $form
*/
public function define_form_specific($form) {
// Default data.
Expand All @@ -48,6 +49,7 @@ public function define_form_specific($form) {
$form->addElement('text', 'param2', get_string('profilefieldmaxlength', 'admin'), 'size="6"');
$form->setDefault('param2', 2048);
$form->setType('param2', PARAM_INT);
$form->addHelpButton('param2', 'profilefieldmaxlength', 'admin');

// Param 3 for text type detemines if this is a password field or not.
$form->addElement('selectyesno', 'param3', get_string('profilefieldispassword', 'admin'));
Expand Down

0 comments on commit f69077a

Please sign in to comment.