1 : <?php
2 :
3 : /**
4 : * XHTML 1.1 Tables Module, fully defines accessible table elements.
5 : */
6 1 : class HTMLPurifier_HTMLModule_Tables extends HTMLPurifier_HTMLModule
7 : {
8 :
9 : public $name = 'Tables';
10 :
11 : public function __construct() {
12 :
13 1 : $this->addElement('caption', false, 'Inline', 'Common');
14 :
15 1 : $this->addElement('table', 'Block',
16 1 : new HTMLPurifier_ChildDef_Table(), 'Common',
17 : array(
18 1 : 'border' => 'Pixels',
19 1 : 'cellpadding' => 'Length',
20 1 : 'cellspacing' => 'Length',
21 1 : 'frame' => 'Enum#void,above,below,hsides,lhs,rhs,vsides,box,border',
22 1 : 'rules' => 'Enum#none,groups,rows,cols,all',
23 1 : 'summary' => 'Text',
24 : 'width' => 'Length'
25 1 : )
26 1 : );
27 :
28 : // common attributes
29 : $cell_align = array(
30 1 : 'align' => 'Enum#left,center,right,justify,char',
31 1 : 'charoff' => 'Length',
32 1 : 'valign' => 'Enum#top,middle,bottom,baseline',
33 1 : );
34 :
35 1 : $cell_t = array_merge(
36 : array(
37 1 : 'abbr' => 'Text',
38 1 : 'colspan' => 'Number',
39 1 : 'rowspan' => 'Number',
40 1 : ),
41 : $cell_align
42 1 : );
43 1 : $this->addElement('td', false, 'Flow', 'Common', $cell_t);
44 1 : $this->addElement('th', false, 'Flow', 'Common', $cell_t);
45 :
46 1 : $this->addElement('tr', false, 'Required: td | th', 'Common', $cell_align);
47 :
48 1 : $cell_col = array_merge(
49 : array(
50 1 : 'span' => 'Number',
51 1 : 'width' => 'MultiLength',
52 1 : ),
53 : $cell_align
54 1 : );
55 1 : $this->addElement('col', false, 'Empty', 'Common', $cell_col);
56 1 : $this->addElement('colgroup', false, 'Optional: col', 'Common', $cell_col);
57 :
58 1 : $this->addElement('tbody', false, 'Required: tr', 'Common', $cell_align);
59 1 : $this->addElement('thead', false, 'Required: tr', 'Common', $cell_align);
60 1 : $this->addElement('tfoot', false, 'Required: tr', 'Common', $cell_align);
61 :
62 1 : }
63 :
64 : }
65 :
|