1: | <?php
|
2: |
|
3: | |
4: | |
5: | |
6: | |
7: | |
8: | |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: |
|
18: |
|
19: | class HTMLPurifier_HTMLModule_Legacy extends HTMLPurifier_HTMLModule
|
20: | {
|
21: | |
22: | |
23: |
|
24: | public $name = 'Legacy';
|
25: |
|
26: | |
27: | |
28: |
|
29: | public function setup($config)
|
30: | {
|
31: | $this->addElement(
|
32: | 'basefont',
|
33: | 'Inline',
|
34: | 'Empty',
|
35: | null,
|
36: | array(
|
37: | 'color' => 'Color',
|
38: | 'face' => 'Text',
|
39: | 'size' => 'Text',
|
40: | 'id' => 'ID'
|
41: | )
|
42: | );
|
43: | $this->addElement('center', 'Block', 'Flow', 'Common');
|
44: | $this->addElement(
|
45: | 'dir',
|
46: | 'Block',
|
47: | 'Required: li',
|
48: | 'Common',
|
49: | array(
|
50: | 'compact' => 'Bool#compact'
|
51: | )
|
52: | );
|
53: | $this->addElement(
|
54: | 'font',
|
55: | 'Inline',
|
56: | 'Inline',
|
57: | array('Core', 'I18N'),
|
58: | array(
|
59: | 'color' => 'Color',
|
60: | 'face' => 'Text',
|
61: | 'size' => 'Text',
|
62: | )
|
63: | );
|
64: | $this->addElement(
|
65: | 'menu',
|
66: | 'Block',
|
67: | 'Required: li',
|
68: | 'Common',
|
69: | array(
|
70: | 'compact' => 'Bool#compact'
|
71: | )
|
72: | );
|
73: |
|
74: | $s = $this->addElement('s', 'Inline', 'Inline', 'Common');
|
75: | $s->formatting = true;
|
76: |
|
77: | $strike = $this->addElement('strike', 'Inline', 'Inline', 'Common');
|
78: | $strike->formatting = true;
|
79: |
|
80: | $u = $this->addElement('u', 'Inline', 'Inline', 'Common');
|
81: | $u->formatting = true;
|
82: |
|
83: |
|
84: |
|
85: | $align = 'Enum#left,right,center,justify';
|
86: |
|
87: | $address = $this->addBlankElement('address');
|
88: | $address->content_model = 'Inline | #PCDATA | p';
|
89: | $address->content_model_type = 'optional';
|
90: | $address->child = false;
|
91: |
|
92: | $blockquote = $this->addBlankElement('blockquote');
|
93: | $blockquote->content_model = 'Flow | #PCDATA';
|
94: | $blockquote->content_model_type = 'optional';
|
95: | $blockquote->child = false;
|
96: |
|
97: | $br = $this->addBlankElement('br');
|
98: | $br->attr['clear'] = 'Enum#left,all,right,none';
|
99: |
|
100: | $caption = $this->addBlankElement('caption');
|
101: | $caption->attr['align'] = 'Enum#top,bottom,left,right';
|
102: |
|
103: | $div = $this->addBlankElement('div');
|
104: | $div->attr['align'] = $align;
|
105: |
|
106: | $dl = $this->addBlankElement('dl');
|
107: | $dl->attr['compact'] = 'Bool#compact';
|
108: |
|
109: | for ($i = 1; $i <= 6; $i++) {
|
110: | $h = $this->addBlankElement("h$i");
|
111: | $h->attr['align'] = $align;
|
112: | }
|
113: |
|
114: | $hr = $this->addBlankElement('hr');
|
115: | $hr->attr['align'] = $align;
|
116: | $hr->attr['noshade'] = 'Bool#noshade';
|
117: | $hr->attr['size'] = 'Pixels';
|
118: | $hr->attr['width'] = 'Length';
|
119: |
|
120: | $img = $this->addBlankElement('img');
|
121: | $img->attr['align'] = 'IAlign';
|
122: | $img->attr['border'] = 'Pixels';
|
123: | $img->attr['hspace'] = 'Pixels';
|
124: | $img->attr['vspace'] = 'Pixels';
|
125: |
|
126: |
|
127: |
|
128: | $li = $this->addBlankElement('li');
|
129: | $li->attr['value'] = new HTMLPurifier_AttrDef_Integer();
|
130: | $li->attr['type'] = 'Enum#s:1,i,I,a,A,disc,square,circle';
|
131: |
|
132: | $ol = $this->addBlankElement('ol');
|
133: | $ol->attr['compact'] = 'Bool#compact';
|
134: | $ol->attr['start'] = new HTMLPurifier_AttrDef_Integer();
|
135: | $ol->attr['type'] = 'Enum#s:1,i,I,a,A';
|
136: |
|
137: | $p = $this->addBlankElement('p');
|
138: | $p->attr['align'] = $align;
|
139: |
|
140: | $pre = $this->addBlankElement('pre');
|
141: | $pre->attr['width'] = 'Number';
|
142: |
|
143: |
|
144: |
|
145: | $table = $this->addBlankElement('table');
|
146: | $table->attr['align'] = 'Enum#left,center,right';
|
147: | $table->attr['bgcolor'] = 'Color';
|
148: |
|
149: | $tr = $this->addBlankElement('tr');
|
150: | $tr->attr['bgcolor'] = 'Color';
|
151: |
|
152: | $th = $this->addBlankElement('th');
|
153: | $th->attr['bgcolor'] = 'Color';
|
154: | $th->attr['height'] = 'Length';
|
155: | $th->attr['nowrap'] = 'Bool#nowrap';
|
156: | $th->attr['width'] = 'Length';
|
157: |
|
158: | $td = $this->addBlankElement('td');
|
159: | $td->attr['bgcolor'] = 'Color';
|
160: | $td->attr['height'] = 'Length';
|
161: | $td->attr['nowrap'] = 'Bool#nowrap';
|
162: | $td->attr['width'] = 'Length';
|
163: |
|
164: | $ul = $this->addBlankElement('ul');
|
165: | $ul->attr['compact'] = 'Bool#compact';
|
166: | $ul->attr['type'] = 'Enum#square,disc,circle';
|
167: |
|
168: |
|
169: |
|
170: |
|
171: |
|
172: |
|
173: | $form = $this->addBlankElement('form');
|
174: | $form->content_model = 'Flow | #PCDATA';
|
175: | $form->content_model_type = 'optional';
|
176: | $form->attr['target'] = 'FrameTarget';
|
177: |
|
178: | $input = $this->addBlankElement('input');
|
179: | $input->attr['align'] = 'IAlign';
|
180: |
|
181: | $legend = $this->addBlankElement('legend');
|
182: | $legend->attr['align'] = 'LAlign';
|
183: | }
|
184: | }
|
185: |
|
186: |
|
187: | |