Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 401] [Versions 311 and 402] [Versions 311 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.

param: HTMLPurifier_ElementDef $def
return: HTMLPurifier_ChildDef subclass

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

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?
return: HTMLPurifier_ElementDef Created element definition object, so you

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

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

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

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

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.

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

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