1: | <?php
|
2: |
|
3: | |
4: | |
5: | |
6: |
|
7: | class HTMLPurifier_HTMLModule_Edit extends HTMLPurifier_HTMLModule
|
8: | {
|
9: |
|
10: | |
11: | |
12: |
|
13: | public $name = 'Edit';
|
14: |
|
15: | |
16: | |
17: |
|
18: | public function setup($config)
|
19: | {
|
20: | $contents = 'Chameleon: #PCDATA | Inline ! #PCDATA | Flow';
|
21: | $attr = array(
|
22: | 'cite' => 'URI',
|
23: |
|
24: | );
|
25: | $this->addElement('del', 'Inline', $contents, 'Common', $attr);
|
26: | $this->addElement('ins', 'Inline', $contents, 'Common', $attr);
|
27: | }
|
28: |
|
29: |
|
30: |
|
31: |
|
32: |
|
33: |
|
34: |
|
35: |
|
36: | |
37: | |
38: |
|
39: | public $defines_child_def = true;
|
40: |
|
41: | |
42: | |
43: | |
44: |
|
45: | public function getChildDef($def)
|
46: | {
|
47: | if ($def->content_model_type != 'chameleon') {
|
48: | return false;
|
49: | }
|
50: | $value = explode('!', $def->content_model);
|
51: | return new HTMLPurifier_ChildDef_Chameleon($value[0], $value[1]);
|
52: | }
|
53: | }
|
54: |
|
55: |
|
56: | |