Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / lib / htmlpurifier / HTMLPurifier / HTMLModule / Edit.php
blobc3dc019700022ff45803a8e25d1306a4d7cc60ff
1 <?php
3 require_once 'HTMLPurifier/HTMLModule.php';
4 require_once 'HTMLPurifier/ChildDef/Chameleon.php';
6 /**
7 * XHTML 1.1 Edit Module, defines editing-related elements. Text Extension
8 * Module.
9 */
10 class HTMLPurifier_HTMLModule_Edit extends HTMLPurifier_HTMLModule
13 var $name = 'Edit';
14 var $elements = array('del', 'ins');
15 var $content_sets = array('Inline' => 'del | ins');
17 function HTMLPurifier_HTMLModule_Edit() {
18 foreach ($this->elements as $element) {
19 $this->info[$element] = new HTMLPurifier_ElementDef();
20 $this->info[$element]->attr = array(
21 0 => array('Common'),
22 'cite' => 'URI',
23 // 'datetime' => 'Datetime' // Datetime not implemented
25 // Inline context ! Block context (exclamation mark is
26 // separator, see getChildDef for parsing)
27 $this->info[$element]->content_model =
28 '#PCDATA | Inline ! #PCDATA | Flow';
29 // HTML 4.01 specifies that ins/del must not contain block
30 // elements when used in an inline context, chameleon is
31 // a complicated workaround to acheive this effect
32 $this->info[$element]->content_model_type = 'chameleon';
36 var $defines_child_def = true;
37 function getChildDef($def) {
38 if ($def->content_model_type != 'chameleon') return false;
39 $value = explode('!', $def->content_model);
40 return new HTMLPurifier_ChildDef_Chameleon($value[0], $value[1]);