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
14 * CSS declarations to add to style, needs trailing semicolon
19 * @param $attr string attribute name to convert from
20 * @param $css string CSS declarations to add to style (needs semicolon)
22 public function __construct($attr, $css) {
27 public function transform($attr, $config, $context) {
28 if (!isset($attr[$this->attr
])) return $attr;
29 unset($attr[$this->attr
]);
30 $this->prependCSS($attr, $this->css
);