ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
Optional.php
Go to the documentation of this file.
1 <?php
2 
11 {
15  public $allow_empty = true;
16 
20  public $type = 'optional';
21 
28  public function validateChildren($children, $config, $context)
29  {
30  $result = parent::validateChildren($children, $config, $context);
31  // we assume that $children is not modified
32  if ($result === false) {
33  if (empty($children)) {
34  return true;
35  } elseif ($this->whitespace) {
36  return $children;
37  } else {
38  return array();
39  }
40  }
41  return $result;
42  }
43 }
44 
45 // vim: et sw=4 sts=4