Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 39 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: 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