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 311 and 403] [Versions 39 and 403]

Form for editing steps.

Copyright: 2016 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 223 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

editstep:: (5 methods):
  __construct()
  definition()
  validation()
  set_data()
  get_data()


Class: editstep  - X-Ref

Form for editing steps.

__construct($target, \tool_usertours\step $step)   X-Ref
Create the edit step form.

param: string      $target     The target of the form.
param: step        $step       The step being editted.

definition()   X-Ref
Form definition.


validation($data, $files)   X-Ref
Validate the database on the submitted content type.

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,

set_data($data)   X-Ref
Load in existing data as form defaults. Usually new entry defaults are stored directly in
form definition (new entry form); this function is used to load in data where values
already exist and data is being edited (edit entry form).

param: stdClass|array $data object or array of default values

get_data()   X-Ref
Return submitted data if properly submitted or returns NULL if validation fails or
if there is no submitted data.

return: object|null submitted data; NULL if not valid or not submitted or cancelled