original_string: public function edit_field_add($mform) {
          // Create the form field.
          $checkbox = $mform->addElement('advcheckbox', $this->inputname, format_string($this->field->name));
          if ($this->data == '1') {
              $checkbox->setChecked(true);
          }
          $mform->setType($this->inputname, PARAM_BOOL);
          if ($this->is_required() and !has_capability('moodle/user:update', context_system::instance())) {
              $mform->addRule($this->inputname, get_string('required'), 'nonzero', null, 'client');
          }
      }
code: public function edit_field_add($mform) {
          // Create the form field.
          $checkbox = $mform->addElement('advcheckbox', $this->inputname, format_string($this->field->name));
          if ($this->data == '1') {
              $checkbox->setChecked(true);
          }
          $mform->setType($this->inputname, PARAM_BOOL);
          if ($this->is_required() and !has_capability('moodle/user:update', context_system::instance())) {
              $mform->addRule($this->inputname, get_string('required'), 'nonzero', null, 'client');
          }
      }
code_tokens: public function edit_field_add ( $ mform ) { // Create the form field. $ checkbox = $ mform -> addElement ( 'advcheckbox' , $ this -> inputname , format_string ( $ this -> field -> name ) ) ; if ( $ this -> data == '1' ) { $ checkbox -> setChecked ( true ) ; } $ mform -> setType ( $ this -> inputname , PARAM_BOOL ) ; if ( $ this -> is_required ( ) and ! has_capability ( 'moodle/user:update' , context_system :: instance ( ) ) ) { $ mform -> addRule ( $ this -> inputname , get_string ( 'required' ) , 'nonzero' , null , 'client' ) ; } }
docstring: Add elements for editing the profile field value.
  @param moodleform $mform
docstring_tokens: Add elements for editing the profile field value .