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
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
/**
|
|
|
|
* @type string
|
|
|
|
*/
|
2007-11-25 02:24:39 +00:00
|
|
|
public $name = 'Bdo';
|
2013-07-16 11:56:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @type array
|
|
|
|
*/
|
2007-11-25 02:24:39 +00:00
|
|
|
public $attr_collections = array(
|
2007-02-04 15:28:47 +00:00
|
|
|
'I18N' => array('dir' => false)
|
|
|
|
);
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
/**
|
|
|
|
* @param HTMLPurifier_Config $config
|
|
|
|
*/
|
|
|
|
public function setup($config)
|
|
|
|
{
|
2008-04-23 02:40:17 +00:00
|
|
|
$bdo = $this->addElement(
|
2013-07-16 11:56:14 +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
|
|
|
);
|
2012-03-17 03:12:16 +00:00
|
|
|
$bdo->attr_transform_post[] = 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 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|