original_string: public function edit_field_add($mform) {
          $size = $this->field->param1;
          $maxlength = $this->field->param2;
          $fieldtype = ($this->field->param3 == 1 ? 'password' : 'text');
  
          // Create the form field.
          $mform->addElement($fieldtype, $this->inputname, format_string($this->field->name), 'maxlength="'.$maxlength.'" size="'.$size.'" ');
          $mform->setType($this->inputname, PARAM_TEXT);
      }
code: public function edit_field_add($mform) {
          $size = $this->field->param1;
          $maxlength = $this->field->param2;
          $fieldtype = ($this->field->param3 == 1 ? 'password' : 'text');
  
          // Create the form field.
          $mform->addElement($fieldtype, $this->inputname, format_string($this->field->name), 'maxlength="'.$maxlength.'" size="'.$size.'" ');
          $mform->setType($this->inputname, PARAM_TEXT);
      }
code_tokens: public function edit_field_add ( $ mform ) { $ size = $ this -> field -> param1 ; $ maxlength = $ this -> field -> param2 ; $ fieldtype = ( $ this -> field -> param3 == 1 ? 'password' : 'text' ) ; // Create the form field. $ mform -> addElement ( $ fieldtype , $ this -> inputname , format_string ( $ this -> field -> name ) , 'maxlength="' . $ maxlength . '" size="' . $ size . '" ' ) ; $ mform -> setType ( $ this -> inputname , PARAM_TEXT ) ; }
docstring: Add fields for editing a text profile field.
  @param moodleform $mform
docstring_tokens: Add fields for editing a text profile field .