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 401 and 402] [Versions 401 and 403]

(no description)

File Size: 268 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

adminpresets_setting:: (14 methods):
  __construct()
  set_behaviors()
  apply_behaviors()
  get_value()
  set_value()
  get_visiblevalue()
  set_visiblevalue()
  get_attributes()
  get_attributes_values()
  get_settingdata()
  set_attribute_value()
  save_attributes_values()
  save_value()
  to_log()


Class: adminpresets_setting  - X-Ref

Admin tool presets plugin to load some settings.

__construct(admin_setting $settingdata, $dbsettingvalue)   X-Ref
Stores the setting data and the selected value

param: admin_setting $settingdata admin_setting subclass
param: mixed $dbsettingvalue Actual value

set_behaviors()   X-Ref
Each class can overwrite this method to specify extra processes


apply_behaviors()   X-Ref
Applies the children class specific behaviors

See delegation class for the available extra behaviors

get_value()   X-Ref
Gets the setting value.

return: mixed The setting value

set_value($value)   X-Ref
Sets the setting value cleaning it

Child classes should overwrite method to clean more acurately

param: mixed $value Setting value
return: mixed Returns false if wrong param value

get_visiblevalue()   X-Ref
No description

set_visiblevalue()   X-Ref
Sets the visible name for the setting selected value

In most cases the child classes will overwrite

get_attributes()   X-Ref
No description

get_attributes_values()   X-Ref
No description

get_settingdata()   X-Ref
No description

set_attribute_value($name, $value)   X-Ref
No description

save_attributes_values()   X-Ref
Saves the setting attributes values

return: array        Array of inserted ids (in config_log)

save_value($name = false, $value = null)   X-Ref
Stores the setting into database, logs the change and returns the config_log inserted id

param: bool $name Setting name to store.
param: mixed $value Setting value to store.
return: int|false config_log inserted id or false whenever the new value is the same as old value.

to_log($plugin, $name, $value, $actualvalue)   X-Ref
Copy of config_write method of the admin_setting class

param: string $plugin
param: string $name
param: mixed $value
param: mixed $actualvalue
return: integer The stored config_log id