HTMLPurifier 4.4.0
HTMLPurifier_HTMLModule_Tidy Class Reference

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

Inheritance diagram for HTMLPurifier_HTMLModule_Tidy:
HTMLPurifier_HTMLModule HTMLPurifier_HTMLModule HTMLPurifier_HTMLModule_Tidy_Name HTMLPurifier_HTMLModule_Tidy_Name HTMLPurifier_HTMLModule_Tidy_Proprietary HTMLPurifier_HTMLModule_Tidy_Proprietary HTMLPurifier_HTMLModule_Tidy_XHTML HTMLPurifier_HTMLModule_Tidy_XHTML HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4

List of all members.

Public Member Functions

 setup ($config)
 Lazy load constructs the module by determining the necessary fixes to create and then delegating to the populate() function.
 getFixesForLevel ($level)
 Retrieves all fixes per a level, returning fixes for that specific level as well as all levels below it.
 makeFixesForLevel ($fixes)
 Dynamically populates the $fixesForLevel member variable using the fixes array.
 populate ($fixes)
 Populates the module with transforms and other special-case code based on a list of fixes passed to it.
 getFixType ($name)
 Parses a fix name and determines what kind of fix it is, as well as other information defined by the fix.
 makeFixes ()
 Defines all fixes the module will perform in a compact associative array of fix name to fix implementation.
 setup ($config)
 Lazy load constructs the module by determining the necessary fixes to create and then delegating to the populate() function.
 getFixesForLevel ($level)
 Retrieves all fixes per a level, returning fixes for that specific level as well as all levels below it.
 makeFixesForLevel ($fixes)
 Dynamically populates the $fixesForLevel member variable using the fixes array.
 populate ($fixes)
 Populates the module with transforms and other special-case code based on a list of fixes passed to it.
 getFixType ($name)
 Parses a fix name and determines what kind of fix it is, as well as other information defined by the fix.
 makeFixes ()
 Defines all fixes the module will perform in a compact associative array of fix name to fix implementation.

Public Attributes

 $levels = array(0 => 'none', 'light', 'medium', 'heavy')
 List of supported levels.
 $defaultLevel = null
 Default level to place all fixes in.
 $fixesForLevel
 Lists of fixes used by getFixesForLevel().

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
Todo:
Figure out how to protect some of these methods/properties

Definition at line 8 of file Tidy.php.


Member Function Documentation

HTMLPurifier_HTMLModule_Tidy::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.

Referenced by setup().

HTMLPurifier_HTMLModule_Tidy::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 13597 of file HTMLPurifier.standalone.php.

HTMLPurifier_HTMLModule_Tidy::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.

References HTMLPurifier_HTMLModule::$name.

Referenced by populate().

HTMLPurifier_HTMLModule_Tidy::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 13696 of file HTMLPurifier.standalone.php.

References HTMLPurifier_HTMLModule::$name.

HTMLPurifier_HTMLModule_Tidy::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.

Referenced by setup().

HTMLPurifier_HTMLModule_Tidy::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 13627 of file HTMLPurifier.standalone.php.

HTMLPurifier_HTMLModule_Tidy::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.

References HTMLPurifier_HTMLModule::$name, HTMLPurifier_HTMLModule::addBlankElement(), and getFixType().

Referenced by setup().

HTMLPurifier_HTMLModule_Tidy::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 13644 of file HTMLPurifier.standalone.php.

References HTMLPurifier_HTMLModule::$name, HTMLPurifier_HTMLModule::addBlankElement(), and getFixType().

HTMLPurifier_HTMLModule_Tidy::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 13562 of file HTMLPurifier.standalone.php.

References $config, HTMLPurifier_HTMLModule::$name, getFixesForLevel(), makeFixes(), makeFixesForLevel(), and populate().

HTMLPurifier_HTMLModule_Tidy::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.

References $config, HTMLPurifier_HTMLModule::$name, getFixesForLevel(), makeFixes(), makeFixesForLevel(), and populate().


Member Data Documentation

HTMLPurifier_HTMLModule_Tidy::$defaultLevel = null
HTMLPurifier_HTMLModule_Tidy::$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.

HTMLPurifier_HTMLModule_Tidy::$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 files: