Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
|
Public Member Functions | |
addBlankElement ($element) | |
Convenience function that creates a totally blank, non-standalone element. | |
addElement ($element, $type, $contents, $attr_includes=array(), $attr=array()) | |
Convenience function that sets up a new element. | |
addElementToContentSet ($element, $type) | |
Convenience function that registers an element to a content set. | |
getChildDef ($def) | |
Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. | |
makeLookup ($list) | |
Convenience function that generates a lookup table with boolean true as value. | |
mergeInAttrIncludes (&$attr, $attr_includes) | |
Convenience function that merges a list of attribute includes into an attribute array. | |
parseContents ($contents) | |
Convenience function that transforms single-string contents into separate content model and content model type. | |
setup ($config) | |
Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available. | |
Public Attributes | |
$attr_collections = array() | |
Associative array of attribute collection names to attribute collection additions. | |
$content_sets = array() | |
Associative array of content set names to content set additions. | |
$defines_child_def = false | |
Boolean flag that indicates whether or not getChildDef is implemented. | |
$elements = array() | |
Informally, a list of elements this module changes. | |
$info = array() | |
Associative array of element names to element definitions. | |
$info_attr_transform_post = array() | |
List of HTMLPurifier_AttrTransform to be performed after validation. | |
$info_attr_transform_pre = array() | |
List of HTMLPurifier_AttrTransform to be performed before validation. | |
$info_injector = array() | |
List of HTMLPurifier_Injector to be performed during well-formedness fixing. | |
$info_tag_transform = array() | |
Associative array of deprecated tag name to HTMLPurifier_TagTransform. | |
$name | |
Short unique string identifier of the module. | |
$safe = true | |
Boolean flag whether or not this module is safe. | |
HTMLPurifier_HTMLModule::addBlankElement | ( | $element | ) |
Convenience function that creates a totally blank, non-standalone element.
string | $element | Name of element to create |
HTMLPurifier_ElementDef | Created element |
HTMLPurifier_HTMLModule::addElement | ( | $element, | |
$type, | |||
$contents, | |||
$attr_includes = array(), | |||
$attr = array() ) |
Convenience function that sets up a new element.
string | $element | Name of element to add |
string | bool | $type | What content set should element be registered to? Set as false to skip this step. |
string | HTMLPurifier_ChildDef | $contents | Allowed children in form of: "$content_model_type: $content_model" |
array | string | $attr_includes | What attribute collections to register to element? |
array | $attr | What unique attributes does the element define? |
HTMLPurifier_ElementDef | Created element definition object, so you can set advanced parameters |
HTMLPurifier_HTMLModule::addElementToContentSet | ( | $element, | |
$type ) |
Convenience function that registers an element to a content set.
string | $element | Element to register |
string | $type | Name content set (warning: case sensitive, usually upper-case first letter) |
HTMLPurifier_HTMLModule::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.
HTMLPurifier_ElementDef | $def |
HTMLPurifier_ChildDef | subclass |
Reimplemented in HTMLPurifier_HTMLModule_Edit, and HTMLPurifier_HTMLModule_Tidy_Strict.
HTMLPurifier_HTMLModule::makeLookup | ( | $list | ) |
Convenience function that generates a lookup table with boolean true as value.
string | $list | List of values to turn into a lookup |
array | array equivalent of list |
HTMLPurifier_HTMLModule::mergeInAttrIncludes | ( | & | $attr, |
$attr_includes ) |
Convenience function that merges a list of attribute includes into an attribute array.
array | $attr | Reference to attr array to modify |
array | $attr_includes | Array of includes / string include to merge in |
HTMLPurifier_HTMLModule::parseContents | ( | $contents | ) |
Convenience function that transforms single-string contents into separate content model and content model type.
string | $contents | Allowed children in form of: "$content_model_type: $content_model" |
array |
HTMLPurifier_HTMLModule::setup | ( | $config | ) |
Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.
HTMLPurifier_Config | $config |
Reimplemented in HTMLPurifier_HTMLModule_Bdo, HTMLPurifier_HTMLModule_Edit, HTMLPurifier_HTMLModule_Forms, HTMLPurifier_HTMLModule_Hypertext, HTMLPurifier_HTMLModule_Iframe, HTMLPurifier_HTMLModule_Image, HTMLPurifier_HTMLModule_Legacy, HTMLPurifier_HTMLModule_List, HTMLPurifier_HTMLModule_Name, HTMLPurifier_HTMLModule_Nofollow, HTMLPurifier_HTMLModule_Object, HTMLPurifier_HTMLModule_Presentation, HTMLPurifier_HTMLModule_Proprietary, HTMLPurifier_HTMLModule_Ruby, HTMLPurifier_HTMLModule_SafeEmbed, HTMLPurifier_HTMLModule_SafeObject, HTMLPurifier_HTMLModule_SafeScripting, HTMLPurifier_HTMLModule_Scripting, HTMLPurifier_HTMLModule_StyleAttribute, HTMLPurifier_HTMLModule_Tables, HTMLPurifier_HTMLModule_Target, HTMLPurifier_HTMLModule_TargetBlank, HTMLPurifier_HTMLModule_TargetNoopener, HTMLPurifier_HTMLModule_TargetNoreferrer, HTMLPurifier_HTMLModule_Text, and HTMLPurifier_HTMLModule_Tidy.
HTMLPurifier_HTMLModule::$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
HTMLPurifier_HTMLModule::$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
HTMLPurifier_HTMLModule::$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
HTMLPurifier_HTMLModule::$elements = array() |
Informally, a list of elements this module changes.
Not used in any significant way. @type array
HTMLPurifier_HTMLModule::$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
HTMLPurifier_HTMLModule::$info_attr_transform_post = array() |
List of HTMLPurifier_AttrTransform to be performed after validation.
@type array
HTMLPurifier_HTMLModule::$info_attr_transform_pre = array() |
List of HTMLPurifier_AttrTransform to be performed before validation.
@type array
HTMLPurifier_HTMLModule::$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
HTMLPurifier_HTMLModule::$info_tag_transform = array() |
Associative array of deprecated tag name to HTMLPurifier_TagTransform.
@type array
HTMLPurifier_HTMLModule::$name |
Short unique string identifier of the module.
@type string
HTMLPurifier_HTMLModule::$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