Source for file Simple.php

Documentation is available at Simple.php

  1. <?php
  2.  
  3. /**
  4.  * Simple transformation, just change tag name to something else,
  5.  * and possibly add some styling. This will cover most of the deprecated
  6.  * tag cases.
  7.  */
  8. {
  9.     
  10.     protected $style;
  11.     
  12.     /**
  13.      * @param $transform_to Tag name to transform to.
  14.      * @param $style CSS style to add to the tag
  15.      */
  16.     public function __construct($transform_to$style null{
  17.         $this->transform_to = $transform_to;
  18.         $this->style = $style;
  19.     }
  20.     
  21.     public function transform($tag$config$context{
  22.         $new_tag clone $tag;
  23.         $new_tag->name $this->transform_to;
  24.         if (!is_null($this->style&&
  25.             ($new_tag instanceof HTMLPurifier_Token_Start || $new_tag instanceof HTMLPurifier_Token_Empty)
  26.         {
  27.             $this->prependCSS($new_tag->attr$this->style);
  28.         }
  29.         return $new_tag;
  30.     }
  31.     
  32. }

Documentation generated on Thu, 19 Jun 2008 18:50:20 -0400 by phpDocumentor 1.4.2