PHP 클래스 HTMLPurifier_Injector, yii

This enables "formatter-like" functionality such as auto-paragraphing, smiley-ification and linkification to take place.
파일 보기 프로젝트 열기: yiisoft/yii 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$name Advisory name of injector, this is for friendly error messages.
$needed Array of elements and attributes this injector creates and therefore need to be allowed by the definition. Takes form of array('element' => array('attr', 'attr2'), 'element2')

보호된 프로퍼티들

프로퍼티 타입 설명
$currentNesting Reference to CurrentNesting variable in Context. This is an array list of tokens that we are currently "inside"
$currentToken Reference to current token.
$htmlDefinition
$inputZipper Reference to InputZipper variable in Context.
$rewindOffset Number of elements to rewind backwards (relative).

공개 메소드들

메소드 설명
allowsElement ( string $name ) : boolean Tests if the context node allows a certain element
checkNeeded ( HTMLPurifier_Config $config ) : boolean | string This function checks if the HTML environment will work with the Injector: if p tags are not allowed, the Auto-Paragraphing injector should not be enabled.
getRewindOffset ( ) : boolean | integer Retrieves rewind offset, and then unsets it.
handleElement ( &$token ) Handler that is called when a start or empty token is processed
handleEnd ( &$token ) Handler that is called when an end token is processed
handleText ( &$token ) Handler that is called when a text token is processed
notifyEnd ( HTMLPurifier_Token $token ) Notifier that is called when an end token is processed
prepare ( HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : boolean | string Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. This function also checks if the HTML environment will work with the Injector (see checkNeeded()).
rewindOffset ( boolean | integer $offset ) Rewind to a spot to re-perform processing. This is useful if you deleted a node, and now need to see if this change affected any earlier nodes. Rewinding does not affect other injectors, and can result in infinite loops if not used carefully.

보호된 메소드들

메소드 설명
backward ( integer &$i, HTMLPurifier_Token &$current ) : boolean Iterator function, starts with the previous token and continues until you reach the beginning of input tokens.
forward ( integer &$i, HTMLPurifier_Token &$current ) : boolean Iterator function, which starts with the next token and continues until you reach the end of the input tokens.
forwardUntilEndToken ( integer &$i, HTMLPurifier_Token &$current, integer &$nesting ) : boolean Similar to _forward, but accepts a third parameter $nesting (which should be initialized at 0) and stops when we hit the end tag for the node $this->inputIndex starts in.

메소드 상세

allowsElement() 공개 메소드

Tests if the context node allows a certain element
public allowsElement ( string $name ) : boolean
$name string Name of element to test for
리턴 boolean True if element is allowed, false if it is not

backward() 보호된 메소드

Iterator function, starts with the previous token and continues until you reach the beginning of input tokens.
protected backward ( integer &$i, HTMLPurifier_Token &$current ) : boolean
$i integer Current integer index variable for inputTokens
$current HTMLPurifier_Token Current token variable. Do NOT use $token, as that variable is also a reference
리턴 boolean

checkNeeded() 공개 메소드

This function checks if the HTML environment will work with the Injector: if p tags are not allowed, the Auto-Paragraphing injector should not be enabled.
public checkNeeded ( HTMLPurifier_Config $config ) : boolean | string
$config HTMLPurifier_Config
리턴 boolean | string Boolean false if success, string of missing needed element/attribute if failure

forward() 보호된 메소드

Iterator function, which starts with the next token and continues until you reach the end of the input tokens.
protected forward ( integer &$i, HTMLPurifier_Token &$current ) : boolean
$i integer Current integer index variable for inputTokens
$current HTMLPurifier_Token Current token variable. Do NOT use $token, as that variable is also a reference
리턴 boolean

forwardUntilEndToken() 보호된 메소드

Similar to _forward, but accepts a third parameter $nesting (which should be initialized at 0) and stops when we hit the end tag for the node $this->inputIndex starts in.
protected forwardUntilEndToken ( integer &$i, HTMLPurifier_Token &$current, integer &$nesting ) : boolean
$i integer Current integer index variable for inputTokens
$current HTMLPurifier_Token Current token variable. Do NOT use $token, as that variable is also a reference
$nesting integer
리턴 boolean

getRewindOffset() 공개 메소드

Retrieves rewind offset, and then unsets it.
public getRewindOffset ( ) : boolean | integer
리턴 boolean | integer

handleElement() 공개 메소드

Handler that is called when a start or empty token is processed
public handleElement ( &$token )

handleEnd() 공개 메소드

Handler that is called when an end token is processed
public handleEnd ( &$token )

handleText() 공개 메소드

Handler that is called when a text token is processed
public handleText ( &$token )

notifyEnd() 공개 메소드

Notifier that is called when an end token is processed
사용 중단:
public notifyEnd ( HTMLPurifier_Token $token )
$token HTMLPurifier_Token Current token variable.

prepare() 공개 메소드

Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. This function also checks if the HTML environment will work with the Injector (see checkNeeded()).
public prepare ( HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : boolean | string
$config HTMLPurifier_Config
$context HTMLPurifier_Context
리턴 boolean | string Boolean false if success, string of missing needed element/attribute if failure

rewindOffset() 공개 메소드

Rewind to a spot to re-perform processing. This is useful if you deleted a node, and now need to see if this change affected any earlier nodes. Rewinding does not affect other injectors, and can result in infinite loops if not used carefully.
public rewindOffset ( boolean | integer $offset )
$offset boolean | integer

프로퍼티 상세

$currentNesting 보호되어 있는 프로퍼티

Reference to CurrentNesting variable in Context. This is an array list of tokens that we are currently "inside"
protected $currentNesting

$currentToken 보호되어 있는 프로퍼티

Reference to current token.
protected $currentToken

$htmlDefinition 보호되어 있는 프로퍼티

protected $htmlDefinition

$inputZipper 보호되어 있는 프로퍼티

Reference to InputZipper variable in Context.
protected $inputZipper

$name 공개적으로 프로퍼티

Advisory name of injector, this is for friendly error messages.
public $name

$needed 공개적으로 프로퍼티

Array of elements and attributes this injector creates and therefore need to be allowed by the definition. Takes form of array('element' => array('attr', 'attr2'), 'element2')
public $needed

$rewindOffset 보호되어 있는 프로퍼티

Number of elements to rewind backwards (relative).
protected $rewindOffset