Bdo.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * XHTML 1.1 Bi-directional Text Module, defines elements that
  4. * declare directionality of content. Text Extension Module.
  5. */
  6. class HTMLPurifier_HTMLModule_Bdo extends HTMLPurifier_HTMLModule
  7. {
  8. /**
  9. * @type string
  10. */
  11. public $name = 'Bdo';
  12. /**
  13. * @type array
  14. */
  15. public $attr_collections = array(
  16. 'I18N' => array('dir' => false)
  17. );
  18. /**
  19. * @param HTMLPurifier_Config $config
  20. */
  21. public function setup($config)
  22. {
  23. $bdo = $this->addElement(
  24. 'bdo',
  25. 'Inline',
  26. 'Inline',
  27. array('Core', 'Lang'),
  28. array(
  29. 'dir' => 'Enum#ltr,rtl', // required
  30. // The Abstract Module specification has the attribute
  31. // inclusions wrong for bdo: bdo allows Lang
  32. )
  33. );
  34. $bdo->attr_transform_post[] = new HTMLPurifier_AttrTransform_BdoDir();
  35. $this->attr_collections['I18N']['dir'] = 'Enum#ltr,rtl';
  36. }
  37. }
  38. // vim: et sw=4 sts=4