From dd3fafbda535d48c99ea7e784390acba86e54619 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Wed, 16 Nov 2011 02:09:53 +0100 Subject: [PATCH] MDL-29995 filters - consider leacy filters and locations deprecated in 2.2 Support for them will be dropped in 2.3 thanks to MDL-29996 --- filter/upgrade.txt | 11 +++++++++++ lib/filterlib.php | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 filter/upgrade.txt diff --git a/filter/upgrade.txt b/filter/upgrade.txt new file mode 100644 index 00000000000..bb0522ecc4b --- /dev/null +++ b/filter/upgrade.txt @@ -0,0 +1,11 @@ +This file describes API changes in core filter API and plugins, +information provided here is intended especially for developers. + +=== 2.2 === + +* legacy filters and legacy locations have been deprecated, so any + old filter should be updated to use the new moodle_text_filter, + and any filter bundled under mod/xxxx directories be moved to + /filter/xxxx (MDL-29995). They will stop working completely in + Moodle 2.3 (MDL-29996). See the glossary or data filters for + examples of legacy module filters and locations already updated. diff --git a/lib/filterlib.php b/lib/filterlib.php index 3feb6ded3a7..1bfef98b27e 100644 --- a/lib/filterlib.php +++ b/lib/filterlib.php @@ -136,6 +136,7 @@ class filter_manager { return new $filterclassname($context, $localconfig); } + // TODO: deprecated since 2.2, will be out in 2.3, see MDL-29996 $legacyfunctionname = basename($filtername) . '_filter'; if (function_exists($legacyfunctionname)) { return new legacy_filter($legacyfunctionname, $context, $localconfig); @@ -370,6 +371,8 @@ abstract class moodle_text_filter { * moodle_text_filter implementation that encapsulates an old-style filter that * only defines a function, not a class. * + * @deprecated since 2.2, see MDL-29995 + * @todo will be out in 2.3, see MDL-29996 * @package core * @subpackage filter * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} @@ -475,6 +478,7 @@ class filterobject { * @return string the human-readable name for this filter. */ function filter_get_name($filter) { + // TODO: should we be using pluginname here instead? list($type, $filter) = explode('/', $filter); switch ($type) { case 'filter': @@ -485,6 +489,7 @@ function filter_get_name($filter) { } // Fall through to try the legacy location. + // TODO: deprecated since 2.2, will be out in 2.3, see MDL-29996 case 'mod': $strfiltername = get_string('filtername', $filter); if (substr($strfiltername, 0, 2) == '[[') { @@ -508,7 +513,7 @@ function filter_get_name($filter) { function filter_get_all_installed() { global $CFG; $filternames = array(); - // TODO: deprecated in 2.2, delete support for "mod" legacy filters location in 2.3. MDL-29996 + // TODO: deprecated since 2.2, will be out in 2.3, see MDL-29996 $filterlocations = array('mod', 'filter'); foreach ($filterlocations as $filterlocation) { // TODO: move get_list_of_plugins() to get_plugin_list()