ILIAS  Release_5_0_x_branch Revision 61816
 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)
- 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 
)
Parameters
array$attr
HTMLPurifier_Config$config
HTMLPurifier_Context$context
Returns
array

Reimplemented from HTMLPurifier_AttrTransform.

Definition at line 22 of file NameSync.php.

References $result.

{
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: