3 require_once 'HTMLPurifier/ConfigDef.php';
6 * Structure object containing definition of a directive.
7 * @note This structure does not contain default values
9 class HTMLPurifier_ConfigDef_Directive
extends HTMLPurifier_ConfigDef
12 var $class = 'directive';
14 function HTMLPurifier_ConfigDef_Directive(
21 if ( $type !== null) $this->type
= $type;
22 if ($descriptions !== null) $this->descriptions
= $descriptions;
23 if ( $allow_null !== null) $this->allow_null
= $allow_null;
24 if ( $allowed !== null) $this->allowed
= $allowed;
25 if ( $aliases !== null) $this->aliases
= $aliases;
29 * Allowed type of the directive. Values are:
31 * - istring (case insensitive string)
35 * - lookup (array of value => true)
36 * - list (regular numbered index array)
37 * - hash (array of key => value)
38 * - mixed (anything goes)
43 * Plaintext descriptions of the configuration entity is. Organized by
44 * file and line number, so multiple descriptions are allowed.
46 var $descriptions = array();
49 * Is null allowed? Has no effect for mixed type.
52 var $allow_null = false;
55 * Lookup table of allowed values of the element, bool true if all allowed.
60 * Hash of value aliases, i.e. values that are equivalent.
62 var $aliases = array();
65 * Adds a description to the array
67 function addDescription($file, $line, $description) {
68 if (!isset($this->descriptions
[$file])) $this->descriptions
[$file] = array();
69 $this->descriptions
[$file][$line] = $description;