Methods summary
public
|
|
public
|
#
registerModule( mixed $module, mixed $overload = false )
Registers a module to the recognized module list, useful for overloading
pre-existing modules.
Registers a module to the recognized module list, useful for overloading
pre-existing modules.
Parameters
- $module
mixed $module Mixed: string module name, with or without HTMLPurifier_HTMLModule
prefix, or instance of subclass of HTMLPurifier_HTMLModule.
- $overload
mixed $overload Boolean 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!
|
public
|
#
addModule( mixed $module )
Adds a module to the current doctype by first registering it, and then
tacking it on to the active doctype
Adds a module to the current doctype by first registering it, and then
tacking it on to the active doctype
|
public
|
#
addPrefix( mixed $prefix )
Adds a class prefix that registerModule() will use to resolve a string name
to a concrete class
Adds a class prefix that registerModule() will use to resolve a string name
to a concrete class
|
public
|
#
setup( HTMLPurifier_Config $config )
Performs processing on modules, after being called you may use getElement()
and getElements()
Performs processing on modules, after being called you may use getElement()
and getElements()
Parameters
|
public
|
#
processModule( mixed $module )
Takes a module and adds it to the active module collection, registering it if
necessary.
Takes a module and adds it to the active module collection, registering it if
necessary.
|
public
Array
|
#
getElements( )
Retrieves merged element definitions.
Retrieves merged element definitions.
Returns
Array of HTMLPurifier_ElementDef
|
public
HTMLPurifier_ElementDef
|
#
getElement( string $name, boolean $trusted = null )
Retrieves a single merged element definition
Retrieves a single merged element definition
Parameters
- $name
string $name Name of element
- $trusted
boolean $trusted Boolean trusted overriding parameter: set to true if you want the full
version of an element
Returns
Note
You may notice that modules are getting iterated over twice (once in
getElements() and once here). This is because
|
Properties summary
public
mixed
|
$doctypes
|
|
#
Type
HTMLPurifier_DoctypeRegistry
|
public
mixed
|
$doctype
|
|
#
Instance of current doctype.
Instance of current doctype.
Type
string
|
public
mixed
|
$attrTypes
|
|
#
Type
HTMLPurifier_AttrTypes
|
public
array
|
$modules
|
array() |
#
Active instances of modules for the specified doctype are indexed, by name,
in this array.
Active instances of modules for the specified doctype are indexed, by name,
in this array.
Type
HTMLPurifier_HTMLModule[]
|
public
array
|
$registeredModules
|
array() |
#
Array of recognized HTMLPurifier_HTMLModule 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.
Array of recognized HTMLPurifier_HTMLModule 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.
Type
HTMLPurifier_HTMLModule[]
|
public
array
|
$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.
List of extra modules that were added by the user using addModule(). These
get unconditionally merged into the current doctype, whatever it may be.
Type
HTMLPurifier_HTMLModule[]
|
public
array
|
$elementLookup
|
array() |
#
Associative array of element name to list of modules that have definitions
for the element; this array is dynamically filled.
Associative array of element name to list of modules that have definitions
for the element; this array is dynamically filled.
Type
array
|
public
array
|
$prefixes
|
array('HTMLPurifier_HTMLModule_') |
#
List of prefixes we should use for registering small names.
List of prefixes we should use for registering small names.
Type
array
|
public
mixed
|
$contentSets
|
|
#
Type
HTMLPurifier_ContentSets
|
public
mixed
|
$attrCollections
|
|
#
Type
HTMLPurifier_AttrCollections
|
public
boolean
|
$trusted
|
false |
#
If set to true, unsafe elements and attributes will be allowed.
If set to true, unsafe elements and attributes will be allowed.
Type
bool
|