PHP Класс HTMLPurifier_HTMLModule, yii

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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")

Открытые методы

Метод Описание
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.

Описание методов

addBlankElement() публичный Метод

Convenience function that creates a totally blank, non-standalone element.
public addBlankElement ( string $element ) : HTMLPurifier_ElementDef
$element string Name of element to create
Результат HTMLPurifier_ElementDef Created element

addElement() публичный Метод

Convenience function that sets up a new 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?
Результат HTMLPurifier_ElementDef Created element definition object, so you can set advanced parameters

addElementToContentSet() публичный Метод

Convenience function that registers an element to a content set
public addElementToContentSet ( string $element, string $type )
$element string Element to register
$type string Name content set (warning: case sensitive, usually upper-case first letter)

getChildDef() публичный Метод

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.
public getChildDef ( HTMLPurifier_ElementDef $def ) : HTMLPurifier_ChildDef
$def HTMLPurifier_ElementDef
Результат HTMLPurifier_ChildDef subclass

makeLookup() публичный Метод

Convenience function that generates a lookup table with boolean true as value.
public makeLookup ( string $list ) : array
$list string List of values to turn into a lookup
Результат array array equivalent of list

mergeInAttrIncludes() публичный Метод

Convenience function that merges a list of attribute includes into an attribute array.
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

parseContents() публичный Метод

Convenience function that transforms single-string contents into separate content model and content model type
public parseContents ( string $contents ) : array
$contents string Allowed children in form of: "$content_model_type: $content_model"
Результат array

setup() публичный Метод

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.
public setup ( HTMLPurifier_Config $config )
$config HTMLPurifier_Config

Описание свойств

$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.
public $attr_collections

$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.
public $content_sets

$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!
public $defines_child_def

$elements публичное свойство

Not used in any significant way.
public $elements

$info публичное свойство

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

$info_attr_transform_post публичное свойство

List of HTMLPurifier_AttrTransform to be performed after validation.
public $info_attr_transform_post

$info_attr_transform_pre публичное свойство

List of HTMLPurifier_AttrTransform to be performed before validation.
public $info_attr_transform_pre

$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.
public $info_injector

$info_tag_transform публичное свойство

Associative array of deprecated tag name to HTMLPurifier_TagTransform.
public $info_tag_transform

$name публичное свойство

Short unique string identifier of the module.
public $name

$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")
public $safe