2007-02-04 16:23:26 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once 'HTMLPurifier/HTMLModule.php';
|
2007-02-04 20:09:35 +00:00
|
|
|
require_once 'HTMLPurifier/ChildDef/Table.php';
|
2007-02-04 16:23:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* XHTML 1.1 Tables Module, fully defines accessible table elements.
|
|
|
|
*/
|
|
|
|
class HTMLPurifier_HTMLModule_Tables extends HTMLPurifier_HTMLModule
|
|
|
|
{
|
|
|
|
|
2007-02-14 22:30:17 +00:00
|
|
|
var $name = 'Tables';
|
2007-02-04 16:23:26 +00:00
|
|
|
|
|
|
|
function HTMLPurifier_HTMLModule_Tables() {
|
2007-05-12 20:26:26 +00:00
|
|
|
|
2007-05-13 20:50:53 +00:00
|
|
|
$this->addElement('caption', true, false, 'Inline', 'Common');
|
|
|
|
|
2007-05-12 20:26:26 +00:00
|
|
|
$this->addElement('table', true, 'Block',
|
|
|
|
new HTMLPurifier_ChildDef_Table(), 'Common',
|
|
|
|
array(
|
|
|
|
'border' => 'Pixels',
|
|
|
|
'cellpadding' => 'Length',
|
|
|
|
'cellspacing' => 'Length',
|
2007-05-23 00:39:07 +00:00
|
|
|
'frame' => 'Enum#void,above,below,hsides,lhs,rhs,vsides,box,border',
|
|
|
|
'rules' => 'Enum#none,groups,rows,cols,all',
|
2007-05-12 20:26:26 +00:00
|
|
|
'summary' => 'Text',
|
|
|
|
'width' => 'Length'
|
|
|
|
)
|
|
|
|
);
|
2007-02-04 16:23:26 +00:00
|
|
|
|
2007-05-12 20:26:26 +00:00
|
|
|
// common attributes
|
|
|
|
$cell_align = array(
|
2007-05-23 00:39:07 +00:00
|
|
|
'align' => 'Enum#left,center,right,justify,char',
|
2007-05-13 20:50:53 +00:00
|
|
|
'charoff' => 'Length',
|
2007-05-23 00:39:07 +00:00
|
|
|
'valign' => 'Enum#top,middle,bottom,baseline',
|
2007-05-12 20:26:26 +00:00
|
|
|
);
|
2007-02-04 16:23:26 +00:00
|
|
|
|
2007-05-12 20:26:26 +00:00
|
|
|
$cell_t = array_merge(
|
|
|
|
array(
|
|
|
|
'abbr' => 'Text',
|
|
|
|
'colspan' => 'Number',
|
|
|
|
'rowspan' => 'Number',
|
|
|
|
),
|
|
|
|
$cell_align
|
|
|
|
);
|
|
|
|
$this->addElement('td', true, false, 'Flow', 'Common', $cell_t);
|
|
|
|
$this->addElement('th', true, false, 'Flow', 'Common', $cell_t);
|
2007-02-04 16:23:26 +00:00
|
|
|
|
2007-05-12 20:26:26 +00:00
|
|
|
$this->addElement('tr', true, false, 'Required: td | th', 'Common', $cell_align);
|
2007-02-04 16:23:26 +00:00
|
|
|
|
2007-05-12 20:26:26 +00:00
|
|
|
$cell_col = array_merge(
|
|
|
|
array(
|
|
|
|
'span' => 'Number',
|
|
|
|
'width' => 'MultiLength',
|
|
|
|
),
|
|
|
|
$cell_align
|
|
|
|
);
|
|
|
|
$this->addElement('col', true, false, 'Empty', 'Common', $cell_col);
|
2007-06-23 20:52:57 +00:00
|
|
|
$this->addElement('colgroup', true, false, 'Optional: col', 'Common', $cell_col);
|
2007-02-04 16:23:26 +00:00
|
|
|
|
2007-05-12 20:26:26 +00:00
|
|
|
$this->addElement('tbody', true, false, 'Required: tr', 'Common', $cell_align);
|
|
|
|
$this->addElement('thead', true, false, 'Required: tr', 'Common', $cell_align);
|
|
|
|
$this->addElement('tfoot', true, false, 'Required: tr', 'Common', $cell_align);
|
2007-02-04 16:23:26 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|