HTMLPurifier 4.4.0
HTMLPurifier_HTMLModuleManager Class Reference

List of all members.

Public Member Functions

 __construct ()
 registerModule ($module, $overload=false)
 Registers a module to the recognized module list, useful for overloading pre-existing modules.
 addModule ($module)
 Adds a module to the current doctype by first registering it, and then tacking it on to the active doctype.
 addPrefix ($prefix)
 Adds a class prefix that registerModule() will use to resolve a string name to a concrete class.
 setup ($config)
 Performs processing on modules, after being called you may use getElement() and getElements()
 processModule ($module)
 Takes a module and adds it to the active module collection, registering it if necessary.
 getElements ()
 Retrieves merged element definitions.
 getElement ($name, $trusted=null)
 Retrieves a single merged element definition.
 __construct ()
 registerModule ($module, $overload=false)
 Registers a module to the recognized module list, useful for overloading pre-existing modules.
 addModule ($module)
 Adds a module to the current doctype by first registering it, and then tacking it on to the active doctype.
 addPrefix ($prefix)
 Adds a class prefix that registerModule() will use to resolve a string name to a concrete class.
 setup ($config)
 Performs processing on modules, after being called you may use getElement() and getElements()
 processModule ($module)
 Takes a module and adds it to the active module collection, registering it if necessary.
 getElements ()
 Retrieves merged element definitions.
 getElement ($name, $trusted=null)
 Retrieves a single merged element definition.

Public Attributes

 $doctypes
 Instance of HTMLPurifier_DoctypeRegistry.
 $doctype
 Instance of current doctype.
 $attrTypes
 Instance of HTMLPurifier_AttrTypes.
 $modules = array()
 Active instances of modules for the specified doctype are indexed, by name, in this array.
 $registeredModules = array()
 Array of recognized HTMLPurifier_Module instances, indexed by module's class name.
 $userModules = array()
 List of extra modules that were added by the user using addModule().
 $elementLookup = array()
 Associative array of element name to list of modules that have definitions for the element; this array is dynamically filled.
 $prefixes = array('HTMLPurifier_HTMLModule_')
 List of prefixes we should use for registering small names.
 $contentSets
 Instance of HTMLPurifier_ContentSets.
 $attrCollections
 Instance of HTMLPurifier_AttrCollections.
 $trusted = false
 If set to true, unsafe elements and attributes will be allowed.

Detailed Description

Definition at line 3 of file HTMLModuleManager.php.


Constructor & Destructor Documentation

HTMLPurifier_HTMLModuleManager::__construct ( )

Definition at line 56 of file HTMLModuleManager.php.

HTMLPurifier_HTMLModuleManager::__construct ( )

Definition at line 5060 of file HTMLPurifier.standalone.php.


Member Function Documentation

HTMLPurifier_HTMLModuleManager::addModule ( module)

Adds a module to the current doctype by first registering it, and then tacking it on to the active doctype.

Definition at line 183 of file HTMLModuleManager.php.

References registerModule().

HTMLPurifier_HTMLModuleManager::addModule ( module)

Adds a module to the current doctype by first registering it, and then tacking it on to the active doctype.

Definition at line 5187 of file HTMLPurifier.standalone.php.

References registerModule().

HTMLPurifier_HTMLModuleManager::addPrefix ( prefix)

Adds a class prefix that registerModule() will use to resolve a string name to a concrete class.

Definition at line 5197 of file HTMLPurifier.standalone.php.

HTMLPurifier_HTMLModuleManager::addPrefix ( prefix)

Adds a class prefix that registerModule() will use to resolve a string name to a concrete class.

Definition at line 193 of file HTMLModuleManager.php.

HTMLPurifier_HTMLModuleManager::getElement ( name,
trusted = null 
)

Retrieves a single merged element definition.

Parameters:
$nameName of element
$trustedBoolean trusted overriding parameter: set to true if you want the full version of an element
Returns:
Merged HTMLPurifier_ElementDef
Note:
You may notice that modules are getting iterated over twice (once in getElements() and once here). This is because

Definition at line 5339 of file HTMLPurifier.standalone.php.

References $def, and $trusted.

HTMLPurifier_HTMLModuleManager::getElement ( name,
trusted = null 
)

Retrieves a single merged element definition.

Parameters:
$nameName of element
$trustedBoolean trusted overriding parameter: set to true if you want the full version of an element
Returns:
Merged HTMLPurifier_ElementDef
Note:
You may notice that modules are getting iterated over twice (once in getElements() and once here). This is because

Definition at line 335 of file HTMLModuleManager.php.

References $def, and $trusted.

Referenced by getElements().

HTMLPurifier_HTMLModuleManager::getElements ( )

Retrieves merged element definitions.

Returns:
Array of HTMLPurifier_ElementDef

Definition at line 5308 of file HTMLPurifier.standalone.php.

References getElement().

HTMLPurifier_HTMLModuleManager::getElements ( )

Retrieves merged element definitions.

Returns:
Array of HTMLPurifier_ElementDef

Definition at line 304 of file HTMLModuleManager.php.

References getElement().

HTMLPurifier_HTMLModuleManager::processModule ( module)

Takes a module and adds it to the active module collection, registering it if necessary.

Definition at line 293 of file HTMLModuleManager.php.

References registerModule().

Referenced by setup().

HTMLPurifier_HTMLModuleManager::processModule ( module)

Takes a module and adds it to the active module collection, registering it if necessary.

Definition at line 5297 of file HTMLPurifier.standalone.php.

References registerModule().

HTMLPurifier_HTMLModuleManager::registerModule ( module,
overload = false 
)

Registers a module to the recognized module list, useful for overloading pre-existing modules.

Parameters:
$moduleMixed: string module name, with or without HTMLPurifier_HTMLModule prefix, or instance of subclass of HTMLPurifier_HTMLModule.
$overloadBoolean whether or not to overload previous modules. If this is not set, and you do overload a module, HTML Purifier will complain with a warning.
Note:
This function will not call autoload, you must instantiate (and thus invoke) autoload outside the method.
If a string is passed as a module name, different variants will be tested in this order:
  • Check for HTMLPurifier_HTMLModule_$name
  • Check all prefixes with $name in order they were added
  • Check for literal object name
  • Throw fatal error If your object name collides with an internal class, specify your module manually. All modules must have been included externally: registerModule will not perform inclusions for you!

Definition at line 147 of file HTMLModuleManager.php.

Referenced by addModule(), and processModule().

HTMLPurifier_HTMLModuleManager::registerModule ( module,
overload = false 
)

Registers a module to the recognized module list, useful for overloading pre-existing modules.

Parameters:
$moduleMixed: string module name, with or without HTMLPurifier_HTMLModule prefix, or instance of subclass of HTMLPurifier_HTMLModule.
$overloadBoolean whether or not to overload previous modules. If this is not set, and you do overload a module, HTML Purifier will complain with a warning.
Note:
This function will not call autoload, you must instantiate (and thus invoke) autoload outside the method.
If a string is passed as a module name, different variants will be tested in this order:
  • Check for HTMLPurifier_HTMLModule_$name
  • Check all prefixes with $name in order they were added
  • Check for literal object name
  • Throw fatal error If your object name collides with an internal class, specify your module manually. All modules must have been included externally: registerModule will not perform inclusions for you!

Definition at line 5151 of file HTMLPurifier.standalone.php.

HTMLPurifier_HTMLModuleManager::setup ( config)

Performs processing on modules, after being called you may use getElement() and getElements()

Parameters:
$configInstance of HTMLPurifier_Config

Definition at line 5206 of file HTMLPurifier.standalone.php.

References $config, $def, $modules, and processModule().

HTMLPurifier_HTMLModuleManager::setup ( config)

Performs processing on modules, after being called you may use getElement() and getElements()

Parameters:
$configInstance of HTMLPurifier_Config

Definition at line 202 of file HTMLModuleManager.php.

References $config, $def, $modules, and processModule().


Member Data Documentation

HTMLPurifier_HTMLModuleManager::$attrCollections

Instance of HTMLPurifier_AttrCollections.

Definition at line 51 of file HTMLModuleManager.php.

HTMLPurifier_HTMLModuleManager::$attrTypes

Instance of HTMLPurifier_AttrTypes.

Definition at line 19 of file HTMLModuleManager.php.

HTMLPurifier_HTMLModuleManager::$contentSets

Instance of HTMLPurifier_ContentSets.

Definition at line 50 of file HTMLModuleManager.php.

HTMLPurifier_HTMLModuleManager::$doctype

Instance of current doctype.

Definition at line 14 of file HTMLModuleManager.php.

HTMLPurifier_HTMLModuleManager::$doctypes

Instance of HTMLPurifier_DoctypeRegistry.

Definition at line 9 of file HTMLModuleManager.php.

HTMLPurifier_HTMLModuleManager::$elementLookup = array()

Associative array of element name to list of modules that have definitions for the element; this array is dynamically filled.

Definition at line 45 of file HTMLModuleManager.php.

HTMLPurifier_HTMLModuleManager::$modules = array()

Active instances of modules for the specified doctype are indexed, by name, in this array.

Definition at line 25 of file HTMLModuleManager.php.

Referenced by setup().

HTMLPurifier_HTMLModuleManager::$prefixes = array('HTMLPurifier_HTMLModule_')

List of prefixes we should use for registering small names.

Definition at line 48 of file HTMLModuleManager.php.

HTMLPurifier_HTMLModuleManager::$registeredModules = array()

Array of recognized HTMLPurifier_Module instances, indexed by module's class name.

This array is usually lazy loaded, but a user can overload a module by pre-emptively registering it.

Definition at line 32 of file HTMLModuleManager.php.

HTMLPurifier_HTMLModuleManager::$trusted = false

If set to true, unsafe elements and attributes will be allowed.

Definition at line 54 of file HTMLModuleManager.php.

Referenced by getElement().

HTMLPurifier_HTMLModuleManager::$userModules = array()

List of extra modules that were added by the user using addModule().

These get unconditionally merged into the current doctype, whatever it may be.

Definition at line 39 of file HTMLModuleManager.php.


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