1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-03 20:58:11 +02: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:
Edward Z. Yang
2006-09-16 01:53:13 +00:00
parent 6740ba61af
commit f43616f72d
3 changed files with 21 additions and 0 deletions

View File

@@ -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_directive->appendChild($dom_descriptions);