2007-02-04 15:28:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* XHTML 1.1 Bi-directional Text Module, defines elements that
|
|
|
|
* declare directionality of content. Text Extension Module.
|
|
|
|
*/
|
|
|
|
class HTMLPurifier_HTMLModule_Bdo extends HTMLPurifier_HTMLModule
|
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-11-25 02:24:39 +00:00
|
|
|
public $name = 'Bdo';
|
|
|
|
public $attr_collections = array(
|
2007-02-04 15:28:47 +00:00
|
|
|
'I18N' => array('dir' => false)
|
|
|
|
);
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2008-05-22 19:36:59 +00:00
|
|
|
public function setup($config) {
|
2008-04-23 02:40:17 +00:00
|
|
|
$bdo = $this->addElement(
|
2008-04-21 23:28:52 +00:00
|
|
|
'bdo', 'Inline', 'Inline', array('Core', 'Lang'),
|
2007-05-07 01:51:26 +00:00
|
|
|
array(
|
2007-05-23 00:39:07 +00:00
|
|
|
'dir' => 'Enum#ltr,rtl', // required
|
2007-05-07 01:51:26 +00:00
|
|
|
// The Abstract Module specification has the attribute
|
2007-05-23 00:39:07 +00:00
|
|
|
// inclusions wrong for bdo: bdo allows Lang
|
2007-05-07 01:51:26 +00:00
|
|
|
)
|
2007-02-04 15:28:47 +00:00
|
|
|
);
|
2007-05-12 20:44:47 +00:00
|
|
|
$bdo->attr_transform_post['required-dir'] = new HTMLPurifier_AttrTransform_BdoDir();
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-05-23 00:39:07 +00:00
|
|
|
$this->attr_collections['I18N']['dir'] = 'Enum#ltr,rtl';
|
2007-02-04 15:28:47 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-02-04 15:28:47 +00:00
|
|
|
}
|
|
|
|
|