ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
HTMLPurifier_AttrDef_CSS_Border Class Reference

Validates the border property as defined by CSS. More...

+ Inheritance diagram for HTMLPurifier_AttrDef_CSS_Border:
+ Collaboration diagram for HTMLPurifier_AttrDef_CSS_Border:

Public Member Functions

 __construct ($config)
 validate ($string, $config, $context)
 Validates and cleans passed string according to a definition.
- Public Member Functions inherited from HTMLPurifier_AttrDef
 parseCDATA ($string)
 Convenience method that parses a string as if it were CDATA.
 make ($string)
 Factory method for creating this class from a string.

Protected Attributes

 $info = array()
 Local copy of properties this property is shorthand for.

Additional Inherited Members

- Data Fields inherited from HTMLPurifier_AttrDef
 $minimized = false
 Tells us whether or not an HTML attribute is minimized.
 $required = false
 Tells us whether or not an HTML attribute is required.
- Protected Member Functions inherited from HTMLPurifier_AttrDef
 mungeRgb ($string)
 Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly.
 expandCSSEscape ($string)
 Parses a possibly escaped CSS string and returns the "pure" version of it.

Detailed Description

Validates the border property as defined by CSS.

Definition at line 6 of file Border.php.

Constructor & Destructor Documentation

HTMLPurifier_AttrDef_CSS_Border::__construct (   $config)

Definition at line 14 of file Border.php.

{
$def = $config->getCSSDefinition();
$this->info['border-width'] = $def->info['border-width'];
$this->info['border-style'] = $def->info['border-style'];
$this->info['border-top-color'] = $def->info['border-top-color'];
}

Member Function Documentation

HTMLPurifier_AttrDef_CSS_Border::validate (   $string,
  $config,
  $context 
)

Validates and cleans passed string according to a definition.

Parameters
$stringString to be validated and cleaned.
$configMandatory HTMLPurifier_Config object.
$contextMandatory HTMLPurifier_AttrContext object.

Reimplemented from HTMLPurifier_AttrDef.

Definition at line 21 of file Border.php.

References $ret, HTMLPurifier_AttrDef\mungeRgb(), and HTMLPurifier_AttrDef\parseCDATA().

{
$string = $this->parseCDATA($string);
$string = $this->mungeRgb($string);
$bits = explode(' ', $string);
$done = array(); // segments we've finished
$ret = ''; // return value
foreach ($bits as $bit) {
foreach ($this->info as $propname => $validator) {
if (isset($done[$propname])) continue;
$r = $validator->validate($bit, $config, $context);
if ($r !== false) {
$ret .= $r . ' ';
$done[$propname] = true;
break;
}
}
}
return rtrim($ret);
}

+ Here is the call graph for this function:

Field Documentation

HTMLPurifier_AttrDef_CSS_Border::$info = array()
protected

Local copy of properties this property is shorthand for.

Definition at line 12 of file Border.php.


The documentation for this class was generated from the following file: