CSSDefinition.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. class HTMLPurifier_Printer_CSSDefinition extends HTMLPurifier_Printer
  3. {
  4. /**
  5. * @type HTMLPurifier_CSSDefinition
  6. */
  7. protected $def;
  8. /**
  9. * @param HTMLPurifier_Config $config
  10. * @return string
  11. */
  12. public function render($config)
  13. {
  14. $this->def = $config->getCSSDefinition();
  15. $ret = '';
  16. $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer'));
  17. $ret .= $this->start('table');
  18. $ret .= $this->element('caption', 'Properties ($info)');
  19. $ret .= $this->start('thead');
  20. $ret .= $this->start('tr');
  21. $ret .= $this->element('th', 'Property', array('class' => 'heavy'));
  22. $ret .= $this->element('th', 'Definition', array('class' => 'heavy', 'style' => 'width:auto;'));
  23. $ret .= $this->end('tr');
  24. $ret .= $this->end('thead');
  25. ksort($this->def->info);
  26. foreach ($this->def->info as $property => $obj) {
  27. $name = $this->getClass($obj, 'AttrDef_');
  28. $ret .= $this->row($property, $name);
  29. }
  30. $ret .= $this->end('table');
  31. $ret .= $this->end('div');
  32. return $ret;
  33. }
  34. }
  35. // vim: et sw=4 sts=4