2006-11-24 06:26:02 +00:00
|
|
|
<?php
|
|
|
|
|
2006-11-25 05:05:32 +00:00
|
|
|
class HTMLPurifier_Printer_CSSDefinition extends HTMLPurifier_Printer
|
2006-11-24 06:26:02 +00:00
|
|
|
{
|
2013-07-16 11:56:14 +00:00
|
|
|
/**
|
|
|
|
* @type HTMLPurifier_CSSDefinition
|
|
|
|
*/
|
2007-11-25 02:24:39 +00:00
|
|
|
protected $def;
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
/**
|
|
|
|
* @param HTMLPurifier_Config $config
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function render($config)
|
|
|
|
{
|
2006-11-25 05:05:32 +00:00
|
|
|
$this->def = $config->getCSSDefinition();
|
|
|
|
$ret = '';
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-11-25 05:05:32 +00:00
|
|
|
$ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer'));
|
|
|
|
$ret .= $this->start('table');
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-11-25 05:05:32 +00:00
|
|
|
$ret .= $this->element('caption', 'Properties ($info)');
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-11-25 05:05:32 +00:00
|
|
|
$ret .= $this->start('thead');
|
|
|
|
$ret .= $this->start('tr');
|
|
|
|
$ret .= $this->element('th', 'Property', array('class' => 'heavy'));
|
|
|
|
$ret .= $this->element('th', 'Definition', array('class' => 'heavy', 'style' => 'width:auto;'));
|
|
|
|
$ret .= $this->end('tr');
|
|
|
|
$ret .= $this->end('thead');
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-11-25 05:05:32 +00:00
|
|
|
ksort($this->def->info);
|
|
|
|
foreach ($this->def->info as $property => $obj) {
|
|
|
|
$name = $this->getClass($obj, 'AttrDef_');
|
|
|
|
$ret .= $this->row($property, $name);
|
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-11-25 05:05:32 +00:00
|
|
|
$ret .= $this->end('table');
|
|
|
|
$ret .= $this->end('div');
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-11-25 05:05:32 +00:00
|
|
|
return $ret;
|
|
|
|
}
|
2006-11-24 06:26:02 +00:00
|
|
|
}
|
|
|
|
|
2008-12-06 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|