Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / lib / htmlpurifier / HTMLPurifier / AttrDef / CSS / TextDecoration.php
blob294dd8307762f14f44afb705174ecc0b8e787530
1 <?php
3 require_once 'HTMLPurifier/AttrDef.php';
5 /**
6 * Validates the value for the CSS property text-decoration
7 * @note This class could be generalized into a version that acts sort of
8 * like Enum except you can compound the allowed values.
9 */
10 class HTMLPurifier_AttrDef_CSS_TextDecoration extends HTMLPurifier_AttrDef
13 /**
14 * Lookup table of allowed values.
15 * @protected
17 var $allowed_values = array(
18 'line-through' => true,
19 'overline' => true,
20 'underline' => true
23 function validate($string, $config, &$context) {
25 $string = strtolower($this->parseCDATA($string));
26 $parts = explode(' ', $string);
27 $final = '';
28 foreach ($parts as $part) {
29 if (isset($this->allowed_values[$part])) {
30 $final .= $part . ' ';
33 $final = rtrim($final);
34 if ($final === '') return false;
35 return $final;