HTMLPurifier 4.4.0
HTMLPurifier_AttrTransform Class Reference

Processes an entire attribute array for corrections needing multiple values. More...

Inheritance diagram for HTMLPurifier_AttrTransform:
HTMLPurifier_AttrTransform_Background HTMLPurifier_AttrTransform_Background HTMLPurifier_AttrTransform_BdoDir HTMLPurifier_AttrTransform_BdoDir HTMLPurifier_AttrTransform_BgColor HTMLPurifier_AttrTransform_BgColor HTMLPurifier_AttrTransform_BoolToCSS HTMLPurifier_AttrTransform_BoolToCSS HTMLPurifier_AttrTransform_Border HTMLPurifier_AttrTransform_Border HTMLPurifier_AttrTransform_EnumToCSS HTMLPurifier_AttrTransform_EnumToCSS HTMLPurifier_AttrTransform_ImgRequired HTMLPurifier_AttrTransform_ImgRequired HTMLPurifier_AttrTransform_ImgSpace HTMLPurifier_AttrTransform_ImgSpace HTMLPurifier_AttrTransform_Input HTMLPurifier_AttrTransform_Input HTMLPurifier_AttrTransform_Lang HTMLPurifier_AttrTransform_Lang HTMLPurifier_AttrTransform_Length HTMLPurifier_AttrTransform_Length HTMLPurifier_AttrTransform_Name HTMLPurifier_AttrTransform_Name HTMLPurifier_AttrTransform_NameSync HTMLPurifier_AttrTransform_NameSync HTMLPurifier_AttrTransform_Nofollow HTMLPurifier_AttrTransform_Nofollow HTMLPurifier_AttrTransform_SafeEmbed HTMLPurifier_AttrTransform_SafeEmbed HTMLPurifier_AttrTransform_SafeObject HTMLPurifier_AttrTransform_SafeObject HTMLPurifier_AttrTransform_SafeParam HTMLPurifier_AttrTransform_SafeParam HTMLPurifier_AttrTransform_ScriptRequired HTMLPurifier_AttrTransform_ScriptRequired HTMLPurifier_AttrTransform_TargetBlank HTMLPurifier_AttrTransform_TargetBlank HTMLPurifier_AttrTransform_Textarea HTMLPurifier_AttrTransform_Textarea

List of all members.

Public Member Functions

 transform ($attr, $config, $context)
 Abstract: makes changes to the attributes dependent on multiple values.
 prependCSS (&$attr, $css)
 Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist.
 confiscateAttr (&$attr, $key)
 Retrieves and removes an attribute.
 transform ($attr, $config, $context)
 Abstract: makes changes to the attributes dependent on multiple values.
 prependCSS (&$attr, $css)
 Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist.
 confiscateAttr (&$attr, $key)
 Retrieves and removes an attribute.

Detailed Description

Processes an entire attribute array for corrections needing multiple values.

Occasionally, a certain attribute will need to be removed and popped onto another value. Instead of creating a complex return syntax for HTMLPurifier_AttrDef, we just pass the whole attribute array to a specialized object and have that do the special work. That is the family of HTMLPurifier_AttrTransform.

An attribute transformation can be assigned to run before or after HTMLPurifier_AttrDef validation. See HTMLPurifier_HTMLDefinition for more details.

Definition at line 17 of file AttrTransform.php.


Member Function Documentation

HTMLPurifier_AttrTransform::confiscateAttr ( &$  attr,
key 
)
HTMLPurifier_AttrTransform::confiscateAttr ( &$  attr,
key 
)

Retrieves and removes an attribute.

Parameters:
$attrAttribute array to process (passed by reference)
$keyKey of attribute to confiscate

Definition at line 558 of file HTMLPurifier.standalone.php.

HTMLPurifier_AttrTransform::prependCSS ( &$  attr,
css 
)

Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist.

Parameters:
$attrAttribute array to process (passed by reference)
$cssCSS to prepend

Definition at line 548 of file HTMLPurifier.standalone.php.

HTMLPurifier_AttrTransform::prependCSS ( &$  attr,
css 
)

Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist.

Parameters:
$attrAttribute array to process (passed by reference)
$cssCSS to prepend

Definition at line 37 of file AttrTransform.php.

Referenced by HTMLPurifier_AttrTransform_Length::transform(), HTMLPurifier_AttrTransform_ImgSpace::transform(), HTMLPurifier_AttrTransform_EnumToCSS::transform(), HTMLPurifier_AttrTransform_Border::transform(), HTMLPurifier_AttrTransform_BoolToCSS::transform(), HTMLPurifier_AttrTransform_BgColor::transform(), and HTMLPurifier_AttrTransform_Background::transform().

HTMLPurifier_AttrTransform::transform ( attr,
config,
context 
) [abstract]

Abstract: makes changes to the attributes dependent on multiple values.

Parameters:
$attrAssoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr
$configMandatory HTMLPurifier_Config object.
$contextMandatory HTMLPurifier_Context object
Returns:
Processed attribute array.

Reimplemented in HTMLPurifier_AttrTransform_Background, HTMLPurifier_AttrTransform_BdoDir, HTMLPurifier_AttrTransform_BgColor, HTMLPurifier_AttrTransform_BoolToCSS, HTMLPurifier_AttrTransform_Border, HTMLPurifier_AttrTransform_EnumToCSS, HTMLPurifier_AttrTransform_ImgRequired, HTMLPurifier_AttrTransform_ImgSpace, HTMLPurifier_AttrTransform_Input, HTMLPurifier_AttrTransform_Lang, HTMLPurifier_AttrTransform_Length, HTMLPurifier_AttrTransform_Name, HTMLPurifier_AttrTransform_NameSync, HTMLPurifier_AttrTransform_Nofollow, HTMLPurifier_AttrTransform_SafeEmbed, HTMLPurifier_AttrTransform_SafeObject, HTMLPurifier_AttrTransform_SafeParam, HTMLPurifier_AttrTransform_ScriptRequired, HTMLPurifier_AttrTransform_TargetBlank, HTMLPurifier_AttrTransform_Textarea, HTMLPurifier_AttrTransform_Background, HTMLPurifier_AttrTransform_BdoDir, HTMLPurifier_AttrTransform_BgColor, HTMLPurifier_AttrTransform_BoolToCSS, HTMLPurifier_AttrTransform_Border, HTMLPurifier_AttrTransform_EnumToCSS, HTMLPurifier_AttrTransform_ImgRequired, HTMLPurifier_AttrTransform_ImgSpace, HTMLPurifier_AttrTransform_Input, HTMLPurifier_AttrTransform_Lang, HTMLPurifier_AttrTransform_Length, HTMLPurifier_AttrTransform_Name, HTMLPurifier_AttrTransform_NameSync, HTMLPurifier_AttrTransform_Nofollow, HTMLPurifier_AttrTransform_SafeEmbed, HTMLPurifier_AttrTransform_SafeObject, HTMLPurifier_AttrTransform_SafeParam, HTMLPurifier_AttrTransform_ScriptRequired, HTMLPurifier_AttrTransform_TargetBlank, and HTMLPurifier_AttrTransform_Textarea.

HTMLPurifier_AttrTransform::transform ( attr,
config,
context 
) [abstract]

Abstract: makes changes to the attributes dependent on multiple values.

Parameters:
$attrAssoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr
$configMandatory HTMLPurifier_Config object.
$contextMandatory HTMLPurifier_Context object
Returns:
Processed attribute array.

Reimplemented in HTMLPurifier_AttrTransform_Background, HTMLPurifier_AttrTransform_BdoDir, HTMLPurifier_AttrTransform_BgColor, HTMLPurifier_AttrTransform_BoolToCSS, HTMLPurifier_AttrTransform_Border, HTMLPurifier_AttrTransform_EnumToCSS, HTMLPurifier_AttrTransform_ImgRequired, HTMLPurifier_AttrTransform_ImgSpace, HTMLPurifier_AttrTransform_Input, HTMLPurifier_AttrTransform_Lang, HTMLPurifier_AttrTransform_Length, HTMLPurifier_AttrTransform_Name, HTMLPurifier_AttrTransform_NameSync, HTMLPurifier_AttrTransform_Nofollow, HTMLPurifier_AttrTransform_SafeEmbed, HTMLPurifier_AttrTransform_SafeObject, HTMLPurifier_AttrTransform_SafeParam, HTMLPurifier_AttrTransform_ScriptRequired, HTMLPurifier_AttrTransform_TargetBlank, HTMLPurifier_AttrTransform_Textarea, HTMLPurifier_AttrTransform_Background, HTMLPurifier_AttrTransform_BdoDir, HTMLPurifier_AttrTransform_BgColor, HTMLPurifier_AttrTransform_BoolToCSS, HTMLPurifier_AttrTransform_Border, HTMLPurifier_AttrTransform_EnumToCSS, HTMLPurifier_AttrTransform_ImgRequired, HTMLPurifier_AttrTransform_ImgSpace, HTMLPurifier_AttrTransform_Input, HTMLPurifier_AttrTransform_Lang, HTMLPurifier_AttrTransform_Length, HTMLPurifier_AttrTransform_Name, HTMLPurifier_AttrTransform_NameSync, HTMLPurifier_AttrTransform_Nofollow, HTMLPurifier_AttrTransform_SafeEmbed, HTMLPurifier_AttrTransform_SafeObject, HTMLPurifier_AttrTransform_SafeParam, HTMLPurifier_AttrTransform_ScriptRequired, HTMLPurifier_AttrTransform_TargetBlank, and HTMLPurifier_AttrTransform_Textarea.


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