15 $this->def =
$config->getHTMLDefinition();
17 $ret .= $this->
start(
'div', array(
'class' =>
'HTMLPurifier_Printer'));
33 $doctype = $this->def->doctype;
37 $ret .= $this->
row(
'Name', $doctype->name);
38 $ret .= $this->
row(
'XML', $doctype->xml ?
'Yes' :
'No');
39 $ret .= $this->
row(
'Default Modules', implode($doctype->modules,
', '));
40 $ret .= $this->
row(
'Default Tidy Modules', implode($doctype->tidyModules,
', '));
57 $ret .= $this->
row(
'Parent of fragment',
$def->info_parent);
59 $ret .= $this->
row(
'Block wrap name',
$def->info_block_wrapper);
69 foreach (
$def->info_tag_transform as $old => $new) {
70 $new = $this->
getClass($new,
'TagTransform_');
71 $list[] =
"<$old> with $new";
97 foreach ($this->def->info_content_sets as $name => $lookup) {
113 $ret .= $this->
element(
'caption',
'Elements ($info)');
114 ksort($this->def->info);
119 foreach ($this->def->info as $name =>
$def) {
121 $ret .= $this->
element(
'th',
"<$name>", array(
'class'=>
'heavy',
'colspan' => 2));
125 $ret .= $this->
element(
'td',
$def->descendants_are_inline ?
'Yes' :
'No');
127 if (!empty(
$def->excludes)) {
133 if (!empty(
$def->attr_transform_pre)) {
139 if (!empty(
$def->attr_transform_post)) {
141 $ret .= $this->
element(
'th',
'Post-AttrTransform');
145 if (!empty(
$def->auto_close)) {
152 $ret .= $this->
element(
'th',
'Allowed attributes');
156 if (!empty(
$def->required_attr)) {
176 if (isset(
$def->elements)) {
177 if (
$def->type ==
'strictblockquote') {
178 $def->validateChildren(array(), $this->config, $context);
180 $elements =
$def->elements;
182 if (
$def->type ==
'chameleon') {
183 $attr[
'rowspan'] = 2;
184 } elseif (
$def->type ==
'empty') {
186 } elseif (
$def->type ==
'table') {
187 $elements = array_flip(array(
'col',
'caption',
'colgroup',
'thead',
188 'tfoot',
'tbody',
'tr'));
190 $ret .= $this->
element(
'th',
'Allowed children', $attr);
192 if (
$def->type ==
'chameleon') {
200 '<em>Inline</em>: ' .
203 } elseif (
$def->type ==
'custom') {
210 '<em>'.ucfirst(
$def->type).
'</em>: ' .
211 $this->escape($this->listifyTagLookup($elements)),0,0);
224 foreach ($array as $name => $discard) {
225 if ($name !==
'#PCDATA' && !isset($this->def->info[$name]))
continue;
239 foreach ($array as $discard => $obj) {
240 $list[] = $this->
getClass($obj,
'AttrTransform_');
252 foreach ($array as $name => $obj) {
253 if ($obj ===
false)
continue;
254 $list[] =
"$name = <i>" . $this->
getClass($obj,
'AttrDef_') .
'</i>';
265 $ret .= $this->
element(
'th', $text, array(
'colspan' => $num,
'class' =>
'heavy'));
renderContentSets()
Renders the Content Sets table.
start($tag, $attr=array())
Main function that renders object or aspect of that object.
listify($array, $polite=false)
Takes a list of strings and turns them into a single list.
escape($string)
Escapes a string for HTML output.
renderInfo()
Renders the Elements ($info) table.
listifyTagLookup($array)
Listifies a tag lookup table.
row($name, $value)
Prints a simple key/value row in a table.
listifyObjectList($array)
Listifies a list of objects by retrieving class names and internal state.
heavyHeader($text, $num=1)
Creates a heavy header row.
end($tag)
Returns an end teg.
renderEnvironment()
Renders environment table, which is miscellaneous info.
$def
Instance of HTMLPurifier_HTMLDefinition, for easy access.
listifyAttr($array)
Listifies a hash of attributes to AttrDef classes.
renderChildren($def)
Renders a row describing the allowed children of an element.
renderDoctype()
Renders the Doctype table.
getClass($obj, $sec_prefix='')
Retrieves the class of an object without prefixes, as well as metadata.
element($tag, $contents, $attr=array(), $escape=true)
Prints a complete element with content inside.
Registry object that contains information about the current context.
$config
Instance of HTMLPurifier_Config, for easy access.