Öffentliche Methoden | |
rewindOffset ($offset) | |
getRewindOffset () | |
prepare ($config, $context) | |
checkNeeded ($config) | |
allowsElement ($name) | |
handleText (&$token) | |
handleElement (&$token) | |
handleEnd (&$token) | |
notifyEnd ($token) | |
Datenfelder | |
$name | |
$needed = array() | |
Geschützte Methoden | |
forward (&$i, &$current) | |
forwardUntilEndToken (&$i, &$current, &$nesting) | |
backward (&$i, &$current) | |
Geschützte Attribute | |
$htmlDefinition | |
$currentNesting | |
$currentToken | |
$inputZipper | |
$rewindOffset = false | |
Injects tokens into the document while parsing for well-formedness. This enables "formatter-like" functionality such as auto-paragraphing, smiley-ification and linkification to take place.
A note on how handlers create changes; this is done by assigning a new value to the $token reference. These values can take a variety of forms and are best described HTMLPurifier_Strategy_MakeWellFormed->processToken() documentation.
Definiert in Zeile 16 der Datei Injector.php.
allowsElement | ( | $name) |
Tests if the context node allows a certain element
string | $name | Name of element to test for |
Definiert in Zeile 147 der Datei Injector.php.
Benutzt $name.
Wird benutzt von HTMLPurifier_Injector_AutoParagraph\handleElement(), HTMLPurifier_Injector_Linkify\handleText(), HTMLPurifier_Injector_AutoParagraph\handleText() und HTMLPurifier_Injector_PurifierLinkify\handleText().
|
protected |
Iterator function, starts with the previous token and continues until you reach the beginning of input tokens.
int | $i | Current integer index variable for inputTokens |
HTMLPurifier_Token | $current | Current token variable. Do NOT use $token, as that variable is also a reference |
Definiert in Zeile 234 der Datei Injector.php.
Wird benutzt von HTMLPurifier_Injector_AutoParagraph\handleElement().
checkNeeded | ( | $config) |
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.
HTMLPurifier_Config | $config |
Definiert in Zeile 120 der Datei Injector.php.
Benutzt $name.
Wird benutzt von prepare().
|
protected |
Iterator function, which starts with the next token and continues until you reach the end of the input tokens.
int | $i | Current integer index variable for inputTokens |
HTMLPurifier_Token | $current | Current token variable. Do NOT use $token, as that variable is also a reference |
Definiert in Zeile 180 der Datei Injector.php.
Wird benutzt von forwardUntilEndToken().
|
protected |
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.
int | $i | Current integer index variable for inputTokens |
HTMLPurifier_Token | $current | Current token variable. Do NOT use $token, as that variable is also a reference |
int | $nesting |
Definiert in Zeile 204 der Datei Injector.php.
Benutzt forward().
Wird benutzt von HTMLPurifier_Injector_AutoParagraph\_pLookAhead(), HTMLPurifier_Injector_RemoveSpansWithoutAttributes\handleElement() und HTMLPurifier_Injector_AutoParagraph\handleText().
getRewindOffset | ( | ) |
Retrieves rewind offset, and then unsets it.
Definiert in Zeile 81 der Datei Injector.php.
Benutzt $rewindOffset und rewindOffset().
handleElement | ( | & | $token) |
Handler that is called when a start or empty token is processed
Definiert in Zeile 258 der Datei Injector.php.
handleEnd | ( | & | $token) |
Handler that is called when an end token is processed
Definiert in Zeile 265 der Datei Injector.php.
Benutzt notifyEnd().
handleText | ( | & | $token) |
Handler that is called when a text token is processed
Definiert in Zeile 251 der Datei Injector.php.
notifyEnd | ( | $token) |
Notifier that is called when an end token is processed
HTMLPurifier_Token | $token | Current token variable. |
Definiert in Zeile 276 der Datei Injector.php.
Wird benutzt von handleEnd().
prepare | ( | $config, | |
$context | |||
) |
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()).
HTMLPurifier_Config | $config | |
HTMLPurifier_Context | $context |
Definiert in Zeile 97 der Datei Injector.php.
Benutzt checkNeeded().
rewindOffset | ( | $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.
bool | int | $offset |
Definiert in Zeile 72 der Datei Injector.php.
Wird benutzt von getRewindOffset() und HTMLPurifier_Injector_RemoveEmpty\handleElement().
|
protected |
Reference to CurrentNesting variable in Context. This is an array list of tokens that we are currently "inside" array
Definiert in Zeile 35 der Datei Injector.php.
|
protected |
Reference to current token. HTMLPurifier_Token
Definiert in Zeile 41 der Datei Injector.php.
|
protected |
Definiert in Zeile 28 der Datei Injector.php.
|
protected |
Reference to InputZipper variable in Context. HTMLPurifier_Zipper
Definiert in Zeile 47 der Datei Injector.php.
$name |
Advisory name of injector, this is for friendly error messages. string
Definiert in Zeile 23 der Datei Injector.php.
Wird benutzt von allowsElement() und checkNeeded().
$needed = array() |
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') array
Definiert in Zeile 55 der Datei Injector.php.
|
protected |
Number of elements to rewind backwards (relative). bool|int
Definiert in Zeile 61 der Datei Injector.php.
Wird benutzt von getRewindOffset().