Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

Class site_registration_form

Copyright: 2017 Marina Glancy
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 317 lines (14 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