Property | Type | Description | |
---|---|---|---|
$attr_collections | 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. | ||
$content_sets | 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. | ||
$defines_child_def | 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! | ||
$elements | Not used in any significant way. | ||
$info | Some definitions may be incomplete, to be merged in later with the full definition. | ||
$info_attr_transform_post | List of HTMLPurifier_AttrTransform to be performed after validation. | ||
$info_attr_transform_pre | List of HTMLPurifier_AttrTransform to be performed before validation. | ||
$info_injector | 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. | ||
$info_tag_transform | Associative array of deprecated tag name to HTMLPurifier_TagTransform. | ||
$name | Short unique string identifier of the module. | ||
$safe | 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") |
Method | Description | |
---|---|---|
addBlankElement ( string $element ) : HTMLPurifier_ElementDef | Convenience function that creates a totally blank, non-standalone element. | |
addElement ( string $element, string | boolean $type, string $contents, array $attr_includes = [], array $attr = [] ) : HTMLPurifier_ElementDef | Convenience function that sets up a new element | |
addElementToContentSet ( string $element, string $type ) | Convenience function that registers an element to a content set | |
getChildDef ( HTMLPurifier_ElementDef $def ) : HTMLPurifier_ChildDef | 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. | |
makeLookup ( string $list ) : array | Convenience function that generates a lookup table with boolean true as value. | |
mergeInAttrIncludes ( array &$attr, array $attr_includes ) | Convenience function that merges a list of attribute includes into an attribute array. | |
parseContents ( string $contents ) : array | Convenience function that transforms single-string contents into separate content model and content model type | |
setup ( HTMLPurifier_Config $config ) | Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available. |
public addBlankElement ( string $element ) : HTMLPurifier_ElementDef | ||
$element | string | Name of element to create |
return | HTMLPurifier_ElementDef | Created element |
public addElement ( string $element, string | boolean $type, string $contents, array $attr_includes = [], array $attr = [] ) : HTMLPurifier_ElementDef | ||
$element | string | Name of element to add |
$type | string | boolean | What content set should element be registered to? Set as false to skip this step. |
$contents | string | Allowed children in form of: "$content_model_type: $content_model" |
$attr_includes | array | What attribute collections to register to element? |
$attr | array | What unique attributes does the element define? |
return | HTMLPurifier_ElementDef | Created element definition object, so you can set advanced parameters |
public addElementToContentSet ( string $element, string $type ) | ||
$element | string | Element to register |
$type | string | Name content set (warning: case sensitive, usually upper-case first letter) |
public getChildDef ( HTMLPurifier_ElementDef $def ) : HTMLPurifier_ChildDef | ||
$def | HTMLPurifier_ElementDef | |
return | HTMLPurifier_ChildDef | subclass |
public makeLookup ( string $list ) : array | ||
$list | string | List of values to turn into a lookup |
return | array | array equivalent of list |
public mergeInAttrIncludes ( array &$attr, array $attr_includes ) | ||
$attr | array | Reference to attr array to modify |
$attr_includes | array | Array of includes / string include to merge in |
public parseContents ( string $contents ) : array | ||
$contents | string | Allowed children in form of: "$content_model_type: $content_model" |
return | array |
public setup ( HTMLPurifier_Config $config ) | ||
$config | HTMLPurifier_Config |
public $attr_collections |
public $content_sets |
public $defines_child_def |
public $info |
public $info_attr_transform_post |
public $info_attr_transform_pre |
public $info_injector |
public $info_tag_transform |
public $safe |