]>
Commit | Line | Data |
---|---|---|
d4949327 NL |
1 | <?php\r |
2 | \r | |
3 | /**\r | |
4 | * Defines allowed child nodes and validates nodes against it.\r | |
5 | */\r | |
6 | abstract class HTMLPurifier_ChildDef\r | |
7 | {\r | |
8 | /**\r | |
9 | * Type of child definition, usually right-most part of class name lowercase.\r | |
10 | * Used occasionally in terms of context.\r | |
11 | * @type string\r | |
12 | */\r | |
13 | public $type;\r | |
14 | \r | |
15 | /**\r | |
16 | * Indicates whether or not an empty array of children is okay.\r | |
17 | *\r | |
18 | * This is necessary for redundant checking when changes affecting\r | |
19 | * a child node may cause a parent node to now be disallowed.\r | |
20 | * @type bool\r | |
21 | */\r | |
22 | public $allow_empty;\r | |
23 | \r | |
24 | /**\r | |
25 | * Lookup array of all elements that this definition could possibly allow.\r | |
26 | * @type array\r | |
27 | */\r | |
28 | public $elements = array();\r | |
29 | \r | |
30 | /**\r | |
31 | * Get lookup of tag names that should not close this element automatically.\r | |
32 | * All other elements will do so.\r | |
33 | * @param HTMLPurifier_Config $config HTMLPurifier_Config object\r | |
34 | * @return array\r | |
35 | */\r | |
36 | public function getAllowedElements($config)\r | |
37 | {\r | |
38 | return $this->elements;\r | |
39 | }\r | |
40 | \r | |
41 | /**\r | |
42 | * Validates nodes according to definition and returns modification.\r | |
43 | *\r | |
44 | * @param HTMLPurifier_Node[] $children Array of HTMLPurifier_Node\r | |
45 | * @param HTMLPurifier_Config $config HTMLPurifier_Config object\r | |
46 | * @param HTMLPurifier_Context $context HTMLPurifier_Context object\r | |
47 | * @return bool|array true to leave nodes as is, false to remove parent node, array of replacement children\r | |
48 | */\r | |
49 | abstract public function validateChildren($children, $config, $context);\r | |
50 | }\r | |
51 | \r | |
52 | // vim: et sw=4 sts=4\r |