ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
TextDecoration.php
Go to the documentation of this file.
1 <?php
2 
9 {
10 
17  public function validate($string, $config, $context)
18  {
19  static $allowed_values = array(
20  'line-through' => true,
21  'overline' => true,
22  'underline' => true,
23  );
24 
25  $string = strtolower($this->parseCDATA($string));
26 
27  if ($string === 'none') {
28  return $string;
29  }
30 
31  $parts = explode(' ', $string);
32  $final = '';
33  foreach ($parts as $part) {
34  if (isset($allowed_values[$part])) {
35  $final .= $part . ' ';
36  }
37  }
38  $final = rtrim($final);
39  if ($final === '') {
40  return false;
41  }
42  return $final;
43  }
44 }
45 
46 // vim: et sw=4 sts=4
$context
Definition: webdav.php:25
Base class for all validating attribute definitions.
Definition: AttrDef.php:13
$config
Definition: bootstrap.php:15
Validates the value for the CSS property text-decoration.
parseCDATA($string)
Convenience method that parses a string as if it were CDATA.
Definition: AttrDef.php:60
validate($string, $config, $context)