3 require_once 'HTMLPurifier/AttrTransform.php';
6 * Pre-transform that changes converts a boolean attribute to fixed CSS
8 class HTMLPurifier_AttrTransform_BoolToCSS
9 extends HTMLPurifier_AttrTransform
{
12 * Name of boolean attribute that is trigger
17 * CSS declarations to add to style, needs trailing semicolon
22 * @param $attr string attribute name to convert from
23 * @param $css string CSS declarations to add to style (needs semicolon)
25 function HTMLPurifier_AttrTransform_BoolToCSS($attr, $css) {
30 function transform($attr, $config, &$context) {
31 if (!isset($attr[$this->attr
])) return $attr;
32 unset($attr[$this->attr
]);
33 $this->prependCSS($attr, $this->css
);