API - XOOPS 2.5.11 Beta 2
By monxoops.fr
HTMLPurifier_Generator Class Reference

Public Member Functions

 __construct ($config, $context)
 
 generateFromTokens ($tokens)
 
 generateFromToken ($token)
 
 generateScriptFromToken ($token)
 
 generateAttributes ($assoc_array_of_attributes, $element='')
 
 escape ($string, $quote=null)
 

Protected Attributes

 $config
 

Detailed Description

Generates HTML from tokens.

Todo:

Refactor interface so that configuration/context is determined upon instantiation, no need for messy generateFromTokens() calls

Make some of the more internal functions protected, and have unit tests work around that

Constructor & Destructor Documentation

◆ __construct()

__construct (   $config,
  $context 
)
Parameters
HTMLPurifier_Config$config
HTMLPurifier_Context$context

Member Function Documentation

◆ escape()

escape (   $string,
  $quote = null 
)

Escapes raw text data.

Todo:
This really ought to be protected, but until we have a facility for properly generating HTML here w/o using tokens, it stays public.
Parameters
string$stringString data to escape for HTML.
int$quoteQuoting style, like htmlspecialchars. ENT_NOQUOTES is permissible for non-attribute output.
Returns
string escaped data.
Here is the caller graph for this function:

◆ generateAttributes()

generateAttributes (   $assoc_array_of_attributes,
  $element = '' 
)

Generates attribute declarations from attribute array.

Note
This does not include the leading or trailing space.
Parameters
array$assoc_array_of_attributesAttribute array
string$elementName of element attributes are for, used to check attribute minimization.
Returns
string Generated HTML fragment for insertion.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateFromToken()

generateFromToken (   $token)

Generates HTML from a single token.

Parameters
HTMLPurifier_Token$tokenHTMLPurifier_Token object.
Returns
string Generated HTML
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateFromTokens()

generateFromTokens (   $tokens)

Generates HTML from an array of tokens.

Parameters
HTMLPurifier_Token[]$tokensArray of HTMLPurifier_Token
Returns
string Generated HTML
Here is the call graph for this function:

◆ generateScriptFromToken()

generateScriptFromToken (   $token)

Special case processor for the contents of script tags

Parameters
HTMLPurifier_Token$tokenHTMLPurifier_Token object.
Returns
string
Warning
This runs into problems if there's already a literal --> somewhere inside the script contents.
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ $config

$config
protected

Configuration for the generator @type HTMLPurifier_Config


The documentation for this class was generated from the following file: