diff options
Diffstat (limited to 'inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange')
-rw-r--r-- | inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Directive.php | 89 | ||||
-rw-r--r-- | inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php | 58 |
2 files changed, 147 insertions, 0 deletions
diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Directive.php b/inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Directive.php new file mode 100644 index 00000000..4c39c5c6 --- /dev/null +++ b/inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Directive.php | |||
@@ -0,0 +1,89 @@ | |||
1 | <?php | ||
2 | |||
3 | /** | ||
4 | * Interchange component class describing configuration directives. | ||
5 | */ | ||
6 | class HTMLPurifier_ConfigSchema_Interchange_Directive | ||
7 | { | ||
8 | |||
9 | /** | ||
10 | * ID of directive. | ||
11 | * @type HTMLPurifier_ConfigSchema_Interchange_Id | ||
12 | */ | ||
13 | public $id; | ||
14 | |||
15 | /** | ||
16 | * Type, e.g. 'integer' or 'istring'. | ||
17 | * @type string | ||
18 | */ | ||
19 | public $type; | ||
20 | |||
21 | /** | ||
22 | * Default value, e.g. 3 or 'DefaultVal'. | ||
23 | * @type mixed | ||
24 | */ | ||
25 | public $default; | ||
26 | |||
27 | /** | ||
28 | * HTML description. | ||
29 | * @type string | ||
30 | */ | ||
31 | public $description; | ||
32 | |||
33 | /** | ||
34 | * Whether or not null is allowed as a value. | ||
35 | * @type bool | ||
36 | */ | ||
37 | public $typeAllowsNull = false; | ||
38 | |||
39 | /** | ||
40 | * Lookup table of allowed scalar values. | ||
41 | * e.g. array('allowed' => true). | ||
42 | * Null if all values are allowed. | ||
43 | * @type array | ||
44 | */ | ||
45 | public $allowed; | ||
46 | |||
47 | /** | ||
48 | * List of aliases for the directive. | ||
49 | * e.g. array(new HTMLPurifier_ConfigSchema_Interchange_Id('Ns', 'Dir'))). | ||
50 | * @type HTMLPurifier_ConfigSchema_Interchange_Id[] | ||
51 | */ | ||
52 | public $aliases = array(); | ||
53 | |||
54 | /** | ||
55 | * Hash of value aliases, e.g. array('alt' => 'real'). Null if value | ||
56 | * aliasing is disabled (necessary for non-scalar types). | ||
57 | * @type array | ||
58 | */ | ||
59 | public $valueAliases; | ||
60 | |||
61 | /** | ||
62 | * Version of HTML Purifier the directive was introduced, e.g. '1.3.1'. | ||
63 | * Null if the directive has always existed. | ||
64 | * @type string | ||
65 | */ | ||
66 | public $version; | ||
67 | |||
68 | /** | ||
69 | * ID of directive that supercedes this old directive. | ||
70 | * Null if not deprecated. | ||
71 | * @type HTMLPurifier_ConfigSchema_Interchange_Id | ||
72 | */ | ||
73 | public $deprecatedUse; | ||
74 | |||
75 | /** | ||
76 | * Version of HTML Purifier this directive was deprecated. Null if not | ||
77 | * deprecated. | ||
78 | * @type string | ||
79 | */ | ||
80 | public $deprecatedVersion; | ||
81 | |||
82 | /** | ||
83 | * List of external projects this directive depends on, e.g. array('CSSTidy'). | ||
84 | * @type array | ||
85 | */ | ||
86 | public $external = array(); | ||
87 | } | ||
88 | |||
89 | // vim: et sw=4 sts=4 | ||
diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php b/inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php new file mode 100644 index 00000000..3ee81711 --- /dev/null +++ b/inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php | |||
@@ -0,0 +1,58 @@ | |||
1 | <?php | ||
2 | |||
3 | /** | ||
4 | * Represents a directive ID in the interchange format. | ||
5 | */ | ||
6 | class HTMLPurifier_ConfigSchema_Interchange_Id | ||
7 | { | ||
8 | |||
9 | /** | ||
10 | * @type string | ||
11 | */ | ||
12 | public $key; | ||
13 | |||
14 | /** | ||
15 | * @param string $key | ||
16 | */ | ||
17 | public function __construct($key) | ||
18 | { | ||
19 | $this->key = $key; | ||
20 | } | ||
21 | |||
22 | /** | ||
23 | * @return string | ||
24 | * @warning This is NOT magic, to ensure that people don't abuse SPL and | ||
25 | * cause problems for PHP 5.0 support. | ||
26 | */ | ||
27 | public function toString() | ||
28 | { | ||
29 | return $this->key; | ||
30 | } | ||
31 | |||
32 | /** | ||
33 | * @return string | ||
34 | */ | ||
35 | public function getRootNamespace() | ||
36 | { | ||
37 | return substr($this->key, 0, strpos($this->key, ".")); | ||
38 | } | ||
39 | |||
40 | /** | ||
41 | * @return string | ||
42 | */ | ||
43 | public function getDirective() | ||
44 | { | ||
45 | return substr($this->key, strpos($this->key, ".") + 1); | ||
46 | } | ||
47 | |||
48 | /** | ||
49 | * @param string $id | ||
50 | * @return HTMLPurifier_ConfigSchema_Interchange_Id | ||
51 | */ | ||
52 | public static function make($id) | ||
53 | { | ||
54 | return new HTMLPurifier_ConfigSchema_Interchange_Id($id); | ||
55 | } | ||
56 | } | ||
57 | |||
58 | // vim: et sw=4 sts=4 | ||