Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
HTMLPurifier_AttrTransform_EnumToCSS Class Reference
Inheritance diagram for HTMLPurifier_AttrTransform_EnumToCSS:
HTMLPurifier_AttrTransform

Public Member Functions

 __construct ($attr, $enum_to_css, $case_sensitive=false)
 
 confiscateAttr (&$attr, $key)
 Retrieves and removes an attribute.
 
 prependCSS (&$attr, $css)
 Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist.
 
 transform ($attr, $config, $context)
 

Protected Attributes

 $attr
 Name of attribute to transform from.
 
 $caseSensitive = false
 Case sensitivity of the matching.
 
 $enumToCSS = array()
 Lookup array of attribute values to CSS.
 

Constructor & Destructor Documentation

◆ __construct()

HTMLPurifier_AttrTransform_EnumToCSS::__construct ( $attr,
$enum_to_css,
$case_sensitive = false )
Parameters
string$attrAttribute name to transform from
array$enum_to_cssLookup array of attribute values to CSS
bool$case_sensitiveCase sensitivity indicator, default false

Member Function Documentation

◆ confiscateAttr()

HTMLPurifier_AttrTransform::confiscateAttr ( & $attr,
$key )
inherited

Retrieves and removes an attribute.

Parameters
array&$attrAttribute array to process (passed by reference)
mixed$keyKey of attribute to confiscate
Return values
mixed

◆ prependCSS()

HTMLPurifier_AttrTransform::prependCSS ( & $attr,
$css )
inherited

Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist.

Parameters
array&$attrAttribute array to process (passed by reference)
string$cssCSS to prepend

◆ transform()

HTMLPurifier_AttrTransform_EnumToCSS::transform ( $attr,
$config,
$context )
Parameters
array$attr
HTMLPurifier_Config$config
HTMLPurifier_Context$context
Return values
array

Reimplemented from HTMLPurifier_AttrTransform.

Member Data Documentation

◆ $attr

HTMLPurifier_AttrTransform_EnumToCSS::$attr
protected

Name of attribute to transform from.

@type string

◆ $caseSensitive

HTMLPurifier_AttrTransform_EnumToCSS::$caseSensitive = false
protected

Case sensitivity of the matching.

@type bool

Warning
Currently can only be guaranteed to work with ASCII values.

◆ $enumToCSS

HTMLPurifier_AttrTransform_EnumToCSS::$enumToCSS = array()
protected

Lookup array of attribute values to CSS.

@type array


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