Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
filter_glossary Class Reference

Glossary linking filter class. More...

Inheritance diagram for filter_glossary:
moodle_text_filter

Public Member Functions

 filter ($text, array $options=array())
 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().
 
 filterobject_prepare_replacement_callback ($concept, $glossaries)
 Callback used by filterobject / filter_phrases.
 
 hash ()
 
 setup ($page, $context)
 Setup page with filter requirements and other prepare stuff.
 

Protected Member Functions

 get_all_concepts ()
 Get all the concepts for this context.
 

Protected Attributes

null cache_store $cache = null
 cache used to store the terms for this course.
 
context $context
 The context we are in.
 
array $localconfig
 Any local configuration for this filter in this context.
 

Detailed Description

Glossary linking filter class.

NOTE: multilang glossary entries are not compatible with this filter.

Member Function Documentation

◆ filter()

filter_glossary::filter ( $text,
array $options = array() )

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 moodle_text_filter.

◆ filterobject_prepare_replacement_callback()

filter_glossary::filterobject_prepare_replacement_callback ( $concept,
$glossaries )

Callback used by filterobject / filter_phrases.

Parameters
object$conceptthe concept that is being replaced (from get_all_concepts).
array$glossariesthe list of glossary titles (from get_all_concepts).
Return values
array[$hreftagbegin, $hreftagend, $replacementphrase] for filterobject.

◆ get_all_concepts()

filter_glossary::get_all_concepts ( )
protected

Get all the concepts for this context.

Return values
filterobject[]the concepts, and filterobjects.

◆ setup()

filter_glossary::setup ( $page,
$context )

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 from moodle_text_filter.


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