4 * Pre-transform that changes converts a boolean attribute to fixed CSS
6 class HTMLPurifier_AttrTransform_BoolToCSS
extends HTMLPurifier_AttrTransform
9 * Name of boolean attribute that is trigger.
15 * CSS declarations to add to style, needs trailing semicolon.
21 * @param string $attr attribute name to convert from
22 * @param string $css CSS declarations to add to style (needs semicolon)
24 public function __construct($attr, $css)
32 * @param HTMLPurifier_Config $config
33 * @param HTMLPurifier_Context $context
36 public function transform($attr, $config, $context)
38 if (!isset($attr[$this->attr
])) {
41 unset($attr[$this->attr
]);
42 $this->prependCSS($attr, $this->css
);