Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 39 and 311]

Class site_registration_form

Copyright: 2017 Marina Glancy
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 322 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

site_registration_form:: (5 methods):
  definition()
  add_select_with_email()
  add_checkbox_with_email()
  validation()
  get_data()


Class: site_registration_form  - X-Ref

The site registration form. Information will be sent to the sites directory.

definition()   X-Ref
Form definition


add_select_with_email($elementname, $stridentifier, $options = null, $highlight = false)   X-Ref
Add yes/no select with additional checkbox allowing to specify another email

param: string $elementname
param: string $stridentifier
param: array|null $options options for the select element
param: bool $highlight highlight as a new field

add_checkbox_with_email($elementname, $stridentifier, $highlight = false, string $checkboxtext = '')   X-Ref
Add yes/no checkbox with additional checkbox allowing to specify another email

param: string $elementname
param: string $stridentifier
param: bool $highlight highlight as a new field
param: string $checkboxtext The text to show after the text.

validation($data, $files)   X-Ref
Validation of the form data

param: array $data array of ("fieldname"=>value) of submitted data
param: array $files array of uploaded files "element_name"=>tmp_file_path
return: array of "element_name"=>"error_description" if there are errors,

get_data()   X-Ref
Returns the form data

return: stdClass