21
19
class HTMLPurifier_HTMLModule_Legacy extends HTMLPurifier_HTMLModule
28
function setup($config) {
30
$this->addElement('basefont', true, 'Inline', 'Empty', false, array(
22
public $name = 'Legacy';
24
public function setup($config) {
26
$this->addElement('basefont', 'Inline', 'Empty', false, array(
31
27
'color' => 'Color',
32
28
'face' => 'Text', // extremely broad, we should
33
29
'size' => 'Text', // tighten it
36
$this->addElement('center', true, 'Block', 'Flow', 'Common');
37
$this->addElement('dir', true, 'Block', 'Required: li', 'Common', array(
32
$this->addElement('center', 'Block', 'Flow', 'Common');
33
$this->addElement('dir', 'Block', 'Required: li', 'Common', array(
38
34
'compact' => 'Bool#compact'
40
$this->addElement('font', true, 'Inline', 'Inline', array('Core', 'I18N'), array(
36
$this->addElement('font', 'Inline', 'Inline', array('Core', 'I18N'), array(
41
37
'color' => 'Color',
42
38
'face' => 'Text', // extremely broad, we should
43
39
'size' => 'Text', // tighten it
45
$this->addElement('menu', true, 'Block', 'Required: li', 'Common', array(
41
$this->addElement('menu', 'Block', 'Required: li', 'Common', array(
46
42
'compact' => 'Bool#compact'
48
$this->addElement('s', true, 'Inline', 'Inline', 'Common');
49
$this->addElement('strike', true, 'Inline', 'Inline', 'Common');
50
$this->addElement('u', true, 'Inline', 'Inline', 'Common');
45
$s = $this->addElement('s', 'Inline', 'Inline', 'Common');
46
$s->formatting = true;
48
$strike = $this->addElement('strike', 'Inline', 'Inline', 'Common');
49
$strike->formatting = true;
51
$u = $this->addElement('u', 'Inline', 'Inline', 'Common');
52
$u->formatting = true;
52
54
// setup modifications to old elements
54
56
$align = 'Enum#left,right,center,justify';
56
$address =& $this->addBlankElement('address');
58
$address = $this->addBlankElement('address');
57
59
$address->content_model = 'Inline | #PCDATA | p';
58
60
$address->content_model_type = 'optional';
59
61
$address->child = false;
61
$blockquote =& $this->addBlankElement('blockquote');
63
$blockquote = $this->addBlankElement('blockquote');
62
64
$blockquote->content_model = 'Flow | #PCDATA';
63
65
$blockquote->content_model_type = 'optional';
64
66
$blockquote->child = false;
66
$br =& $this->addBlankElement('br');
68
$br = $this->addBlankElement('br');
67
69
$br->attr['clear'] = 'Enum#left,all,right,none';
69
$caption =& $this->addBlankElement('caption');
71
$caption = $this->addBlankElement('caption');
70
72
$caption->attr['align'] = 'Enum#top,bottom,left,right';
72
$div =& $this->addBlankElement('div');
74
$div = $this->addBlankElement('div');
73
75
$div->attr['align'] = $align;
75
$dl =& $this->addBlankElement('dl');
77
$dl = $this->addBlankElement('dl');
76
78
$dl->attr['compact'] = 'Bool#compact';
78
80
for ($i = 1; $i <= 6; $i++) {
79
$h =& $this->addBlankElement("h$i");
81
$h = $this->addBlankElement("h$i");
80
82
$h->attr['align'] = $align;
83
$hr =& $this->addBlankElement('hr');
85
$hr = $this->addBlankElement('hr');
84
86
$hr->attr['align'] = $align;
85
87
$hr->attr['noshade'] = 'Bool#noshade';
86
88
$hr->attr['size'] = 'Pixels';
87
89
$hr->attr['width'] = 'Length';
89
$img =& $this->addBlankElement('img');
91
$img = $this->addBlankElement('img');
90
92
$img->attr['align'] = 'Enum#top,middle,bottom,left,right';
91
93
$img->attr['border'] = 'Pixels';
92
94
$img->attr['hspace'] = 'Pixels';
93
95
$img->attr['vspace'] = 'Pixels';
95
97
// figure out this integer business
97
$li =& $this->addBlankElement('li');
99
$li = $this->addBlankElement('li');
98
100
$li->attr['value'] = new HTMLPurifier_AttrDef_Integer();
99
101
$li->attr['type'] = 'Enum#s:1,i,I,a,A,disc,square,circle';
101
$ol =& $this->addBlankElement('ol');
103
$ol = $this->addBlankElement('ol');
102
104
$ol->attr['compact'] = 'Bool#compact';
103
105
$ol->attr['start'] = new HTMLPurifier_AttrDef_Integer();
104
106
$ol->attr['type'] = 'Enum#s:1,i,I,a,A';
106
$p =& $this->addBlankElement('p');
108
$p = $this->addBlankElement('p');
107
109
$p->attr['align'] = $align;
109
$pre =& $this->addBlankElement('pre');
111
$pre = $this->addBlankElement('pre');
110
112
$pre->attr['width'] = 'Number';
112
114
// script omitted
114
$table =& $this->addBlankElement('table');
116
$table = $this->addBlankElement('table');
115
117
$table->attr['align'] = 'Enum#left,center,right';
116
118
$table->attr['bgcolor'] = 'Color';
118
$tr =& $this->addBlankElement('tr');
120
$tr = $this->addBlankElement('tr');
119
121
$tr->attr['bgcolor'] = 'Color';
121
$th =& $this->addBlankElement('th');
123
$th = $this->addBlankElement('th');
122
124
$th->attr['bgcolor'] = 'Color';
123
125
$th->attr['height'] = 'Length';
124
126
$th->attr['nowrap'] = 'Bool#nowrap';
125
127
$th->attr['width'] = 'Length';
127
$td =& $this->addBlankElement('td');
129
$td = $this->addBlankElement('td');
128
130
$td->attr['bgcolor'] = 'Color';
129
131
$td->attr['height'] = 'Length';
130
132
$td->attr['nowrap'] = 'Bool#nowrap';
131
133
$td->attr['width'] = 'Length';
133
$ul =& $this->addBlankElement('ul');
135
$ul = $this->addBlankElement('ul');
134
136
$ul->attr['compact'] = 'Bool#compact';
135
137
$ul->attr['type'] = 'Enum#square,disc,circle';
143
// vim: et sw=4 sts=4