PHP 클래스 HTMLPurifier_HTMLModule, yii

파일 보기 프로젝트 열기: yiisoft/yii 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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