|
| 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.
|
|
|
| embed_alternatives ($urls, $name, $width, $height, $options) |
| Renders media files (audio or video) using suitable embedded player.
|
|
| process_media_tag ($fulltext) |
| Replaces <video> or <audio> tag with processed contents.
|
|
|
context | $context |
| The context we are in.
|
|
array | $localconfig |
| Any local configuration for this filter in this context.
|
|
◆ embed_alternatives()
filter_mediaplugin\text_filter::embed_alternatives |
( |
| $urls, |
|
|
| $name, |
|
|
| $width, |
|
|
| $height, |
|
|
| $options ) |
|
protected |
Renders media files (audio or video) using suitable embedded player.
Wrapper for core_media_manager::embed_alternatives()
- Parameters
-
array | $urls | Array of moodle_url to media files |
string | $name | Optional user-readable name to display in download link |
int | $width | Width in pixels (optional) |
int | $height | Height in pixels (optional) |
array | $options | Array of key/value pairs |
- Return values
-
string | HTML content of embed |
◆ filter()
filter_mediaplugin\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 | $text | some HTML content to process. |
array | $options | options passed to the filters |
- Return values
-
string | the 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
-
◆ 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
-
◆ 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
-
◆ 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
-
◆ process_media_tag()
filter_mediaplugin\text_filter::process_media_tag |
( |
| $fulltext | ) |
|
|
protected |
Replaces <video> or <audio> tag with processed contents.
- Parameters
-
string | $fulltext | complete HTML snipped "<video ...>...</video>" or "<audio ...>....</audio>" |
- Return values
-
◆ setup()
filter_mediaplugin\text_filter::setup |
( |
| $page, |
|
|
| $context ) |
Setup page with filter requirements and other prepare stuff.
- Parameters
-
moodle_page | $page | The page we are going to add requirements to. |
context | $context | The context which contents are going to be filtered. |
Reimplemented from core_filters\text_filter.
The documentation for this class was generated from the following file:
- filter/mediaplugin/classes/text_filter.php