HTMLPurifier 4.4.0
/home/ezyang/Dev/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php
Go to the documentation of this file.
00001 <?php
00002 
00006 class HTMLPurifier_AttrTransform_BoolToCSS extends HTMLPurifier_AttrTransform {
00007 
00011     protected $attr;
00012 
00016     protected $css;
00017 
00022     public function __construct($attr, $css) {
00023         $this->attr = $attr;
00024         $this->css  = $css;
00025     }
00026 
00027     public function transform($attr, $config, $context) {
00028         if (!isset($attr[$this->attr])) return $attr;
00029         unset($attr[$this->attr]);
00030         $this->prependCSS($attr, $this->css);
00031         return $attr;
00032     }
00033 
00034 }
00035 
00036 // vim: et sw=4 sts=4