ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
HTMLPurifier_AttrDef_CSS_AlphaValue Class Reference
+ Inheritance diagram for HTMLPurifier_AttrDef_CSS_AlphaValue:
+ Collaboration diagram for HTMLPurifier_AttrDef_CSS_AlphaValue:

Public Member Functions

 __construct ()
 validate ($number, $config, $context)
- Public Member Functions inherited from HTMLPurifier_AttrDef_CSS_Number
 __construct ($non_negative=false)
- 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.

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.
- Protected Attributes inherited from HTMLPurifier_AttrDef_CSS_Number
 $non_negative = false
 Bool indicating whether or not only positive values allowed.

Detailed Description

Definition at line 3 of file AlphaValue.php.

Constructor & Destructor Documentation

HTMLPurifier_AttrDef_CSS_AlphaValue::__construct ( )

Definition at line 6 of file AlphaValue.php.

{
parent::__construct(false); // opacity is non-negative, but we will clamp it
}

Member Function Documentation

HTMLPurifier_AttrDef_CSS_AlphaValue::validate (   $number,
  $config,
  $context 
)
Warning
Some contexts do not pass $config, $context. These variables should not be used without checking HTMLPurifier_Length

Reimplemented from HTMLPurifier_AttrDef_CSS_Number.

Definition at line 10 of file AlphaValue.php.

References $config, and $result.

{
$result = parent::validate($number, $config, $context);
if ($result === false) return $result;
$float = (float) $result;
if ($float < 0.0) $result = '0';
if ($float > 1.0) $result = '1';
return $result;
}

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