ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
Chameleon.php
Go to the documentation of this file.
1 <?php
2 
13 {
14 
19  public $inline;
20 
25  public $block;
26 
30  public $type = 'chameleon';
31 
36  public function __construct($inline, $block)
37  {
38  $this->inline = new HTMLPurifier_ChildDef_Optional($inline);
39  $this->block = new HTMLPurifier_ChildDef_Optional($block);
40  $this->elements = $this->block->elements;
41  }
42 
49  public function validateChildren($children, $config, $context)
50  {
51  if ($context->get('IsInline') === false) {
52  return $this->block->validateChildren(
53  $children,
54  $config,
55  $context
56  );
57  } else {
58  return $this->inline->validateChildren(
59  $children,
60  $config,
61  $context
62  );
63  }
64  }
65 }
66 
67 // vim: et sw=4 sts=4