MDL-53170 search: API fixes for core subsystems

This commit is contained in:
David Monllao 2016-04-26 15:10:54 +08:00
parent 1e72daa899
commit 1f69cd819f
2 changed files with 12 additions and 4 deletions

View file

@ -136,7 +136,14 @@ abstract class base {
* @return string
*/
public function get_visible_name($lazyload = false) {
return get_string('search:' . $this->areaname, $this->componentname, null, $lazyload);
$component = $this->componentname;
// Core subsystem strings go to lang/XX/search.php.
if (strpos($component, 'core_') === 0) {
$component = 'search';
}
return get_string('search:' . $this->areaname, $component, null, $lazyload);
}
/**
@ -150,8 +157,9 @@ abstract class base {
public function get_config_var_name() {
if ($this->componenttype === 'core') {
// Core subsystems config in search.
return array('search', $this->areaid);
// Core subsystems config in core_search and setting name using only [a-zA-Z0-9_]+.
$parts = \core_search\manager::extract_areaid_parts($this->areaid);
return array('core_search', $parts[0] . '_' . $parts[1]);
}
// Plugins config in the plugin scope.

View file

@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2016050600.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2016050600.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.