Moodle  2.2.1
http://www.collinsharper.com
HTMLPurifier_Generator Class Reference

Public Member Functions

 __construct ($config, $context)
 generateFromTokens ($tokens)
 generateFromToken ($token)
 generateScriptFromToken ($token)
 generateAttributes ($assoc_array_of_attributes, $element=false)
 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

Definition at line 10 of file Generator.php.


Constructor & Destructor Documentation

__construct ( config,
context 
)
Parameters:
$configInstance of HTMLPurifier_Config
$contextInstance of HTMLPurifier_Context

Definition at line 59 of file Generator.php.


Member Function Documentation

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:
$stringString data to escape for HTML.
$quoteQuoting style, like htmlspecialchars. ENT_NOQUOTES is permissible for non-attribute output.
Returns:
String escaped data.

Definition at line 245 of file Generator.php.

Here is the caller graph for this function:

generateAttributes ( assoc_array_of_attributes,
element = false 
)

Generates attribute declarations from attribute array.

Note:
This does not include the leading or trailing space.
Parameters:
$assoc_array_of_attributesAttribute array
$elementName of element attributes are for, used to check attribute minimization.
Returns:
Generate HTML fragment for insertion.

Definition at line 186 of file Generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

generateFromToken ( token)

Generates HTML from a single token.

Parameters:
$tokenHTMLPurifier_Token object.
Returns:
Generated HTML

Definition at line 120 of file Generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:

generateFromTokens ( tokens)

Generates HTML from an array of tokens.

Parameters:
$tokensArray of HTMLPurifier_Token
$configHTMLPurifier_Config object
Returns:
Generated HTML

Definition at line 75 of file Generator.php.

Here is the call graph for this function:

Special case processor for the contents of script tags

Warning:
This runs into problems if there's already a literal --> somewhere inside the script contents.

Definition at line 171 of file Generator.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

$config [protected]

Configuration for the generator

Definition at line 53 of file Generator.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations