XOOPS API 2.5.11 Beta1  UI v0.5
Réalisé par monxoops.fr
Référence de la classe HTMLPurifier_HTMLModule
+ Graphe d'héritage de HTMLPurifier_HTMLModule:

Fonctions membres publiques

 getChildDef ($def)
 
 addElement ($element, $type, $contents, $attr_includes=array(), $attr=array())
 
 addBlankElement ($element)
 
 addElementToContentSet ($element, $type)
 
 parseContents ($contents)
 
 mergeInAttrIncludes (&$attr, $attr_includes)
 
 makeLookup ($list)
 
 setup ($config)
 

Champs de données

 $name
 
 $elements = array()
 
 $info = array()
 
 $content_sets = array()
 
 $attr_collections = array()
 
 $info_tag_transform = array()
 
 $info_attr_transform_pre = array()
 
 $info_attr_transform_post = array()
 
 $info_injector = array()
 
 $defines_child_def = false
 
 $safe = true
 

Description détaillée

Represents an XHTML 1.1 module, with information on elements, tags and attributes.

Note
Even though this is technically XHTML 1.1, it is also used for regular HTML parsing. We are using modulization as a convenient way to represent the internals of HTMLDefinition, and our implementation is by no means conforming and does not directly use the normative DTDs or XML schemas.
The public variables in a module should almost directly correspond to the variables in HTMLPurifier_HTMLDefinition. However, the prefix info carries no special meaning in these objects (include it anyway if that's the correspondence though).
A faire:
Consider making some member functions protected

Documentation des fonctions membres

◆ addBlankElement()

addBlankElement (   $element)

Convenience function that creates a totally blank, non-standalone element.

Paramètres
string$elementName of element to create
Renvoie
HTMLPurifier_ElementDef Created element
+ Voici le graphe des appelants de cette fonction :

◆ addElement()

addElement (   $element,
  $type,
  $contents,
  $attr_includes = array(),
  $attr = array() 
)

Convenience function that sets up a new element

Paramètres
string$elementName of element to add
string | bool$typeWhat content set should element be registered to? Set as false to skip this step.
string | HTMLPurifier_ChildDef$contentsAllowed children in form of: "$content_model_type: $content_model"
array | string$attr_includesWhat attribute collections to register to element?
array$attrWhat unique attributes does the element define?
Voir également
HTMLPurifier_ElementDef:: for in-depth descriptions of these parameters.
Renvoie
HTMLPurifier_ElementDef Created element definition object, so you can set advanced parameters
+ Voici le graphe d'appel pour cette fonction :
+ Voici le graphe des appelants de cette fonction :

◆ addElementToContentSet()

addElementToContentSet (   $element,
  $type 
)

Convenience function that registers an element to a content set

Paramètres
string$elementElement to register
string$typeName content set (warning: case sensitive, usually upper-case first letter)
+ Voici le graphe des appelants de cette fonction :

◆ getChildDef()

getChildDef (   $def)

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Paramètres
HTMLPurifier_ElementDef$def
Renvoie
HTMLPurifier_ChildDef subclass

Réimplémentée dans HTMLPurifier_HTMLModule_Edit, et HTMLPurifier_HTMLModule_Tidy_Strict.

◆ makeLookup()

makeLookup (   $list)

Convenience function that generates a lookup table with boolean true as value.

Paramètres
string$listList of values to turn into a lookup
Note
You can also pass an arbitrary number of arguments in place of the regular argument
Renvoie
array array equivalent of list
+ Voici le graphe des appelants de cette fonction :

◆ mergeInAttrIncludes()

mergeInAttrIncludes ( $attr,
  $attr_includes 
)

Convenience function that merges a list of attribute includes into an attribute array.

Paramètres
array$attrReference to attr array to modify
array$attr_includesArray of includes / string include to merge in
+ Voici le graphe des appelants de cette fonction :

◆ parseContents()

parseContents (   $contents)

Convenience function that transforms single-string contents into separate content model and content model type

Paramètres
string$contentsAllowed children in form of: "$content_model_type: $content_model"
Renvoie
array
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.
+ Voici le graphe des appelants de cette fonction :

◆ setup()

Documentation des champs

◆ $attr_collections

$attr_collections = array()

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it. @type array

◆ $content_sets

$content_sets = array()

Associative array of content set names to content set additions. This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition. @type array

◆ $defines_child_def

$defines_child_def = false

Boolean flag that indicates whether or not getChildDef is implemented. For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect! @type bool

◆ $elements

$elements = array()

Informally, a list of elements this module changes. Not used in any significant way. @type array

◆ $info

$info = array()

Associative array of element names to element definitions. Some definitions may be incomplete, to be merged in later with the full definition. @type array

◆ $info_attr_transform_post

$info_attr_transform_post = array()

List of HTMLPurifier_AttrTransform to be performed after validation. @type array

◆ $info_attr_transform_pre

$info_attr_transform_pre = array()

List of HTMLPurifier_AttrTransform to be performed before validation. @type array

◆ $info_injector

$info_injector = array()

List of HTMLPurifier_Injector to be performed during well-formedness fixing. An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled. @type array

◆ $info_tag_transform

$info_tag_transform = array()

Associative array of deprecated tag name to HTMLPurifier_TagTransform. @type array

◆ $name

$name

Short unique string identifier of the module. @type string

◆ $safe

$safe = true

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

@type bool

Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.

La documentation de cette classe a été générée à partir du fichier suivant :