Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / lib / htmlpurifier / HTMLPurifier / AttrDef / CSS / Composite.php
blob9d2803d26c9a04409df1184807df40902d86b645
1 <?php
3 /**
4 * Allows multiple validators to attempt to validate attribute.
5 *
6 * Composite is just what it sounds like: a composite of many validators.
7 * This means that multiple HTMLPurifier_AttrDef objects will have a whack
8 * at the string. If one of them passes, that's what is returned. This is
9 * especially useful for CSS values, which often are a choice between
10 * an enumerated set of predefined values or a flexible data type.
12 class HTMLPurifier_AttrDef_CSS_Composite extends HTMLPurifier_AttrDef
15 /**
16 * List of HTMLPurifier_AttrDef objects that may process strings
17 * @protected
19 var $defs;
21 /**
22 * @param $defs List of HTMLPurifier_AttrDef objects
24 function HTMLPurifier_AttrDef_CSS_Composite($defs) {
25 $this->defs = $defs;
28 function validate($string, $config, &$context) {
29 foreach ($this->defs as $i => $def) {
30 $result = $this->defs[$i]->validate($string, $config, $context);
31 if ($result !== false) return $result;
33 return false;