mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
MDL-12786 admin search in configselect choices; merged from MOODLE_19_STABLE
This commit is contained in:
parent
6bf55889dd
commit
407d81349c
1 changed files with 19 additions and 0 deletions
|
@ -2151,6 +2151,25 @@ class admin_setting_configselect extends admin_setting {
|
|||
return true;
|
||||
}
|
||||
|
||||
function is_related($query) {
|
||||
if (parent::is_related($query)) {
|
||||
return true;
|
||||
}
|
||||
if (!$this->load_choices()) {
|
||||
return false;
|
||||
}
|
||||
$textlib = textlib_get_instance();
|
||||
foreach ($this->choices as $key=>$value) {
|
||||
if (strpos($textlib->strtolower($key), $query) !== false) {
|
||||
return true;
|
||||
}
|
||||
if (strpos($textlib->strtolower($value), $query) !== false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function get_setting() {
|
||||
return $this->config_read($this->name);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue