Class HTMLPurifier_AttrTransform

Description

Processes an entire attribute array for corrections needing multiple values.

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.

  • abstract:

Located in /library/HTMLPurifier/AttrTransform.php (line 17)


	
			
Direct descendents
Class Description
HTMLPurifier_AttrTransform_BdoDir Post-trasnform that ensures that bdo tags have the dir attribute set.
HTMLPurifier_AttrTransform_BgColor Pre-transform that changes deprecated bgcolor attribute to CSS.
HTMLPurifier_AttrTransform_BoolToCSS Pre-transform that changes converts a boolean attribute to fixed CSS
HTMLPurifier_AttrTransform_Border Pre-transform that changes deprecated border attribute to CSS.
HTMLPurifier_AttrTransform_EnumToCSS Generic pre-transform that converts an attribute with a fixed number of values (enumerated) to CSS.
HTMLPurifier_AttrTransform_ImgRequired Transform that supplies default values for the src and alt attributes in img tags, as well as prevents the img tag from being removed because of a missing alt tag. a pre and post attribute transform.
HTMLPurifier_AttrTransform_ImgSpace Pre-transform that changes deprecated hspace and vspace attributes to CSS
HTMLPurifier_AttrTransform_Lang Post-transform that copies lang's value to xml:lang (and vice-versa)
HTMLPurifier_AttrTransform_Length Class for handling width/height length attribute transformations to CSS
HTMLPurifier_AttrTransform_Name Pre-transform that changes deprecated name attribute to ID if necessary
HTMLPurifier_AttrTransform_SafeEmbed Processes an entire attribute array for corrections needing multiple values.
HTMLPurifier_AttrTransform_SafeObject Writes default type for all objects.
HTMLPurifier_AttrTransform_SafeParam Validates name/value pairs in param tags to be used in safe objects. will only allow name values it recognizes, and pre-fill certain attributes with required values.
HTMLPurifier_AttrTransform_ScriptRequired Implements required attribute stipulation for <script>
Method Summary
void confiscateAttr ($attr &$attr, $key $key)
void prependCSS ($attr &$attr, $css $css)
Processed transform ($attr $attr, $config $config, $context $context)
Methods
confiscateAttr (line 47)

Retrieves and removes an attribute

Retrieves and removes an attribute

  • access: public
void confiscateAttr ($attr &$attr, $key $key)
  • $attr &$attr: Attribute array to process (passed by reference)
  • $key $key: Key of attribute to confiscate
prependCSS (line 37)

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

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

  • access: public
void prependCSS ($attr &$attr, $css $css)
  • $attr &$attr: Attribute array to process (passed by reference)
  • $css $css: CSS to prepend
transform (line 29)

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

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

  • return: attribute array.
  • abstract:
  • access: public
Processed transform ($attr $attr, $config $config, $context $context)
  • $attr $attr: Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr
  • $config $config: Mandatory HTMLPurifier_Config object.
  • $context $context: Mandatory HTMLPurifier_Context object

Redefined in descendants as:

Documentation generated on Thu, 19 Jun 2008 18:48:49 -0400 by phpDocumentor 1.4.2