Class HTMLPurifier_HTMLDefinition

Description

Definition of the purified HTML that describes allowed children, attributes, and many other things.

Conventions:

All member variables that are prefixed with info (including the main $info array) are used by HTML Purifier internals and should not be directly edited when customizing the HTMLDefinition. They can usually be set via configuration directives or custom modules.

On the other hand, member variables without the info prefix are used internally by the HTMLDefinition and MUST NOT be used by other HTML Purifier internals. Many of them, however, are public, and may be edited by userspace code to tweak the behavior of HTMLDefinition.

Located in /lib/core/Parsers/htmlpurifier/HTMLPurifier.standalone.php (line 4033)

HTMLPurifier_Definition
   |
   --HTMLPurifier_HTMLDefinition
Variable Summary
Method Summary
HTMLPurifier_HTMLDefinition __construct ()
void addAttribute ($element_name $element_name, $attr_name $attr_name, $def $def)
void addBlankElement ( $element_name)
void addElement ( $element_name,  $type,  $contents,  $attr_collections, [ $attributes = array()])
void doSetup ( $config)
void parseTinyMCEAllowedList ($list $list, array($allowed_elements, $allowed_attributes))
void processModules ( $config)
void setupConfigStuff ( $config)
Variables
mixed $doctype (line 4094)

Doctype object

  • access: public
mixed $info = array() (line 4041)

Associative array of element names to HTMLPurifier_ElementDef

  • access: public
mixed $info_attr_transform_post = array() (line 4078)

Indexed list of HTMLPurifier_AttrTransform to be performed after validation.

  • access: public
mixed $info_attr_transform_pre = array() (line 4073)

Indexed list of HTMLPurifier_AttrTransform to be performed before validation.

  • access: public
mixed $info_block_wrapper = 'p' (line 4063)

String name of element used to wrap inline elements in block context

  • access: public
mixed $info_content_sets = array() (line 4084)

Nested lookup array of content set name (Block, Inline) to element name to whether or not it belongs in that content set.

  • access: public
mixed $info_global_attr = array() (line 4046)

Associative array of global attribute name to attribute definition.

  • access: public
mixed $info_injector = array() (line 4089)

Indexed list of HTMLPurifier_Injector to be used.

  • access: public
mixed $info_parent = 'div' (line 4051)

String name of parent element HTML will be going into.

  • access: public
mixed $info_parent_def (line 4057)

Definition for parent element, allows parent element to be a tag that's not allowed inside the HTML fragment.

  • access: public
mixed $info_tag_transform = array() (line 4068)

Associative array of deprecated tag name to HTMLPurifier_TagTransform

  • access: public
mixed $manager (line 4163)
  • access: public
mixed $type = 'HTML' (line 4162)
  • access: public

Redefinition of:
HTMLPurifier_Definition::$type
What type of definition is it?

Inherited Variables

Inherited from HTMLPurifier_Definition

HTMLPurifier_Definition::$setup
Methods
Constructor __construct (line 4168)

Performs low-cost, preliminary initialization.

  • access: public
HTMLPurifier_HTMLDefinition __construct ()
addAttribute (line 4109)

Adds a custom attribute to a pre-existing element

  • access: public
void addAttribute ($element_name $element_name, $attr_name $attr_name, $def $def)
  • $element_name $element_name: String element name to add attribute to
  • $attr_name $attr_name: String name of attribute
  • $def $def: Attribute definition, can be string or object, see HTMLPurifier_AttrTypes for details
addBlankElement (line 4138)

Adds a blank element to your HTML definition, for overriding

existing behavior

  • access: public
void addBlankElement ( $element_name)
  • $element_name
addElement (line 4124)

Adds a custom element to your HTML definition

  • access: public
void addElement ( $element_name,  $type,  $contents,  $attr_collections, [ $attributes = array()])
  • $element_name
  • $type
  • $contents
  • $attr_collections
  • $attributes
doSetup (line 4172)
  • access: protected
void doSetup ( $config)
  • $config

Redefinition of:
HTMLPurifier_Definition::doSetup()
Sets up the definition object into the final form, something
getAnonymousModule (line 4149)

Retrieves a reference to the anonymous module, so you can bust out advanced features without having to make your own module.

  • access: public
void getAnonymousModule ()
parseTinyMCEAllowedList (line 4399)

Parses a TinyMCE-flavored Allowed Elements and Attributes list into separate lists for processing. Format is element[attr1|attr2],element2...

  • todo: Give this its own class, probably static interface
  • access: public
void parseTinyMCEAllowedList ($list $list, array($allowed_elements, $allowed_attributes))
  • array($allowed_elements, $allowed_attributes)
  • $list $list: String list to parse
processModules (line 4187)

Extract out the information from the manager

  • access: protected
void processModules ( $config)
  • $config
setupConfigStuff (line 4227)

Sets up stuff based on config. We need a better way of doing this.

  • access: protected
void setupConfigStuff ( $config)
  • $config

Inherited Methods

Inherited From HTMLPurifier_Definition

HTMLPurifier_Definition::doSetup()
HTMLPurifier_Definition::setup()

Documentation generated on Sun, 06 Mar 2011 00:24:05 -0500 by phpDocumentor 1.4.3