HTMLPurifier_HTMLModule_Presentation
extends HTMLPurifier_HTMLModule
in package
XHTML 1.1 Presentation Module, defines simple presentation-related markup. Text Extension Module.
Tags
Table of Contents
Properties
- $attr_collections : mixed
- 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.
- $content_sets : mixed
- Associative array of content set names to content set additions.
- $defines_child_def : mixed
- Boolean flag that indicates whether or not getChildDef is implemented.
- $elements : mixed
- Informally, a list of elements this module changes.
- $info : mixed
- Associative array of element names to element definitions.
- $info_attr_transform_post : mixed
- List of HTMLPurifier_AttrTransform to be performed after validation.
- $info_attr_transform_pre : mixed
- List of HTMLPurifier_AttrTransform to be performed before validation.
- $info_injector : mixed
- List of HTMLPurifier_Injector to be performed during well-formedness fixing.
- $info_tag_transform : mixed
- Associative array of deprecated tag name to HTMLPurifier_TagTransform.
- $name : mixed
- Short unique string identifier of the module.
- $safe : mixed
- 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")
Methods
- addBlankElement() : HTMLPurifier_ElementDef
- Convenience function that creates a totally blank, non-standalone element.
- addElement() : HTMLPurifier_ElementDef
- Convenience function that sets up a new element
- addElementToContentSet() : mixed
- Convenience function that registers an element to a content set
- getChildDef() : HTMLPurifier_ChildDef
- 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.
- makeLookup() : array<string|int, mixed>
- Convenience function that generates a lookup table with boolean true as value.
- mergeInAttrIncludes() : mixed
- Convenience function that merges a list of attribute includes into an attribute array.
- parseContents() : array<string|int, mixed>
- Convenience function that transforms single-string contents into separate content model and content model type
- setup() : mixed
- Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.
Properties
$attr_collections
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
mixed
$attr_collections
= array()
Tags
$content_sets
Associative array of content set names to content set additions.
public
mixed
$content_sets
= array()
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.
Tags
$defines_child_def
Boolean flag that indicates whether or not getChildDef is implemented.
public
mixed
$defines_child_def
= \false
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!
Tags
$elements
Informally, a list of elements this module changes.
public
mixed
$elements
= array()
Not used in any significant way.
Tags
$info
Associative array of element names to element definitions.
public
mixed
$info
= array()
Some definitions may be incomplete, to be merged in later with the full definition.
Tags
$info_attr_transform_post
List of HTMLPurifier_AttrTransform to be performed after validation.
public
mixed
$info_attr_transform_post
= array()
Tags
$info_attr_transform_pre
List of HTMLPurifier_AttrTransform to be performed before validation.
public
mixed
$info_attr_transform_pre
= array()
Tags
$info_injector
List of HTMLPurifier_Injector to be performed during well-formedness fixing.
public
mixed
$info_injector
= array()
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.
Tags
$info_tag_transform
Associative array of deprecated tag name to HTMLPurifier_TagTransform.
public
mixed
$info_tag_transform
= array()
Tags
$name
Short unique string identifier of the module.
public
mixed
$name
= 'Presentation'
Tags
$safe
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")
public
mixed
$safe
= \true
Tags
Methods
addBlankElement()
Convenience function that creates a totally blank, non-standalone element.
public
addBlankElement(string $element) : HTMLPurifier_ElementDef
Parameters
- $element : string
-
Name of element to create
Return values
HTMLPurifier_ElementDef —Created element
addElement()
Convenience function that sets up a new element
public
addElement(string $element, string|bool $type, string|HTMLPurifier_ChildDef $contents[, array<string|int, mixed>|string $attr_includes = array() ][, array<string|int, mixed> $attr = array() ]) : HTMLPurifier_ElementDef
Parameters
- $element : string
-
Name of element to add
- $type : string|bool
-
What content set should element be registered to? Set as false to skip this step.
- $contents : string|HTMLPurifier_ChildDef
-
Allowed children in form of: "$content_model_type: $content_model"
- $attr_includes : array<string|int, mixed>|string = array()
-
What attribute collections to register to element?
- $attr : array<string|int, mixed> = array()
-
What unique attributes does the element define?
Tags
Return values
HTMLPurifier_ElementDef —Created element definition object, so you can set advanced parameters
addElementToContentSet()
Convenience function that registers an element to a content set
public
addElementToContentSet(string $element, string $type) : mixed
Parameters
- $element : string
-
Element to register
- $type : string
-
Name content set (warning: case sensitive, usually upper-case first letter)
getChildDef()
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.
public
getChildDef(HTMLPurifier_ElementDef $def) : HTMLPurifier_ChildDef
Parameters
- $def : HTMLPurifier_ElementDef
Return values
HTMLPurifier_ChildDef —subclass
makeLookup()
Convenience function that generates a lookup table with boolean true as value.
public
makeLookup(string $list) : array<string|int, mixed>
Parameters
- $list : string
-
List of values to turn into a lookup
Tags
Return values
array<string|int, mixed> —array equivalent of list
mergeInAttrIncludes()
Convenience function that merges a list of attribute includes into an attribute array.
public
mergeInAttrIncludes(array<string|int, mixed> &$attr, array<string|int, mixed> $attr_includes) : mixed
Parameters
- $attr : array<string|int, mixed>
-
Reference to attr array to modify
- $attr_includes : array<string|int, mixed>
-
Array of includes / string include to merge in
parseContents()
Convenience function that transforms single-string contents into separate content model and content model type
public
parseContents(string $contents) : array<string|int, mixed>
Parameters
- $contents : string
-
Allowed children in form of: "$content_model_type: $content_model"
Tags
Return values
array<string|int, mixed>setup()
Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.
public
setup(HTMLPurifier_Config $config) : mixed
Parameters
- $config : HTMLPurifier_Config