Permalink
Browse files

Merge branch 'MDL-29995' of git://github.com/stronk7/moodle

  • Loading branch information...
2 parents 4cff8cb + dd3fafb commit d7de1c8a6230ffacec6e40be808bf4630a55a122 @nebgor nebgor committed Nov 23, 2011
Showing with 17 additions and 1 deletion.
  1. +11 −0 filter/upgrade.txt
  2. +6 −1 lib/filterlib.php
View
@@ -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.
View
@@ -136,6 +136,7 @@ protected function make_filter_object($filtername, $context, $localconfig) {
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 @@ public function hash() {
* 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 @@ function filterobject($phrase, $hreftagbegin = '<span class="highlight">',
* @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()

0 comments on commit d7de1c8

Please sign in to comment.