您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

45 行
1.2KB

  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