0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-09-20 11:15:18 +00:00
htmlpurifier/library/HTMLPurifier/HTMLModule/Tables.php
Edward Z. Yang 522c8ed7c2 [3.1.0] The bulk of autoload support added
- Add FSTools:globr()
- require_once removed from all files
- HTMLPurifier.autoload.php added to register autoload handler
- Removed redundant chdir in maintenance script
- Modified standalone to use HTMLPurifier.includes.php for including stuff
- Added maintenance script remove-require-once.php which we used once and should never use again

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1516 48356398-32a2-884e-a903-53898d9a118a
2008-01-27 01:54:41 +00:00

66 lines
2.1 KiB
PHP

<?php
/**
* XHTML 1.1 Tables Module, fully defines accessible table elements.
*/
class HTMLPurifier_HTMLModule_Tables extends HTMLPurifier_HTMLModule
{
public $name = 'Tables';
public function __construct() {
$this->addElement('caption', true, false, 'Inline', 'Common');
$this->addElement('table', true, 'Block',
new HTMLPurifier_ChildDef_Table(), 'Common',
array(
'border' => 'Pixels',
'cellpadding' => 'Length',
'cellspacing' => 'Length',
'frame' => 'Enum#void,above,below,hsides,lhs,rhs,vsides,box,border',
'rules' => 'Enum#none,groups,rows,cols,all',
'summary' => 'Text',
'width' => 'Length'
)
);
// common attributes
$cell_align = array(
'align' => 'Enum#left,center,right,justify,char',
'charoff' => 'Length',
'valign' => 'Enum#top,middle,bottom,baseline',
);
$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);
$this->addElement('tr', true, false, 'Required: td | th', 'Common', $cell_align);
$cell_col = array_merge(
array(
'span' => 'Number',
'width' => 'MultiLength',
),
$cell_align
);
$this->addElement('col', true, false, 'Empty', 'Common', $cell_col);
$this->addElement('colgroup', true, false, 'Optional: col', 'Common', $cell_col);
$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);
}
}