ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
HTMLPurifier_AttrDef_CSS_TextDecoration Class Reference

Validates the value for the CSS property text-decoration. More...

+ Inheritance diagram for HTMLPurifier_AttrDef_CSS_TextDecoration:
+ Collaboration diagram for HTMLPurifier_AttrDef_CSS_TextDecoration:

Public Member Functions

 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.

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.

Detailed Description

Validates the value for the CSS property text-decoration.

Note
This class could be generalized into a version that acts sort of like Enum except you can compound the allowed values.

Definition at line 8 of file TextDecoration.php.

Member Function Documentation

HTMLPurifier_AttrDef_CSS_TextDecoration::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 11 of file TextDecoration.php.

References HTMLPurifier_AttrDef\parseCDATA().

{
static $allowed_values = array(
'line-through' => true,
'overline' => true,
'underline' => true,
);
$string = strtolower($this->parseCDATA($string));
if ($string === 'none') return $string;
$parts = explode(' ', $string);
$final = '';
foreach ($parts as $part) {
if (isset($allowed_values[$part])) {
$final .= $part . ' ';
}
}
$final = rtrim($final);
if ($final === '') return false;
return $final;
}

+ Here is the call graph for this function:


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