File indexing completed on 2024-05-12 06:02:05

0001 <?php
0002 
0003 /**
0004  * XHTML 1.1 Bi-directional Text Module, defines elements that
0005  * declare directionality of content. Text Extension Module.
0006  */
0007 class HTMLPurifier_HTMLModule_Bdo extends HTMLPurifier_HTMLModule
0008 {
0009 
0010     /**
0011      * @type string
0012      */
0013     public $name = 'Bdo';
0014 
0015     /**
0016      * @type array
0017      */
0018     public $attr_collections = array(
0019         'I18N' => array('dir' => false)
0020     );
0021 
0022     /**
0023      * @param HTMLPurifier_Config $config
0024      */
0025     public function setup($config)
0026     {
0027         $bdo = $this->addElement(
0028             'bdo',
0029             'Inline',
0030             'Inline',
0031             array('Core', 'Lang'),
0032             array(
0033                 'dir' => 'Enum#ltr,rtl', // required
0034                 // The Abstract Module specification has the attribute
0035                 // inclusions wrong for bdo: bdo allows Lang
0036             )
0037         );
0038         $bdo->attr_transform_post[] = new HTMLPurifier_AttrTransform_BdoDir();
0039 
0040         $this->attr_collections['I18N']['dir'] = 'Enum#ltr,rtl';
0041     }
0042 }
0043 
0044 // vim: et sw=4 sts=4