Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402]

LDAP enrolment plugin admin setting classes

Author: Iñaki Arenaza
Copyright: 2010 Iñaki Arenaza <iarenaza@eps.mondragon.edu>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 209 lines (9 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 3 classes

admin_setting_configtext_trim_lower:: (2 methods):
  __construct()
  write_setting()

admin_setting_ldap_rolemapping:: (4 methods):
  __construct()
  get_setting()
  write_setting()
  output_html()

enrol_ldap_admin_setting_category:: (2 methods):
  __construct()
  load_choices()


Class: admin_setting_configtext_trim_lower  - X-Ref

__construct($name, $visiblename, $description, $defaultsetting, $lowercase=false, $enabled=true)   X-Ref
Constructor: uses parent::__construct

param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins.
param: string $visiblename localised
param: string $description long localised info
param: string $defaultsetting default value for the setting
param: boolean $lowercase if true, lowercase the value before writing it to the db.
param: boolean $enabled if true, the input field is enabled, otherwise it's disabled.

write_setting($data)   X-Ref
Saves the setting(s) provided in $data

param: array $data An array of data, if not array returns empty str
return: mixed empty string on useless data or success, error string if failed

Class: admin_setting_ldap_rolemapping  - X-Ref

__construct($name, $visiblename, $description, $defaultsetting)   X-Ref
Constructor: uses parent::__construct

param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins.
param: string $visiblename localised
param: string $description long localised info
param: string $defaultsetting default value for the setting (actually unused)

get_setting()   X-Ref
Returns the current setting if it is set

return: mixed null if null, else an array

write_setting($data)   X-Ref
Saves the setting(s) provided in $data

param: array $data An array of data, if not array returns empty str
return: mixed empty string on useless data or success, error string if failed

output_html($data, $query='')   X-Ref
Returns XHTML field(s) as required by choices

Relies on data being an array should data ever be another valid vartype with
acceptable value this may cause a warning/error
if (!is_array($data)) would fix the problem

param: array $data An array of checked values
param: string $query
return: string XHTML field

Class: enrol_ldap_admin_setting_category  - X-Ref

Class implements new specialized setting for course categories that are loaded
only when required

__construct($name, $visiblename, $description)   X-Ref
No description

load_choices()   X-Ref
No description