mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-14 01:08:41 +00:00
9f996b125a
- Printer adheres to configuration's directives on output format - Fix improperly named form field in ConfigForm printer . HTMLPurifier_Config::getAllowedDirectivesForForm implemented, allows much easier selective embedding of configuration values . Doctype objects now accept public and system DTD identifiers . %HTML.Doctype is now constrained by specific values, to specify a custom doctype use new %HTML.CustomDoctype . ConfigForm truncates long directives to keep the form small, and does not re-output namespaces git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1232 48356398-32a2-884e-a903-53898d9a118a
40 lines
2.4 KiB
PHP
40 lines
2.4 KiB
PHP
<?php
|
|
|
|
// overload default configuration schema temporarily
|
|
$custom_schema = new HTMLPurifier_ConfigSchema();
|
|
$old = HTMLPurifier_ConfigSchema::instance();
|
|
$custom_schema =& HTMLPurifier_ConfigSchema::instance($custom_schema);
|
|
|
|
HTMLPurifier_ConfigSchema::defineNamespace('Element', 'Chemical substances that cannot be further decomposed');
|
|
|
|
HTMLPurifier_ConfigSchema::define('Element', 'Abbr', 'H', 'string', 'Abbreviation of element name.');
|
|
HTMLPurifier_ConfigSchema::define('Element', 'Name', 'hydrogen', 'istring', 'Full name of atoms.');
|
|
HTMLPurifier_ConfigSchema::define('Element', 'Number', 1, 'int', 'Atomic number, is identity.');
|
|
HTMLPurifier_ConfigSchema::define('Element', 'Mass', 1.00794, 'float', 'Atomic mass.');
|
|
HTMLPurifier_ConfigSchema::define('Element', 'Radioactive', false, 'bool', 'Does it have rapid decay?');
|
|
HTMLPurifier_ConfigSchema::define('Element', 'Isotopes', array('1' => true, '2' => true, '3' => true), 'lookup',
|
|
'What numbers of neutrons for this element have been observed?');
|
|
HTMLPurifier_ConfigSchema::define('Element', 'Traits', array('nonmetallic', 'odorless', 'flammable'), 'list',
|
|
'What are general properties of the element?');
|
|
HTMLPurifier_ConfigSchema::define('Element', 'IsotopeNames', array('1' => 'protium', '2' => 'deuterium', '3' => 'tritium'), 'hash',
|
|
'Lookup hash of neutron counts to formal names.');
|
|
|
|
HTMLPurifier_ConfigSchema::defineNamespace('Instrument', 'Of the musical type.');
|
|
|
|
HTMLPurifier_ConfigSchema::define('Instrument', 'Manufacturer', 'Yamaha', 'string', 'Who made it?');
|
|
HTMLPurifier_ConfigSchema::defineAllowedValues('Instrument', 'Manufacturer', array(
|
|
'Yamaha', 'Conn-Selmer', 'Vandoren', 'Laubin', 'Buffet', 'other'));
|
|
HTMLPurifier_ConfigSchema::defineValueAliases('Instrument', 'Manufacturer', array(
|
|
'Selmer' => 'Conn-Selmer'));
|
|
|
|
HTMLPurifier_ConfigSchema::define('Instrument', 'Family', 'woodwind', 'istring', 'What family is it?');
|
|
HTMLPurifier_ConfigSchema::defineAllowedValues('Instrument', 'Family', array(
|
|
'brass', 'woodwind', 'percussion', 'string', 'keyboard', 'electronic'));
|
|
HTMLPurifier_ConfigSchema::defineValueAliases('Instrument', 'Family', array(
|
|
'synth' => 'electronic'));
|
|
|
|
HTMLPurifier_ConfigSchema::defineNamespace('ReportCard', 'It is for grades.');
|
|
HTMLPurifier_ConfigSchema::define('ReportCard', 'English', null, 'string/null', 'Grade from English class.');
|
|
HTMLPurifier_ConfigSchema::define('ReportCard', 'Absences', 0, 'int', 'How many times missing from school?');
|
|
|
|
?>
|