XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
HTMLPurifier_HTMLModule_Tidy Class Reference
Inheritance diagram for HTMLPurifier_HTMLModule_Tidy:
Inheritance graph

Public Member Functions

 getFixesForLevel ($level)
 
 getFixType ($name)
 
 makeFixes ()
 
 makeFixesForLevel ($fixes)
 
 populate ($fixes)
 
 setup ($config)
 
- Public Member Functions inherited from HTMLPurifier_HTMLModule
 addBlankElement ($element)
 
 addElement ($element, $type, $contents, $attr_includes=array(), $attr=array())
 
 addElementToContentSet ($element, $type)
 
 getChildDef ($def)
 
 makeLookup ($list)
 
 mergeInAttrIncludes (&$attr, $attr_includes)
 
 parseContents ($contents)
 
 setup ($config)
 

Public Attributes

 $defaultLevel = null
 
 $fixesForLevel
 
 $levels = array(0 => 'none', 'light', 'medium', 'heavy')
 
- Public Attributes inherited from HTMLPurifier_HTMLModule
 $attr_collections = array()
 
 $content_sets = array()
 
 $defines_child_def = false
 
 $elements = array()
 
 $info = array()
 
 $info_attr_transform_post = array()
 
 $info_attr_transform_pre = array()
 
 $info_injector = array()
 
 $info_tag_transform = array()
 
 $name
 
 $safe = true
 

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

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.

References $i, and $ret.

Referenced by setup().

Here is the caller graph for this function:

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, and $type.

Referenced by populate().

Here is the caller graph for this function:

HTMLPurifier_HTMLModule_Tidy::makeFixes ( )

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

Definition at line 203 of file Tidy.php.

Referenced by setup().

Here is the caller graph for this function:

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.

References $defaultLevel.

Referenced by setup().

Here is the caller graph for this function:

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, $type, HTMLPurifier_HTMLModule\addBlankElement(), and getFixType().

Referenced by setup().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Definition at line 38 of file Tidy.php.

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

Here is the call graph for this function:

Member Data Documentation

HTMLPurifier_HTMLModule_Tidy::$defaultLevel = null

Default level to place all fixes in. Disabled by default

Definition at line 20 of file Tidy.php.

Referenced by makeFixesForLevel().

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 file: