Class HTMLPurifier_HTMLModule

Description

Represents an XHTML 1.1 module, with information on elements, tags and attributes.

  • todo: Consider making some member functions protected

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


	
			
Direct descendents
Class Description
HTMLPurifier_HTMLModule_Bdo XHTML 1.1 Bi-directional Text Module, defines elements that declare directionality of content. Text Extension Module.
HTMLPurifier_HTMLModule_CommonAttributes Represents an XHTML 1.1 module, with information on elements, tags and attributes.
HTMLPurifier_HTMLModule_Edit XHTML 1.1 Edit Module, defines editing-related elements. Text Extension Module.
HTMLPurifier_HTMLModule_Forms XHTML 1.1 Forms module, defines all form-related elements found in HTML 4.
HTMLPurifier_HTMLModule_Hypertext XHTML 1.1 Hypertext Module, defines hypertext links. Core Module.
HTMLPurifier_HTMLModule_Image XHTML 1.1 Image Module provides basic image embedding.
HTMLPurifier_HTMLModule_Legacy XHTML 1.1 Legacy module defines elements that were previously deprecated.
HTMLPurifier_HTMLModule_List XHTML 1.1 List Module, defines list-oriented elements. Core Module.
HTMLPurifier_HTMLModule_Name Represents an XHTML 1.1 module, with information on elements, tags and attributes.
HTMLPurifier_HTMLModule_NonXMLCommonAttributes Represents an XHTML 1.1 module, with information on elements, tags and attributes.
HTMLPurifier_HTMLModule_Object XHTML 1.1 Object Module, defines elements for generic object inclusion
HTMLPurifier_HTMLModule_Presentation XHTML 1.1 Presentation Module, defines simple presentation-related markup. Text Extension Module.
HTMLPurifier_HTMLModule_Proprietary Module defines proprietary tags and attributes in HTML.
HTMLPurifier_HTMLModule_Ruby XHTML 1.1 Ruby Annotation Module, defines elements that indicate short runs of text alongside base text for annotation or pronounciation.
HTMLPurifier_HTMLModule_SafeEmbed A "safe" embed module. See SafeObject. This is a proprietary element.
HTMLPurifier_HTMLModule_SafeObject A "safe" object module. In theory, objects permitted by this module will be safe, and untrusted users can be allowed to embed arbitrary flash objects (maybe other types too, but only Flash is supported as of right now).
HTMLPurifier_HTMLModule_Scripting XHTML 1.1 Scripting module, defines elements that are used to contain information pertaining to executable scripts or the lack of support for executable scripts.
HTMLPurifier_HTMLModule_StyleAttribute XHTML 1.1 Edit Module, defines editing-related elements. Text Extension Module.
HTMLPurifier_HTMLModule_Tables XHTML 1.1 Tables Module, fully defines accessible table elements.
HTMLPurifier_HTMLModule_Target XHTML 1.1 Target Module, defines target attribute in link elements.
HTMLPurifier_HTMLModule_Text XHTML 1.1 Text Module, defines basic text containers. Core Module.
HTMLPurifier_HTMLModule_Tidy Abstract class for a set of proprietary modules that clean up (tidy) poorly written HTML.
HTMLPurifier_HTMLModule_XMLCommonAttributes Represents an XHTML 1.1 module, with information on elements, tags and attributes.
Variable Summary
Method Summary
Created addBlankElement ($element $element)
Created addElement ($element $element, $type $type, $contents $contents, [$attr_includes $attr_includes = array()], [$attr $attr = array()])
void addElementToContentSet (Element $element, Name $type)
Lookup makeLookup ($list $list)
void mergeInAttrIncludes ($attr &$attr, $attr_includes $attr_includes)
void parseContents ($contents $contents)
void setup ($config $config)
Variables
mixed $attr_collections = array() (line 4490)

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.

  • access: public

Redefined in descendants as:
mixed $content_sets = array() (line 4480)

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.

  • access: public

Redefined in descendants as:
mixed $defines_child_def = false (line 4521)

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!

  • access: public

Redefined in descendants as:
mixed $elements = array() (line 4465)

Informally, a list of elements this module changes. Not used in any significant way.

  • access: public

Redefined in descendants as:
mixed $info = array() (line 4472)

Associative array of element names to element definitions.

Some definitions may be incomplete, to be merged in later with the full definition.

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

List of HTMLPurifier_AttrTransform to be performed after validation.

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

List of HTMLPurifier_AttrTransform to be performed before validation.

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

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.

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

Associative array of deprecated tag name to HTMLPurifier_TagTransform

  • access: public
mixed $safe = true (line 4535)

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")

  • access: public

Redefined in descendants as:
Methods
addBlankElement (line 4586)

Convenience function that creates a totally blank, non-standalone element.

  • return: element
  • access: public
Created addBlankElement ($element $element)
  • $element $element: Name of element to create
addElement (line 4563)

Convenience function that sets up a new element

  • return: element definition object, so you can set advanced parameters
  • access: public
Created addElement ($element $element, $type $type, $contents $contents, [$attr_includes $attr_includes = array()], [$attr $attr = array()])
  • $element $element: Name of element to add
  • $type $type: What content set should element be registered to? Set as false to skip this step.
  • $contents $contents: Allowed children in form of: "$content_model_type: $content_model"
  • $attr_includes $attr_includes: What attribute collections to register to element?
  • $attr $attr: What unique attributes does the element define?
addElementToContentSet (line 4603)

Convenience function that registers an element to a content set

  • access: public
void addElementToContentSet (Element $element, Name $type)
  • Element $element: to register
  • Name $type: content set (warning: case sensitive, usually upper-case first letter)
getChildDef (line 4545)

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.

  • return: subclass
  • access: public
HTMLPurifier_ChildDef getChildDef ($def $def)
  • $def $def: HTMLPurifier_ElementDef instance

Redefined in descendants as:
makeLookup (line 4657)

Convenience function that generates a lookup table with boolean true as value.

  • return: array equivalent of list
  • access: public
Lookup makeLookup ($list $list)
  • $list $list: List of values to turn into a lookup
mergeInAttrIncludes (line 4641)

Convenience function that merges a list of attribute includes into an attribute array.

  • access: public
void mergeInAttrIncludes ($attr &$attr, $attr_includes $attr_includes)
  • $attr &$attr: Reference to attr array to modify
  • $attr_includes $attr_includes: Array of includes / string include to merge in
parseContents (line 4618)

Convenience function that transforms single-string contents

into separate content model and content model type

  • access: public
void parseContents ($contents $contents)
  • $contents $contents: Allowed children in form of: "$content_model_type: $content_model"

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