Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

(no description)

Copyright: Gaetan Frenoy <gaetan@frenoy.net>
Copyright: 2004 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 134 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

filter_multilang:: (3 methods):
  filter()
  process_match()
  get_parent_lang()


Class: filter_multilang  - X-Ref

Implementation of the Moodle filter API for the Multi-lang filter.

filter($text, array $options = array()   X-Ref
No description

process_match(array $langblock)   X-Ref
This is the callback used by the preg_replace_callback call above.

param: array $langblock one of the matches from the regex match.
return: string the replacement string (one of the possible translations).

get_parent_lang(string $lang)   X-Ref
Puts some caching around get_parent_language().

Also handle parent == 'en' in a way that works better for us.

param: string $lang a Moodle language code, e.g. 'fr'.
return: string the parent language.