Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
base_setting_ui Class Reference

This file contains the setting user interface classes that all backup/restore settings use to represent the UI they have. More...

Inheritance diagram for base_setting_ui:

Public Member Functions

 __construct (base_setting $setting)
 Constructors are sooooo cool.
 
 destroy ()
 Destroy all circular references.
 
 disable ()
 Disables the UI for this element.
 
 get_attributes ()
 Gets the HTML attributes for this item.
 
 get_icon ()
 Returns the icon to display next to this item, or false if there isn't one.
 
 get_label ()
 Gets the name of this item including its prefix.
 
 get_name ()
 Gets the name of this item including its prefix.
 
 get_param_validation ()
 Gets the the PARAM_XXXX validation to be applied to the setting.
 
 get_static_value ()
 Gets the value to display in a static quickforms element.
 
 get_type ()
 Gets the type of this element.
 
 get_value ()
 Gets the value of this setting.
 
 set_icon (pix_icon $icon)
 Sets the icon to display next to this item.
 
 set_label (string $label)
 Sets the label.
 

Public Attributes

const NAME_PREFIX = 'setting_'
 Prefix applied to all inputs/selects.
 

Protected Attributes

array $attributes = array()
 An array of HTML attributes to apply to this setting.
 
pix_icon $icon = false
 An icon to display next to this setting in the UI.
 
string $label
 The label for the setting.
 
string $name
 The name of the setting.
 
base_setting backup_setting $setting
 The setting this UI belongs to (parent reference)
 
int $type
 The backup_setting UI type this relates to.
 

Detailed Description

This file contains the setting user interface classes that all backup/restore settings use to represent the UI they have.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later Abstract class used to represent the user interface that a setting has.
Todo
extend as required for restore
License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

base_setting_ui::__construct ( base_setting $setting)

Constructors are sooooo cool.

Parameters
base_setting$setting

Member Function Documentation

◆ destroy()

base_setting_ui::destroy ( )

Destroy all circular references.

It helps PHP 5.2 a lot!

◆ get_attributes()

base_setting_ui::get_attributes ( )

Gets the HTML attributes for this item.

Return values
array

◆ get_icon()

base_setting_ui::get_icon ( )

Returns the icon to display next to this item, or false if there isn't one.

Return values
pix_icon|false

◆ get_label()

base_setting_ui::get_label ( )

Gets the name of this item including its prefix.

Return values
string

◆ get_name()

base_setting_ui::get_name ( )

Gets the name of this item including its prefix.

Return values
string

◆ get_param_validation()

base_setting_ui::get_param_validation ( )

Gets the the PARAM_XXXX validation to be applied to the setting.

return string The PARAM_XXXX constant of null if the setting type is not defined

◆ get_static_value()

base_setting_ui::get_static_value ( )

Gets the value to display in a static quickforms element.

Return values
mixed

Reimplemented in backup_setting_ui_checkbox, backup_setting_ui_dateselector, backup_setting_ui_defaultcustom, backup_setting_ui_radio, and backup_setting_ui_select.

◆ get_type()

base_setting_ui::get_type ( )

Gets the type of this element.

Return values
int

◆ get_value()

base_setting_ui::get_value ( )

Gets the value of this setting.

Return values
mixed

◆ set_icon()

base_setting_ui::set_icon ( pix_icon $icon)

Sets the icon to display next to this item.

Parameters
pix_icon$icon

◆ set_label()

base_setting_ui::set_label ( string $label)

Sets the label.

Exceptions
base_setting_ui_exceptionwhen the label is not valid.
Parameters
string$label

Member Data Documentation

◆ $type

int base_setting_ui::$type
protected

The backup_setting UI type this relates to.

One of backup_setting\UI_*;


The documentation for this class was generated from the following file: