Moodle PHP Documentation 5.0
Moodle 5.0.1+ (Build: 20250711) (61af040cd5f)
filter_emoticon\text_filter Class Reference
Inheritance diagram for filter_emoticon\text_filter:
core_filters\text_filter

Public Member Functions

 filter ($text, array $options=[])
 Override this function to actually implement the filtering.
 
 filter_stage_post_clean (string $text, array $options)
 Filter HTML text at the very end after text is sanitised.
 
 filter_stage_pre_clean (string $text, array $options)
 Filter HTML text before sanitising text.
 
 filter_stage_pre_format (string $text, array $options)
 Filter text before changing format to HTML.
 
 filter_stage_string (string $text, array $options)
 Filter simple text coming from format_string().
 
 setup ($page, $context)
 Setup page with filter requirements and other prepare stuff.
 

Protected Member Functions

 replace_emoticons ($text)
 Replace emoticons found in the text with their images.
 

Protected Attributes

context $context
 The context we are in.
 
array $localconfig
 Any local configuration for this filter in this context.
 

Static Protected Attributes

static array $emoticonimgs = []
 Internal cache used for replacing.
 
static array $emoticontexts = []
 Internal cache used for replacing.
 

Member Function Documentation

◆ filter()

filter_emoticon\text_filter::filter ( $text,
array $options = [] )

Override this function to actually implement the filtering.

Filter developers must make sure that filtering done after text cleaning does not introduce security vulnerabilities.

Parameters
string$textsome HTML content to process.
array$optionsoptions passed to the filters
Return values
stringthe HTML content after the filtering has been applied.

Reimplemented from core_filters\text_filter.

◆ filter_stage_post_clean()

core_filters\text_filter::filter_stage_post_clean ( string $text,
array $options )
inherited

Filter HTML text at the very end after text is sanitised.

NOTE: this is called even if $options['noclean'] is true and text is not cleaned.

Parameters
string$text
array$options
Return values
string

◆ filter_stage_pre_clean()

core_filters\text_filter::filter_stage_pre_clean ( string $text,
array $options )
inherited

Filter HTML text before sanitising text.

NOTE: this is called even if $options['noclean'] is true and text is not cleaned.

Parameters
string$text
array$options
Return values
string

◆ filter_stage_pre_format()

core_filters\text_filter::filter_stage_pre_format ( string $text,
array $options )
inherited

Filter text before changing format to HTML.

Parameters
string$text
array$options
Return values
string

◆ filter_stage_string()

core_filters\text_filter::filter_stage_string ( string $text,
array $options )
inherited

Filter simple text coming from format_string().

Note that unless $CFG->formatstringstriptags is disabled HTML tags are not expected in returned value.

Parameters
string$text
array$options
Return values
string

◆ replace_emoticons()

filter_emoticon\text_filter::replace_emoticons ( $text)
protected

Replace emoticons found in the text with their images.

Parameters
string$textto modify
Return values
stringthe modified result

◆ setup()

core_filters\text_filter::setup ( $page,
$context )
inherited

Setup page with filter requirements and other prepare stuff.

Override this method if the filter needs to setup page requirements or needs other stuff to be executed.

Note this method is invoked from {

See also
setup_page_for_filters()} for each piece of text being filtered, so it is responsible for controlling its own execution cardinality.
Parameters
moodle_page$pagethe page we are going to add requirements to.
context$contextthe context which contents are going to be filtered.
Since
Moodle 2.3

Reimplemented in filter_glossary\text_filter, filter_mathjaxloader\text_filter, and filter_mediaplugin\text_filter.

Member Data Documentation

◆ $emoticonimgs

array filter_emoticon\text_filter::$emoticonimgs = []
staticprotected

Internal cache used for replacing.

Multidimensional array;

  • dimension 1: language,
  • dimension 2: theme.

◆ $emoticontexts

array filter_emoticon\text_filter::$emoticontexts = []
staticprotected

Internal cache used for replacing.

Multidimensional array;

  • dimension 1: language,
  • dimension 2: theme.

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