]> git.immae.eu Git - github/wallabag/wallabag.git/blame - inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Tables.php
remove autoload section in composer.json
[github/wallabag/wallabag.git] / inc / 3rdparty / htmlpurifier / HTMLPurifier / HTMLModule / Tables.php
CommitLineData
d4949327
NL
1<?php\r
2\r
3/**\r
4 * XHTML 1.1 Tables Module, fully defines accessible table elements.\r
5 */\r
6class HTMLPurifier_HTMLModule_Tables extends HTMLPurifier_HTMLModule\r
7{\r
8 /**\r
9 * @type string\r
10 */\r
11 public $name = 'Tables';\r
12\r
13 /**\r
14 * @param HTMLPurifier_Config $config\r
15 */\r
16 public function setup($config)\r
17 {\r
18 $this->addElement('caption', false, 'Inline', 'Common');\r
19\r
20 $this->addElement(\r
21 'table',\r
22 'Block',\r
23 new HTMLPurifier_ChildDef_Table(),\r
24 'Common',\r
25 array(\r
26 'border' => 'Pixels',\r
27 'cellpadding' => 'Length',\r
28 'cellspacing' => 'Length',\r
29 'frame' => 'Enum#void,above,below,hsides,lhs,rhs,vsides,box,border',\r
30 'rules' => 'Enum#none,groups,rows,cols,all',\r
31 'summary' => 'Text',\r
32 'width' => 'Length'\r
33 )\r
34 );\r
35\r
36 // common attributes\r
37 $cell_align = array(\r
38 'align' => 'Enum#left,center,right,justify,char',\r
39 'charoff' => 'Length',\r
40 'valign' => 'Enum#top,middle,bottom,baseline',\r
41 );\r
42\r
43 $cell_t = array_merge(\r
44 array(\r
45 'abbr' => 'Text',\r
46 'colspan' => 'Number',\r
47 'rowspan' => 'Number',\r
48 // Apparently, as of HTML5 this attribute only applies\r
49 // to 'th' elements.\r
50 'scope' => 'Enum#row,col,rowgroup,colgroup',\r
51 ),\r
52 $cell_align\r
53 );\r
54 $this->addElement('td', false, 'Flow', 'Common', $cell_t);\r
55 $this->addElement('th', false, 'Flow', 'Common', $cell_t);\r
56\r
57 $this->addElement('tr', false, 'Required: td | th', 'Common', $cell_align);\r
58\r
59 $cell_col = array_merge(\r
60 array(\r
61 'span' => 'Number',\r
62 'width' => 'MultiLength',\r
63 ),\r
64 $cell_align\r
65 );\r
66 $this->addElement('col', false, 'Empty', 'Common', $cell_col);\r
67 $this->addElement('colgroup', false, 'Optional: col', 'Common', $cell_col);\r
68\r
69 $this->addElement('tbody', false, 'Required: tr', 'Common', $cell_align);\r
70 $this->addElement('thead', false, 'Required: tr', 'Common', $cell_align);\r
71 $this->addElement('tfoot', false, 'Required: tr', 'Common', $cell_align);\r
72 }\r
73}\r
74\r
75// vim: et sw=4 sts=4\r