Source for file Border.php

Documentation is available at Border.php

  1. <?php
  2.  
  3. /**
  4.  * Validates the border property as defined by CSS.
  5.  */
  6. {
  7.     
  8.     /**
  9.      * Local copy of properties this property is shorthand for.
  10.      */
  11.     protected $info = array();
  12.     
  13.     public function __construct($config{
  14.         $def $config->getCSSDefinition();
  15.         $this->info['border-width'$def->info['border-width'];
  16.         $this->info['border-style'$def->info['border-style'];
  17.         $this->info['border-top-color'$def->info['border-top-color'];
  18.     }
  19.     
  20.     public function validate($string$config$context{
  21.         $string $this->parseCDATA($string);
  22.         $string $this->mungeRgb($string);
  23.         $bits explode(' '$string);
  24.         $done array()// segments we've finished
  25.         $ret ''// return value
  26.         foreach ($bits as $bit{
  27.             foreach ($this->info as $propname => $validator{
  28.                 if (isset($done[$propname])) continue;
  29.                 $r $validator->validate($bit$config$context);
  30.                 if ($r !== false{
  31.                     $ret .= $r ' ';
  32.                     $done[$propnametrue;
  33.                     break;
  34.                 }
  35.             }
  36.         }
  37.         return rtrim($ret);
  38.     }
  39.     
  40. }

Documentation generated on Thu, 19 Jun 2008 18:48:54 -0400 by phpDocumentor 1.4.2