Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
filter_manager Class Reference

Class to manage the filtering of strings. More...

Inheritance diagram for filter_manager:
performance_measuring_filter_manager

Public Member Functions

 filter_string ($string, $context)
 Filter a piece of string.
 
 filter_text ($text, $context, array $options=array(), array $skipfilters=null)
 Filter some text.
 
 setup_page_for_filters ($page, $context)
 Setup page with filters requirements and other prepare stuff.
 
 setup_page_for_globally_available_filters ($page)
 Setup the page for globally available filters.
 
 text_filtering_hash ()
 

Static Public Member Functions

static instance ()
 Factory method.
 
static reset_caches ()
 Resets the caches, usually to be called between unit tests.
 

Protected Member Functions

 __construct ()
 Constructor.
 
 apply_filter_chain ($text, $filterchain, array $options=array(), array $skipfilters=null)
 Apply a list of filters to some content.
 
 get_string_filters ($context)
 Get all the filters that apply to a given context for calls to format_string.
 
 get_text_filters ($context)
 Get all the filters that apply to a given context for calls to format_text.
 
 load_filters ($context)
 Load all the filters required by this context.
 
 make_filter_object ($filtername, $context, $localconfig)
 Factory method for creating a filter.
 
 unload_all_filters ()
 Unloads all filters and other cached information.
 

Protected Attributes

array $stringfilternames = array()
 Exploded version of $CFG->stringfilters.
 
moodle_text_filter[][] $stringfilters = array()
 This list of active filters, by context, for filtering strings.
 
moodle_text_filter[][] $textfilters = array()
 This list of active filters, by context, for filtering content.
 

Static Protected Attributes

static filter_manager $singletoninstance
 Holds the singleton instance.
 

Detailed Description

Class to manage the filtering of strings.

It is intended that this class is only used by weblib.php. Client code should probably be using the format_text and format_string functions.

This class is a singleton.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

The documentation for this class was generated from the following file: