PageRenderTime 50ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/plugins/vjCommentPlugin/lib/tools/htmlpurifier/library/HTMLPurifier/HTMLModule/Tables.php

https://bitbucket.org/Kudlaty/360kdw
PHP | 66 lines | 48 code | 13 blank | 5 comment | 0 complexity | 7d6e6c2595498da192d69006c46d769d MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. /**
  3. * XHTML 1.1 Tables Module, fully defines accessible table elements.
  4. */
  5. class HTMLPurifier_HTMLModule_Tables extends HTMLPurifier_HTMLModule
  6. {
  7. public $name = 'Tables';
  8. public function setup($config) {
  9. $this->addElement('caption', false, 'Inline', 'Common');
  10. $this->addElement('table', 'Block',
  11. new HTMLPurifier_ChildDef_Table(), 'Common',
  12. array(
  13. 'border' => 'Pixels',
  14. 'cellpadding' => 'Length',
  15. 'cellspacing' => 'Length',
  16. 'frame' => 'Enum#void,above,below,hsides,lhs,rhs,vsides,box,border',
  17. 'rules' => 'Enum#none,groups,rows,cols,all',
  18. 'summary' => 'Text',
  19. 'width' => 'Length'
  20. )
  21. );
  22. // common attributes
  23. $cell_align = array(
  24. 'align' => 'Enum#left,center,right,justify,char',
  25. 'charoff' => 'Length',
  26. 'valign' => 'Enum#top,middle,bottom,baseline',
  27. );
  28. $cell_t = array_merge(
  29. array(
  30. 'abbr' => 'Text',
  31. 'colspan' => 'Number',
  32. 'rowspan' => 'Number',
  33. ),
  34. $cell_align
  35. );
  36. $this->addElement('td', false, 'Flow', 'Common', $cell_t);
  37. $this->addElement('th', false, 'Flow', 'Common', $cell_t);
  38. $this->addElement('tr', false, 'Required: td | th', 'Common', $cell_align);
  39. $cell_col = array_merge(
  40. array(
  41. 'span' => 'Number',
  42. 'width' => 'MultiLength',
  43. ),
  44. $cell_align
  45. );
  46. $this->addElement('col', false, 'Empty', 'Common', $cell_col);
  47. $this->addElement('colgroup', false, 'Optional: col', 'Common', $cell_col);
  48. $this->addElement('tbody', false, 'Required: tr', 'Common', $cell_align);
  49. $this->addElement('thead', false, 'Required: tr', 'Common', $cell_align);
  50. $this->addElement('tfoot', false, 'Required: tr', 'Common', $cell_align);
  51. }
  52. }
  53. // vim: et sw=4 sts=4