HTMLPurifier/HTMLModule/Edit.php Quellcode

Edit.php
gehe zur Dokumentation dieser Datei
1 <?php
2 
8 {
9 
13  public $name = 'Edit';
14 
18  public function setup($config)
19  {
20  $contents = 'Chameleon: #PCDATA | Inline ! #PCDATA | Flow';
21  $attr = array(
22  'cite' => 'URI',
23  // 'datetime' => 'Datetime', // not implemented
24  );
25  $this->addElement('del', 'Inline', $contents, 'Common', $attr);
26  $this->addElement('ins', 'Inline', $contents, 'Common', $attr);
27  }
28 
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 
33  // Inline context ! Block context (exclamation mark is
34  // separator, see getChildDef for parsing)
35 
39  public $defines_child_def = true;
40 
45  public function getChildDef($def)
46  {
47  if ($def->content_model_type != 'chameleon') {
48  return false;
49  }
50  $value = explode('!', $def->content_model);
51  return new HTMLPurifier_ChildDef_Chameleon($value[0], $value[1]);
52  }
53 }
54 
55 // vim: et sw=4 sts=4




Korrekturen, Hinweise und Ergänzungen

Bitte scheuen Sie sich nicht und melden Sie, was auf dieser Seite sachlich falsch oder irreführend ist, was ergänzt werden sollte, was fehlt usw. Dazu bitte oben aus dem Menü Seite den Eintrag Support Forum wählen. Es ist eine kostenlose Anmeldung erforderlich, um Anmerkungen zu posten. Unpassende Postings, Spam usw. werden kommentarlos entfernt.