Cheetah
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
HTMLPurifier_HTMLDefinition Class Reference
Inheritance diagram for HTMLPurifier_HTMLDefinition:
HTMLPurifier_Definition

Public Member Functions

 addAttribute ($element_name, $attr_name, $def)
 
 addElement ($element_name, $type, $contents, $attr_collections, $attributes=array())
 
 addBlankElement ($element_name)
 
 getAnonymousModule ()
 
 __construct ()
 
 parseTinyMCEAllowedList ($list)
 
- Public Member Functions inherited from HTMLPurifier_Definition
 setup ($config)
 

Public Attributes

 $info = array()
 
 $info_global_attr = array()
 
 $info_parent = 'div'
 
 $info_parent_def
 
 $info_block_wrapper = 'p'
 
 $info_tag_transform = array()
 
 $info_attr_transform_pre = array()
 
 $info_attr_transform_post = array()
 
 $info_content_sets = array()
 
 $info_injector = array()
 
 $doctype
 
 $type = 'HTML'
 
 $manager
 
- Public Attributes inherited from HTMLPurifier_Definition
 $setup = false
 
 $optimized = null
 
 $type
 

Protected Member Functions

 doSetup ($config)
 
 processModules ($config)
 
 setupConfigStuff ($config)
 

Detailed 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.

Note
This class is inspected by Printer_HTMLDefinition; please update that class if things here change.
Warning
Directives that change this object's structure must be in the HTML or Attr namespace!

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

Constructor & Destructor Documentation

◆ __construct()

HTMLPurifier_HTMLDefinition::__construct ( )

Performs low-cost, preliminary initialization.

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

Member Function Documentation

◆ addAttribute()

HTMLPurifier_HTMLDefinition::addAttribute (   $element_name,
  $attr_name,
  $def 
)

Adds a custom attribute to a pre-existing element

Note
This is strictly convenience, and does not have a corresponding method in HTMLPurifier_HTMLModule
Parameters
string$element_nameElement name to add attribute to
string$attr_nameName of attribute
mixed$defAttribute definition, can be string or object, see HTMLPurifier_AttrTypes for details

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

◆ addBlankElement()

HTMLPurifier_HTMLDefinition::addBlankElement (   $element_name)

Adds a blank element to your HTML definition, for overriding existing behavior

Parameters
string$element_name
Returns
HTMLPurifier_ElementDef
See also
HTMLPurifier_HTMLModule::addBlankElement() for detailed parameter and return value descriptions.

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

◆ addElement()

HTMLPurifier_HTMLDefinition::addElement (   $element_name,
  $type,
  $contents,
  $attr_collections,
  $attributes = array() 
)

Adds a custom element to your HTML definition

See also
HTMLPurifier_HTMLModule::addElement() for detailed parameter and return value descriptions.

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

◆ doSetup()

HTMLPurifier_HTMLDefinition::doSetup (   $config)
protected
Parameters
HTMLPurifier_Config$config

Reimplemented from HTMLPurifier_Definition.

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

◆ getAnonymousModule()

HTMLPurifier_HTMLDefinition::getAnonymousModule ( )

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

Returns
HTMLPurifier_HTMLModule

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

◆ parseTinyMCEAllowedList()

HTMLPurifier_HTMLDefinition::parseTinyMCEAllowedList (   $list)

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

Warning
Although it's largely drawn from TinyMCE's implementation, it is different, and you'll probably have to modify your lists
Parameters
array$listString list to parse
Returns
array

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

◆ processModules()

HTMLPurifier_HTMLDefinition::processModules (   $config)
protected

Extract out the information from the manager

Parameters
HTMLPurifier_Config$config

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

◆ setupConfigStuff()

HTMLPurifier_HTMLDefinition::setupConfigStuff (   $config)
protected

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

Parameters
HTMLPurifier_Config$config

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

Member Data Documentation

◆ $doctype

HTMLPurifier_HTMLDefinition::$doctype

Doctype object @type HTMLPurifier_Doctype

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

◆ $info

HTMLPurifier_HTMLDefinition::$info = array()

Associative array of element names to HTMLPurifier_ElementDef. @type HTMLPurifier_ElementDef[]

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

◆ $info_attr_transform_post

HTMLPurifier_HTMLDefinition::$info_attr_transform_post = array()

Indexed list of HTMLPurifier_AttrTransform to be performed after validation. @type HTMLPurifier_AttrTransform[]

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

◆ $info_attr_transform_pre

HTMLPurifier_HTMLDefinition::$info_attr_transform_pre = array()

Indexed list of HTMLPurifier_AttrTransform to be performed before validation. @type HTMLPurifier_AttrTransform[]

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

◆ $info_block_wrapper

HTMLPurifier_HTMLDefinition::$info_block_wrapper = 'p'

String name of element used to wrap inline elements in block context. @type string

Note
This is rarely used except for BLOCKQUOTEs in strict mode

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

◆ $info_content_sets

HTMLPurifier_HTMLDefinition::$info_content_sets = array()

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

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

◆ $info_global_attr

HTMLPurifier_HTMLDefinition::$info_global_attr = array()

Associative array of global attribute name to attribute definition. @type array

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

◆ $info_injector

HTMLPurifier_HTMLDefinition::$info_injector = array()

Indexed list of HTMLPurifier_Injector to be used. @type HTMLPurifier_Injector[]

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

◆ $info_parent

HTMLPurifier_HTMLDefinition::$info_parent = 'div'

String name of parent element HTML will be going into. @type string

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

◆ $info_parent_def

HTMLPurifier_HTMLDefinition::$info_parent_def

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

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

◆ $info_tag_transform

HTMLPurifier_HTMLDefinition::$info_tag_transform = array()

Associative array of deprecated tag name to HTMLPurifier_TagTransform. @type array

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

◆ $manager

HTMLPurifier_HTMLDefinition::$manager

◆ $type

HTMLPurifier_HTMLDefinition::$type = 'HTML'

@type string

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


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