Moodle  2.2.1
http://www.collinsharper.com
HTMLPurifier_HTMLModule_Tidy Class Reference
Inheritance diagram for HTMLPurifier_HTMLModule_Tidy:
Collaboration diagram for HTMLPurifier_HTMLModule_Tidy:

Public Member Functions

 setup ($config)
 getFixesForLevel ($level)
 makeFixesForLevel ($fixes)
 populate ($fixes)
 getFixType ($name)
 makeFixes ()

Data Fields

 $levels = array(0 => 'none', 'light', 'medium', 'heavy')
 $defaultLevel = null
 $fixesForLevel

Detailed Description

Abstract class for a set of proprietary modules that clean up (tidy) poorly written HTML.

Todo:
Figure out how to protect some of these methods/properties

Definition at line 8 of file Tidy.php.


Member Function Documentation

getFixesForLevel ( level)

Retrieves all fixes per a level, returning fixes for that specific level as well as all levels below it.

Parameters:
$levelString level identifier, see $levels for valid values
Returns:
Lookup up table of fixes

Definition at line 73 of file Tidy.php.

Here is the caller graph for this function:

getFixType ( name)

Parses a fix name and determines what kind of fix it is, as well as other information defined by the fix

Parameters:
$nameString name of fix
Returns:
array(string $fix_type, array $fix_parameters)
Note:
$fix_parameters is type dependant, see populate() for usage of these parameters

Definition at line 172 of file Tidy.php.

Here is the caller graph for this function:

makeFixes ( )

Defines all fixes the module will perform in a compact associative array of fix name to fix implementation.

Reimplemented in HTMLPurifier_HTMLModule_Tidy_Name, HTMLPurifier_HTMLModule_Tidy_Proprietary, HTMLPurifier_HTMLModule_Tidy_XHTML, HTMLPurifier_HTMLModule_Tidy_Strict, and HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4.

Definition at line 203 of file Tidy.php.

Here is the caller graph for this function:

makeFixesForLevel ( fixes)

Dynamically populates the $fixesForLevel member variable using the fixes array. It may be custom overloaded, used in conjunction with $defaultLevel, or not used at all.

Definition at line 103 of file Tidy.php.

Here is the caller graph for this function:

populate ( fixes)

Populates the module with transforms and other special-case code based on a list of fixes passed to it

Parameters:
$lookupLookup table of fixes to activate

Definition at line 120 of file Tidy.php.

Here is the call graph for this function:

Here is the caller graph for this function:

setup ( config)

Lazy load constructs the module by determining the necessary fixes to create and then delegating to the populate() function.

Todo:
Wildcard matching and error reporting when an added or subtracted fix has no effect.

Reimplemented from HTMLPurifier_HTMLModule.

Definition at line 38 of file Tidy.php.

Here is the call graph for this function:


Field Documentation

$defaultLevel = null
$fixesForLevel
Initial value:
 array(
        'light'  => array(),
        'medium' => array(),
        'heavy'  => array()
    )

Lists of fixes used by getFixesForLevel(). Format is: HTMLModule_Tidy->fixesForLevel[$level] = array('fix-1', 'fix-2');

Definition at line 26 of file Tidy.php.

$levels = array(0 => 'none', 'light', 'medium', 'heavy')

List of supported levels. Index zero is a special case "no fixes" level.

Definition at line 15 of file Tidy.php.


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