Plugin modules' filter api

Plugin modules' filter api

by Itamar Tzadok -
Number of replies: 2
Could someone please clarify how the new filter api is supposed to work for filters in contributed module plugins? (see upgrade note below for reference)
 
Surely filters of contributed modules are not expected to relocate to /filter/xxxx. Would mod/my_module/filter.php continue to work in 2.3? But then shouldn't filters of contributed modules be subplugins of the module for consistency and flexibility (ie mod/my_module/filter/xxxx) ?
 
smile

=== 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.
Average of ratings: -
In reply to Itamar Tzadok

Re: Plugin modules' filter api

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Moving your filter code into /filter is exactly what you are expected to do. Note that there is now a filter/glossary in moodle 2.2.

You can use the $plugin->dependencies part of http://docs.moodle.org/dev/version.php to declare that the filter requires the mod to be installed.

In reply to Tim Hunt

Re: Plugin modules' filter api

by Itamar Tzadok -

Yes, it indeed makes sense to consider it on par with a dependent block. Thanks. smile