original_string: public static function signup_form($mform) {
          if ($url = static::get_embed_url()) {
              $mform->addElement('header', 'policyagreement', get_string('policyagreement'), '');
              $mform->setExpanded('policyagreement');
              $mform->addElement('static', 'policylink', '', '<a href="' . $url .
                  '" onclick="this.target=\'_blank\'">' . get_string('policyagreementclick') . '</a>');
              $mform->addElement('checkbox', 'policyagreed', get_string('policyaccept'));
              $mform->addRule('policyagreed', get_string('policyagree'), 'required', null, 'client');
          }
      }
code: public static function signup_form($mform) {
          if ($url = static::get_embed_url()) {
              $mform->addElement('header', 'policyagreement', get_string('policyagreement'), '');
              $mform->setExpanded('policyagreement');
              $mform->addElement('static', 'policylink', '', '<a href="' . $url .
                  '" onclick="this.target=\'_blank\'">' . get_string('policyagreementclick') . '</a>');
              $mform->addElement('checkbox', 'policyagreed', get_string('policyaccept'));
              $mform->addRule('policyagreed', get_string('policyagree'), 'required', null, 'client');
          }
      }
code_tokens: public static function signup_form ( $ mform ) { if ( $ url = static :: get_embed_url ( ) ) { $ mform -> addElement ( 'header' , 'policyagreement' , get_string ( 'policyagreement' ) , '' ) ; $ mform -> setExpanded ( 'policyagreement' ) ; $ mform -> addElement ( 'static' , 'policylink' , '' , '<a href="' . $ url . '" onclick="this.target=\'_blank\'">' . get_string ( 'policyagreementclick' ) . '</a>' ) ; $ mform -> addElement ( 'checkbox' , 'policyagreed' , get_string ( 'policyaccept' ) ) ; $ mform -> addRule ( 'policyagreed' , get_string ( 'policyagree' ) , 'required' , null , 'client' ) ; } }
docstring: Adds "Agree to site policy" checkbox to the signup form.
  
  Sitepolicy handlers can override the simple checkbox with their own controls.
  
  @param \MoodleQuickForm $mform
docstring_tokens: Adds Agree to site policy checkbox to the signup form .