Bdo.php 873 B

12345678910111213141516171819202122232425262728293031
  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. public $name = 'Bdo';
  9. public $attr_collections = array(
  10. 'I18N' => array('dir' => false)
  11. );
  12. public function setup($config) {
  13. $bdo = $this->addElement(
  14. 'bdo', 'Inline', 'Inline', array('Core', 'Lang'),
  15. array(
  16. 'dir' => 'Enum#ltr,rtl', // required
  17. // The Abstract Module specification has the attribute
  18. // inclusions wrong for bdo: bdo allows Lang
  19. )
  20. );
  21. $bdo->attr_transform_post['required-dir'] = new HTMLPurifier_AttrTransform_BdoDir();
  22. $this->attr_collections['I18N']['dir'] = 'Enum#ltr,rtl';
  23. }
  24. }
  25. // vim: et sw=4 sts=4