00001 <?php 00002 00015 // $Id: FormValidatorInSet.inc.php,v 1.9 2008/07/01 01:16:09 asmecher Exp $ 00016 00017 00018 import('form.validation.FormValidator'); 00019 00020 class FormValidatorInSet extends FormValidator { 00021 00023 var $acceptedValues; 00024 00030 function FormValidatorInSet(&$form, $field, $type, $message, $acceptedValues) { 00031 parent::FormValidator($form, $field, $type, $message); 00032 $this->acceptedValues = $acceptedValues; 00033 } 00034 00040 function isValid() { 00041 return $this->isEmptyAndOptional() || in_array($this->form->getData($this->field), $this->acceptedValues); 00042 } 00043 00044 } 00045 00046 ?>
1.5.6