Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

(no description)

File Size: 284 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

HTMLPurifier_HTMLModule:: (8 methods):
  getChildDef()
  addElement()
  addBlankElement()
  addElementToContentSet()
  parseContents()
  mergeInAttrIncludes()
  makeLookup()
  setup()


Class: HTMLPurifier_HTMLModule  - X-Ref

Represents an XHTML 1.1 module, with information on elements, tags
and attributes.

getChildDef($def)   X-Ref
Retrieves a proper HTMLPurifier_ChildDef subclass based on
content_model and content_model_type member variables of
the HTMLPurifier_ElementDef class. There is a similar function
in HTMLPurifier_HTMLDefinition.

return: HTMLPurifier_ChildDef subclass
param: HTMLPurifier_ElementDef $def

addElement($element, $type, $contents, $attr_includes = array()   X-Ref
Convenience function that sets up a new element

return: HTMLPurifier_ElementDef Created element definition object, so you
param: string $element Name of element to add
param: string|bool $type What content set should element be registered to?
param: string|HTMLPurifier_ChildDef $contents Allowed children in form of:
param: array|string $attr_includes What attribute collections to register to
param: array $attr What unique attributes does the element define?

addBlankElement($element)   X-Ref
Convenience function that creates a totally blank, non-standalone
element.

return: HTMLPurifier_ElementDef Created element
param: string $element Name of element to create

addElementToContentSet($element, $type)   X-Ref
Convenience function that registers an element to a content set

param: string $element Element to register
param: string $type Name content set (warning: case sensitive, usually upper-case

parseContents($contents)   X-Ref
Convenience function that transforms single-string contents
into separate content model and content model type

return: array
param: string $contents Allowed children in form of:

mergeInAttrIncludes(&$attr, $attr_includes)   X-Ref
Convenience function that merges a list of attribute includes into
an attribute array.

param: array $attr Reference to attr array to modify
param: array $attr_includes Array of includes / string include to merge in

makeLookup($list)   X-Ref
Convenience function that generates a lookup table with boolean
true as value.

return: array array equivalent of list
param: string $list List of values to turn into a lookup

setup($config)   X-Ref
Lazy load construction of the module after determining whether
or not it's needed, and also when a finalized configuration object
is available.

param: HTMLPurifier_Config $config