2007-02-04 15:28:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once 'HTMLPurifier/HTMLModule.php';
|
2007-02-04 20:09:35 +00:00
|
|
|
require_once 'HTMLPurifier/AttrTransform/BdoDir.php';
|
2007-02-04 15:28:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* XHTML 1.1 Bi-directional Text Module, defines elements that
|
|
|
|
* declare directionality of content. Text Extension Module.
|
|
|
|
*/
|
|
|
|
class HTMLPurifier_HTMLModule_Bdo extends HTMLPurifier_HTMLModule
|
|
|
|
{
|
|
|
|
|
2007-02-14 22:30:17 +00:00
|
|
|
var $name = 'Bdo';
|
2007-02-10 23:35:21 +00:00
|
|
|
var $attr_collections = array(
|
2007-02-04 15:28:47 +00:00
|
|
|
'I18N' => array('dir' => false)
|
|
|
|
);
|
|
|
|
|
|
|
|
function HTMLPurifier_HTMLModule_Bdo() {
|
|
|
|
$dir = new HTMLPurifier_AttrDef_Enum(array('ltr','rtl'), false);
|
2007-05-07 01:51:26 +00:00
|
|
|
$this->addElement(
|
2007-05-08 03:28:58 +00:00
|
|
|
'bdo', true, 'Inline', 'Inline', array('Core', 'Lang'),
|
2007-05-07 01:51:26 +00:00
|
|
|
array(
|
|
|
|
'dir' => $dir, // required
|
|
|
|
// The Abstract Module specification has the attribute
|
|
|
|
// inclusions wrong for bdo: bdo allows
|
|
|
|
// xml:lang too (and we'll toss in lang for good measure,
|
|
|
|
// though it is not allowed for XHTML 1.1, this will
|
|
|
|
// be managed with a global attribute transform)
|
|
|
|
)
|
2007-02-04 15:28:47 +00:00
|
|
|
);
|
2007-05-07 01:51:26 +00:00
|
|
|
$this->info['bdo']->attr_transform_post['required-dir'] = new HTMLPurifier_AttrTransform_BdoDir();
|
|
|
|
$this->attr_collections['I18N']['dir'] = $dir;
|
2007-02-04 15:28:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|