ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
HTMLPurifier_AttrDef_Switch Class Reference

Decorator that, depending on a token, switches between two definitions. More...

+ Collaboration diagram for HTMLPurifier_AttrDef_Switch:

Public Member Functions

 __construct ($tag, $with_tag, $without_tag)
 validate ($string, $config, $context)

Data Fields

 $withoutTag

Protected Attributes

 $tag
 $withTag

Detailed Description

Decorator that, depending on a token, switches between two definitions.

Definition at line 6 of file Switch.php.

Constructor & Destructor Documentation

HTMLPurifier_AttrDef_Switch::__construct (   $tag,
  $with_tag,
  $without_tag 
)
Parameters
string$tagTag name to switch upon
HTMLPurifier_AttrDef$with_tagCall if token matches tag
HTMLPurifier_AttrDef$without_tagCall if token doesn't match, or there is no token

Definition at line 17 of file Switch.php.

References $tag.

{
$this->tag = $tag;
$this->withTag = $with_tag;
$this->withoutTag = $without_tag;
}

Member Function Documentation

HTMLPurifier_AttrDef_Switch::validate (   $string,
  $config,
  $context 
)

Definition at line 23 of file Switch.php.

{
$token = $context->get('CurrentToken', true);
if (!$token || $token->name !== $this->tag) {
return $this->withoutTag->validate($string, $config, $context);
} else {
return $this->withTag->validate($string, $config, $context);
}
}

Field Documentation

HTMLPurifier_AttrDef_Switch::$tag
protected

Definition at line 9 of file Switch.php.

Referenced by __construct().

HTMLPurifier_AttrDef_Switch::$withoutTag

Definition at line 10 of file Switch.php.

HTMLPurifier_AttrDef_Switch::$withTag
protected

Definition at line 10 of file Switch.php.


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