ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
HTMLPurifier_AttrTransform_NameSync Class Reference

Post-transform that performs validation to the name attribute; if it is present with an equivalent id attribute, it is passed through; otherwise validation is performed. More...

+ Inheritance diagram for HTMLPurifier_AttrTransform_NameSync:
+ Collaboration diagram for HTMLPurifier_AttrTransform_NameSync:

Public Member Functions

 __construct ()
 transform ($attr, $config, $context)
 Abstract: makes changes to the attributes dependent on multiple values.
- Public Member Functions inherited from HTMLPurifier_AttrTransform
 prependCSS (&$attr, $css)
 Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist.
 confiscateAttr (&$attr, $key)
 Retrieves and removes an attribute.

Detailed Description

Post-transform that performs validation to the name attribute; if it is present with an equivalent id attribute, it is passed through; otherwise validation is performed.

Definition at line 8 of file NameSync.php.

Constructor & Destructor Documentation

HTMLPurifier_AttrTransform_NameSync::__construct ( )

Definition at line 11 of file NameSync.php.

{
$this->idDef = new HTMLPurifier_AttrDef_HTML_ID();
}

Member Function Documentation

HTMLPurifier_AttrTransform_NameSync::transform (   $attr,
  $config,
  $context 
)

Abstract: makes changes to the attributes dependent on multiple values.

Parameters
$attrAssoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr
$configMandatory HTMLPurifier_Config object.
$contextMandatory HTMLPurifier_Context object
Returns
Processed attribute array.

Reimplemented from HTMLPurifier_AttrTransform.

Definition at line 15 of file NameSync.php.

References $config, and $name.

{
if (!isset($attr['name'])) return $attr;
$name = $attr['name'];
if (isset($attr['id']) && $attr['id'] === $name) return $attr;
$result = $this->idDef->validate($name, $config, $context);
if ($result === false) unset($attr['name']);
else $attr['name'] = $result;
return $attr;
}

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