mirror of
https://github.com/moodle/moodle.git
synced 2025-03-03 23:46:09 +01:00
Merge branch 'w42_MDL-42243_m26_filtersettings' of https://github.com/skodak/moodle
This commit is contained in:
commit
04e49ead57
@ -1,6 +1,10 @@
|
||||
This file describes API changes in core filter API and plugins,
|
||||
information provided here is intended especially for developers.
|
||||
|
||||
=== 2.6 ===
|
||||
|
||||
* filtersettings.php is now deprecated, migrate to standard settings.php
|
||||
|
||||
=== 2.5 ===
|
||||
|
||||
* legacy_filter emulation was removed
|
||||
|
@ -71,13 +71,20 @@ class filter extends base {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$hassiteconfig or !file_exists($this->full_path('settings.php'))) {
|
||||
if (!$hassiteconfig) {
|
||||
return;
|
||||
}
|
||||
if (file_exists($this->full_path('settings.php'))) {
|
||||
$fullpath = $this->full_path('settings.php');
|
||||
} else if (file_exists($this->full_path('filtersettings.php'))) {
|
||||
$fullpath = $this->full_path('filtersettings.php');
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
$section = $this->get_settings_section_name();
|
||||
$settings = new admin_settingpage($section, $this->displayname, 'moodle/site:config', $this->is_enabled() === false);
|
||||
include($this->full_path('filtersettings.php')); // This may also set $settings to null.
|
||||
include($fullpath); // This may also set $settings to null.
|
||||
|
||||
if ($settings) {
|
||||
$ADMIN->add($parentnodename, $settings);
|
||||
|
@ -1124,6 +1124,10 @@ function filter_delete_all_for_context($contextid) {
|
||||
*/
|
||||
function filter_has_global_settings($filter) {
|
||||
global $CFG;
|
||||
$settingspath = $CFG->dirroot . '/filter/' . $filter . '/settings.php';
|
||||
if (is_readable($settingspath)) {
|
||||
return true;
|
||||
}
|
||||
$settingspath = $CFG->dirroot . '/filter/' . $filter . '/filtersettings.php';
|
||||
return is_readable($settingspath);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user