Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 39 and 401] [Versions 401 and 403]

This file contains the generic moodleform bridge for the backup user interface as well as the individual forms that relate to the different stages the user interface can exist within.

Copyright: 2010 Sam Hemelryk
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 424 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: base_moodleform  - X-Ref

Base moodleform bridge

Ahhh the mighty moodleform bridge! Strong enough to take the weight of 682 full
grown african swallows all of whom have been carring coconuts for several days.
EWWWWW!!!!!!!!!!!!!!!!!!!!!!!!

__construct(base_ui_stage $uistage, $action = null, $customdata = null, $method = 'post',$target = '', $attributes = null, $editable = true)   X-Ref
Creates the form

param: base_ui_stage $uistage
param: moodle_url|string $action
param: mixed $customdata
param: string $method get|post
param: string $target
param: array $attributes
param: bool $editable

definition()   X-Ref
The standard form definition... obviously not much here


definition_after_data()   X-Ref
Definition applied after the data is organised.. why's it here? because I want
to add elements on the fly.


close_task_divs()   X-Ref
Closes any open divs


add_setting(backup_setting $setting, base_task $task = null)   X-Ref
Adds the backup_setting as a element to the form

param: backup_setting $setting
param: base_task $task
return: bool

add_settings(array $settingstasks)   X-Ref
Adds multiple backup_settings as elements to the form

param: array $settingstasks Consists of array($setting, $task) elements
return: bool

add_heading($name , $text)   X-Ref
Adds a heading to the form

param: string $name
param: string $text

add_html_formatting(backup_setting $setting)   X-Ref
Adds HTML formatting for the given backup setting, needed to group/segment
correctly.

param: backup_setting $setting

add_fixed_setting(backup_setting $setting, base_task $task)   X-Ref
Adds a fixed or static setting to the form

param: backup_setting $setting
param: base_task $task

add_dependencies(backup_setting $setting)   X-Ref
Adds dependencies to the form recursively

param: backup_setting $setting

is_cancelled()   X-Ref
Returns true if the form was cancelled, false otherwise

return: bool

remove_element($elementname)   X-Ref
Removes an element from the form if it exists

param: string $elementname
return: bool

get_element($elementname)   X-Ref
Gets an element from the form if it exists

param: string $elementname
return: HTML_QuickForm_input|MoodleQuickForm_group

display()   X-Ref
Displays the form


require_definition_after_data()   X-Ref
Ensures the the definition after data is loaded