MDL-71889 user: help text for profile field max length/user identity.

This commit is contained in:
Paul Holden 2021-12-21 10:47:27 +00:00
parent a01f1fa71c
commit f69077aa8c
2 changed files with 5 additions and 2 deletions

View File

@ -1010,7 +1010,8 @@ $string['profilefieldispassword'] = 'Is this a password field?';
$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';

View File

@ -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.
@ -48,6 +49,7 @@ class profile_define_text extends profile_define_base {
$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'));