Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
backup_setting_ui_checkbox Class Reference

A checkbox user interface element for backup settings (default) More...

Inheritance diagram for backup_setting_ui_checkbox:
backup_setting_ui base_setting_ui

Public Member Functions

 __construct (backup_setting $setting, $label=null, $text=null, array $attributes=array(), array $options=array())
 Overridden constructor so we can take text argument.
 
 apply_options (array $properties)
 Applies config options to a given properties array and then returns it.
 
 destroy ()
 Destroy all circular references.
 
 disable ()
 Disables the UI for this element.
 
 get_attributes ()
 Gets the HTML attributes for this item.
 
 get_element_properties (base_task $task=null, renderer_base $output=null)
 Returns an array of properties suitable for generating a quickforms element.
 
 get_icon ()
 Returns the icon to display next to this item, or false if there isn't one.
 
 get_label (base_task $task=null)
 Gets the label for this item.
 
 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.
 
core_renderer get_static_value ()
 Gets the static value for the element $OUTPUT.
 
 get_type ()
 Gets the type of this element.
 
 get_value ()
 Gets the value of this setting.
 
 is_changeable ($level=null)
 Returns true if the setting is changeable.
 
 set_changeable ($newvalue)
 Sets whether the setting is changeable, Note dependencies can still mark this setting changeable or not.
 
 set_icon (pix_icon $icon)
 Sets the icon to display next to this item.
 
 set_label (string $label)
 Sets the label.
 
 set_text ($text)
 Sets the text for the element.
 

Static Public Member Functions

static make (backup_setting $setting, $type, $label, array $attributes=null, array $options=null)
 Creates a new backup setting ui based on the setting it is given.
 

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.
 
bool $changeable = true
 
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.
 
array $options = array()
 An array of options relating to this setting.
 
base_setting backup_setting $setting
 The setting this UI belongs to (parent reference)
 
string $text
 The text to show next to the checkbox.
 
int $type = backup_setting::UI_HTML_CHECKBOX
 

Detailed Description

A checkbox user interface element for backup settings (default)

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

backup_setting_ui_checkbox::__construct ( backup_setting $setting,
$label = null,
$text = null,
array $attributes = array(),
array $options = array() )

Overridden constructor so we can take text argument.

Parameters
backup_setting$setting
string$label
string$text
array$attributes
array$options

Member Function Documentation

◆ apply_options()

backup_setting_ui::apply_options ( array $properties)
inherited

Applies config options to a given properties array and then returns it.

Parameters
array$properties
Return values
array

◆ destroy()

base_setting_ui::destroy ( )
inherited

Destroy all circular references.

It helps PHP 5.2 a lot!

◆ get_attributes()

base_setting_ui::get_attributes ( )
inherited

Gets the HTML attributes for this item.

Return values
array

◆ get_element_properties()

backup_setting_ui_checkbox::get_element_properties ( base_task $task = null,
renderer_base $output = null )

Returns an array of properties suitable for generating a quickforms element.

Parameters
base_task$task
renderer_base$output
Return values
array(element, name, label, text, attributes);

Reimplemented from backup_setting_ui.

◆ get_icon()

base_setting_ui::get_icon ( )
inherited

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

Return values
pix_icon|false

◆ get_label() [1/2]

backup_setting_ui::get_label ( base_task $task = null)
inherited

Gets the label for this item.

Parameters
base_task$taskOptional, if provided and the setting is an include $task is used to set the setting label
Return values
string

◆ get_label() [2/2]

base_setting_ui::get_label ( )
inherited

Gets the name of this item including its prefix.

Return values
string

◆ get_name()

base_setting_ui::get_name ( )
inherited

Gets the name of this item including its prefix.

Return values
string

◆ get_param_validation()

base_setting_ui::get_param_validation ( )
inherited

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()

core_renderer backup_setting_ui_checkbox::get_static_value ( )

Gets the static value for the element $OUTPUT.

Return values
string

Reimplemented from base_setting_ui.

◆ get_type()

base_setting_ui::get_type ( )
inherited

Gets the type of this element.

Return values
int

◆ get_value()

base_setting_ui::get_value ( )
inherited

Gets the value of this setting.

Return values
mixed

◆ is_changeable()

backup_setting_ui_checkbox::is_changeable ( $level = null)

Returns true if the setting is changeable.

Parameters
int$levelOptional, if provided only depedency_settings below or equal to this level are considered, when checking if the ui_setting is changeable. Although dependencies might cause a lock on this setting, they could be changeable in the same view.
Return values
bool

Reimplemented from backup_setting_ui.

◆ make()

static backup_setting_ui::make ( backup_setting $setting,
$type,
$label,
array $attributes = null,
array $options = null )
staticfinalinherited

Creates a new backup setting ui based on the setting it is given.

Exceptions
backup_setting_ui_exceptionif the setting type is not supported,
Parameters
backup_setting$setting
int$typeThe backup_setting UI type. One of backup_setting\UI_*;
string$labelThe label to display with the setting ui
array$attributesArray of HTML attributes to apply to the element
array$optionsArray of options to apply to the setting ui object
Return values
backup_setting_ui_text|backup_setting_ui_checkbox|backup_setting_ui_select|backup_setting_ui_radio

◆ set_changeable()

backup_setting_ui_checkbox::set_changeable ( $newvalue)

Sets whether the setting is changeable, Note dependencies can still mark this setting changeable or not.

Parameters
bool$newvalue

◆ set_icon()

base_setting_ui::set_icon ( pix_icon $icon)
inherited

Sets the icon to display next to this item.

Parameters
pix_icon$icon

◆ set_label()

base_setting_ui::set_label ( string $label)
inherited

Sets the label.

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

◆ set_text()

backup_setting_ui_checkbox::set_text ( $text)

Sets the text for the element.

Parameters
string$text

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