CSSDefinition.php 1.0 KB

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