Represents an XHTML 1.1 module, with information on elements, tags and attributes.
Methods | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
public
|
getChildDef(HTMLPurifier_ElementDef $def): HTMLPurifier_ChildDef
Retrieves a proper HTMLPurifier_ChildDef subclass based on
content_model and content_model_type member variables of
the…
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. Returnssubclass Overriden by |
# | ||||||||||
public
|
addElement(
string $element,
string|bool $type,
string|HTMLPurifier_ChildDef $contents,
array|string $attr_includes = [],
array $attr = [],
): HTMLPurifier_ElementDef
Convenience function that sets up a new element
Convenience function that sets up a new element Parameters
ReturnsCreated element definition object, so you can set advanced parameters |
# | ||||||||||
public
|
addBlankElement(string $element): HTMLPurifier_ElementDef
Convenience function that creates a totally blank, non-standalone
element.
Convenience function that creates a totally blank, non-standalone element. Parameters
ReturnsCreated element |
# | ||||||||||
public
|
addElementToContentSet(string $element, string $type)
Convenience function that registers an element to a content set
Convenience function that registers an element to a content set Parameters
|
# | ||||||||||
public
|
parseContents(string $contents): array
Convenience function that transforms single-string contents
into separate content model and content model type
Convenience function that transforms single-string contents into separate content model and content model type Parameters
|
# | ||||||||||
public
|
mergeInAttrIncludes(array &$attr, array $attr_includes)
Convenience function that merges a list of attribute includes into
an attribute array.
Convenience function that merges a list of attribute includes into an attribute array. Parameters
|
# | ||||||||||
public
|
makeLookup(string $list): array
Convenience function that generates a lookup table with boolean
true as value.
Convenience function that generates a lookup table with boolean true as value. Parameters
Returnsarray equivalent of list |
# | ||||||||||
public
|
setup(HTMLPurifier_Config $config)
Lazy load construction of the module after determining whether
or not it's needed, and also when a finalized…
Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available. Overriden by
|
# |
Properties | |||
---|---|---|---|
public
|
|
$name
Short unique string identifier of the module.
Short unique string identifier of the module. |
# |
public
|
|
$elements = []
Informally, a list of elements this module changes.
Not used in any significant way.
Informally, a list of elements this module changes. Not used in any significant way. |
# |
public
|
|
$info = []
Associative array of element names to element definitions.
Some definitions may be incomplete, to be merged in later…
Associative array of element names to element definitions. Some definitions may be incomplete, to be merged in later with the full definition. |
# |
public
|
|
$content_sets = []
Associative array of content set names to content set additions.
This is commonly used to, say, add an A element to the…
Associative array of content set names to content set additions. This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition. |
# |
public
|
|
$attr_collections = []
Associative array of attribute collection names to attribute
collection additions. More rarely used for adding…
Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it. |
# |
public
|
|
$info_tag_transform = []
Associative array of deprecated tag name to HTMLPurifier_TagTransform.
Associative array of deprecated tag name to HTMLPurifier_TagTransform. |
# |
public
|
|
$info_attr_transform_pre = []
List of HTMLPurifier_AttrTransform to be performed before validation.
List of HTMLPurifier_AttrTransform to be performed before validation. |
# |
public
|
|
$info_attr_transform_post = []
List of HTMLPurifier_AttrTransform to be performed after validation.
List of HTMLPurifier_AttrTransform to be performed after validation. |
# |
public
|
|
$info_injector = []
List of HTMLPurifier_Injector to be performed during well-formedness fixing.
An injector will only be invoked if all of…
List of HTMLPurifier_Injector to be performed during well-formedness fixing. An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled. |
# |
public
|
|
$defines_child_def = false
Boolean flag that indicates whether or not getChildDef is implemented.
For optimization reasons: may save a call to a…
Boolean flag that indicates whether or not getChildDef is implemented. For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect! |
# |
public
|
|
$safe = true
Boolean flag whether or not this module is safe. If it is not safe, all
of its members are unsafe. Modules are safe by…
Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe") |
# |