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.

Auto complete admin setting.

Copyright: 2020 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 206 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

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


Class: autocomplete  - X-Ref

Auto complete setting class.

__construct($name, $visiblename, $description, $defaultsetting, $choices, $attributes = null)   X-Ref
Constructor

param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting'
param: string $visiblename localised
param: string $description long localised info
param: array $defaultsetting array of selected items
param: array $choices options for autocomplete field
param: array $attributes settings for autocomplete field

get_setting()   X-Ref
Returns the select setting(s)

return: mixed null or array. Null if no settings else array of setting(s)

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

param: array $data

output_html($data, $query = '')   X-Ref
Returns XHTML autocomplete field

param: array $data Array of values to select by default
param: string $query
return: string XHTML autocomplete field