mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-03-24 06:47:02 +00:00
Add default value information.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@423 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
6740ba61af
commit
f43616f72d
@ -128,6 +128,20 @@ foreach($definition->info as $namespace_name => $namespace_info) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$raw_default = $definition->defaults[$namespace_name][$name];
|
||||||
|
if (is_bool($raw_default)) {
|
||||||
|
$default = $raw_default ? 'true' : 'false';
|
||||||
|
} elseif (is_string($raw_default)) {
|
||||||
|
$default = "\"$raw_default\"";
|
||||||
|
} else {
|
||||||
|
$default = print_r(
|
||||||
|
$definition->defaults[$namespace_name][$name], true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$dom_constraints->appendChild(
|
||||||
|
$dom_document->createElement('default', $default)
|
||||||
|
);
|
||||||
|
|
||||||
$dom_descriptions = $dom_document->createElement('descriptions');
|
$dom_descriptions = $dom_document->createElement('descriptions');
|
||||||
$dom_directive->appendChild($dom_descriptions);
|
$dom_directive->appendChild($dom_descriptions);
|
||||||
|
|
||||||
|
@ -4,3 +4,4 @@ table td, table th {padding:0.2em;}
|
|||||||
table.constraints {margin:0 0 1em;}
|
table.constraints {margin:0 0 1em;}
|
||||||
table.constraints th {text-align:left;padding-left:0.4em;}
|
table.constraints th {text-align:left;padding-left:0.4em;}
|
||||||
table.constraints td {padding-right:0.4em;}
|
table.constraints td {padding-right:0.4em;}
|
||||||
|
table.constraints td pre {margin:0;}
|
||||||
|
@ -95,5 +95,11 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
<xsl:template match="constraints/default">
|
||||||
|
<tr>
|
||||||
|
<th>Default:</th>
|
||||||
|
<td><pre><xsl:value-of select="." xml:space="preserve" /></pre></td>
|
||||||
|
</tr>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
Loading…
x
Reference in New Issue
Block a user