ILIAS  release_4-4 Revision
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)
 
 validate ($number, $config, $context)
 
- Public Member Functions inherited from HTMLPurifier_AttrDef
 validate ($string, $config, $context)
 Validates and cleans passed string according to a definition. More...
 
 parseCDATA ($string)
 Convenience method that parses a string as if it were CDATA. More...
 
 make ($string)
 Factory method for creating this class from a string. More...
 

Additional Inherited Members

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

Detailed Description

Definition at line 3 of file AlphaValue.php.

Constructor & Destructor Documentation

◆ __construct()

HTMLPurifier_AttrDef_CSS_AlphaValue::__construct ( )

Definition at line 6 of file AlphaValue.php.

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

Member Function Documentation

◆ validate()

HTMLPurifier_AttrDef_CSS_AlphaValue::validate (   $number,
  $config,
  $context 
)

Definition at line 10 of file AlphaValue.php.

References $result.

10  {
11  $result = parent::validate($number, $config, $context);
12  if ($result === false) return $result;
13  $float = (float) $result;
14  if ($float < 0.0) $result = '0';
15  if ($float > 1.0) $result = '1';
16  return $result;
17  }
$result

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