ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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
Definition that allows a set of elements, but disallows empty children.
Definition: Required.php:6
$result
Definition that allows a set of elements, and allows no children.
Definition: Optional.php:10
Create styles array
The data for the language used.
validateChildren($children, $config, $context)
Definition: Optional.php:28