|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00006 class HTMLPurifier_HTMLModule_Tables extends HTMLPurifier_HTMLModule 00007 { 00008 00009 public $name = 'Tables'; 00010 00011 public function setup($config) { 00012 00013 $this->addElement('caption', false, 'Inline', 'Common'); 00014 00015 $this->addElement('table', 'Block', 00016 new HTMLPurifier_ChildDef_Table(), 'Common', 00017 array( 00018 'border' => 'Pixels', 00019 'cellpadding' => 'Length', 00020 'cellspacing' => 'Length', 00021 'frame' => 'Enum#void,above,below,hsides,lhs,rhs,vsides,box,border', 00022 'rules' => 'Enum#none,groups,rows,cols,all', 00023 'summary' => 'Text', 00024 'width' => 'Length' 00025 ) 00026 ); 00027 00028 // common attributes 00029 $cell_align = array( 00030 'align' => 'Enum#left,center,right,justify,char', 00031 'charoff' => 'Length', 00032 'valign' => 'Enum#top,middle,bottom,baseline', 00033 ); 00034 00035 $cell_t = array_merge( 00036 array( 00037 'abbr' => 'Text', 00038 'colspan' => 'Number', 00039 'rowspan' => 'Number', 00040 ), 00041 $cell_align 00042 ); 00043 $this->addElement('td', false, 'Flow', 'Common', $cell_t); 00044 $this->addElement('th', false, 'Flow', 'Common', $cell_t); 00045 00046 $this->addElement('tr', false, 'Required: td | th', 'Common', $cell_align); 00047 00048 $cell_col = array_merge( 00049 array( 00050 'span' => 'Number', 00051 'width' => 'MultiLength', 00052 ), 00053 $cell_align 00054 ); 00055 $this->addElement('col', false, 'Empty', 'Common', $cell_col); 00056 $this->addElement('colgroup', false, 'Optional: col', 'Common', $cell_col); 00057 00058 $this->addElement('tbody', false, 'Required: tr', 'Common', $cell_align); 00059 $this->addElement('thead', false, 'Required: tr', 'Common', $cell_align); 00060 $this->addElement('tfoot', false, 'Required: tr', 'Common', $cell_align); 00061 00062 } 00063 00064 } 00065 00066 // vim: et sw=4 sts=4