ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
HTMLPurifier_ChildDef_Chameleon Class Reference

Definition that uses different definitions depending on context. More...

+ Inheritance diagram for HTMLPurifier_ChildDef_Chameleon:
+ Collaboration diagram for HTMLPurifier_ChildDef_Chameleon:

Public Member Functions

 __construct ($inline, $block)
 validateChildren ($children, $config, $context)
- Public Member Functions inherited from HTMLPurifier_ChildDef
 getAllowedElements ($config)
 Get lookup of tag names that should not close this element automatically.

Data Fields

 $inline
 Instance of the definition object to use when inline.
 $block
 Instance of the definition object to use when block.
 $type = 'chameleon'
 string
- Data Fields inherited from HTMLPurifier_ChildDef
 $type
 Type of child definition, usually right-most part of class name lowercase.
 $allow_empty
 Indicates whether or not an empty array of children is okay.
 $elements = array()
 Lookup array of all elements that this definition could possibly allow.

Detailed Description

Definition that uses different definitions depending on context.

The del and ins tags are notable because they allow different types of elements depending on whether or not they're in a block or inline context. Chameleon allows this behavior to happen by using two different definitions depending on context. While this somewhat generalized, it is specifically intended for those two tags.

Definition at line 12 of file Chameleon.php.

Constructor & Destructor Documentation

HTMLPurifier_ChildDef_Chameleon::__construct (   $inline,
  $block 
)
Parameters
array$inlineList of elements to allow when inline.
array$blockList of elements to allow when block.

Definition at line 36 of file Chameleon.php.

References $block, and $inline.

{
$this->elements = $this->block->elements;
}

Member Function Documentation

HTMLPurifier_ChildDef_Chameleon::validateChildren (   $children,
  $config,
  $context 
)
Parameters
HTMLPurifier_Node[]$children
HTMLPurifier_Config$config
HTMLPurifier_Context$context
Returns
bool

Reimplemented from HTMLPurifier_ChildDef.

Definition at line 49 of file Chameleon.php.

{
if ($context->get('IsInline') === false) {
return $this->block->validateChildren(
$children,
$config,
$context
);
} else {
return $this->inline->validateChildren(
$children,
$config,
$context
);
}
}

Field Documentation

HTMLPurifier_ChildDef_Chameleon::$block

Instance of the definition object to use when block.

HTMLPurifier_ChildDef_Optional

Definition at line 25 of file Chameleon.php.

Referenced by __construct().

HTMLPurifier_ChildDef_Chameleon::$inline

Instance of the definition object to use when inline.

Usually stricter. HTMLPurifier_ChildDef_Optional

Definition at line 19 of file Chameleon.php.

Referenced by __construct().

HTMLPurifier_ChildDef_Chameleon::$type = 'chameleon'

string

Definition at line 30 of file Chameleon.php.


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