Fix two minor bugs, updating Phorum and removing unused $dir variable.
[htmlpurifier/darkodev.git] / library / HTMLPurifier / ChildDef.php
blobc5d5216dab2d2c29b3b1d6be417a550dbf5b2345
1 <?php
3 /**
4 * Defines allowed child nodes and validates tokens against it.
5 */
6 abstract class HTMLPurifier_ChildDef
8 /**
9 * Type of child definition, usually right-most part of class name lowercase.
10 * Used occasionally in terms of context.
12 public $type;
14 /**
15 * Bool that indicates whether or not an empty array of children is okay
17 * This is necessary for redundant checking when changes affecting
18 * a child node may cause a parent node to now be disallowed.
20 public $allow_empty;
22 /**
23 * Lookup array of all elements that this definition could possibly allow
25 public $elements = array();
27 /**
28 * Get lookup of tag names that should not close this element automatically.
29 * All other elements will do so.
31 public function getAllowedElements($config) {
32 return $this->elements;
35 /**
36 * Validates nodes according to definition and returns modification.
38 * @param $tokens_of_children Array of HTMLPurifier_Token
39 * @param $config HTMLPurifier_Config object
40 * @param $context HTMLPurifier_Context object
41 * @return bool true to leave nodes as is
42 * @return bool false to remove parent node
43 * @return array of replacement child tokens
45 abstract public function validateChildren($tokens_of_children, $config, $context);
48 // vim: et sw=4 sts=4