Source for file TextDecoration.php

Documentation is available at TextDecoration.php

  1. <?php
  2.  
  3. /**
  4.  * Validates the value for the CSS property text-decoration
  5.  * @note This class could be generalized into a version that acts sort of
  6.  *        like Enum except you can compound the allowed values.
  7.  */
  8. {
  9.     
  10.     public function validate($string$config$context{
  11.         
  12.         static $allowed_values array(
  13.             'line-through' => true,
  14.             'overline' => true,
  15.             'underline' => true,
  16.         );
  17.         
  18.         $string strtolower($this->parseCDATA($string));
  19.         
  20.         if ($string === 'none'return $string;
  21.         
  22.         $parts explode(' '$string);
  23.         $final '';
  24.         foreach ($parts as $part{
  25.             if (isset($allowed_values[$part])) {
  26.                 $final .= $part ' ';
  27.             }
  28.         }
  29.         $final rtrim($final);
  30.         if ($final === ''return false;
  31.         return $final;
  32.         
  33.     }
  34.     
  35. }

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