1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
case INTEGER : //user_error("String" , E_USER_NOTICE) ;
$this->Ctl = $this->form[$i]->Ctl ;
$int = new Validate($this->Ctl,$this->debug) ;
break ;
Ceci est exécuté
default :
break ;
}
}
//
// affihage du message inférieur
// =============================
if ($this->cntFilled == 0)
$this->msg = VIDE ;
elseif ($this->cntFilled < $this->cntField)
$this->msg = KO ;
else
$this->msg = OK ;
}
catch (Exception $E)
{ Exception::exception_handler($E) ; }
}
function __destruct()
{ }
// ==================================
public function getCntField()
{ return($this->cntField) ; }
public function getCntFilled()
{ return($this->cntFilled) ; }
public function isFormValid()
{ if ($this->debug)
user_error("cntStack[".$this->getCntStack()."]", E_USER_NOTICE) ;
return($this->getCntStack() == 0) ; }
// All Screen message area routines
// ==================================
public function getMsg() // Public car function appelée du formulaire...
{ return( $this->tabMsg[$this->msg] ) ; }
// ==================================
}
/*********************************************************************************************************************************************************
* Validate constructor
* ====================
*/
class Validate extends Form implements Validator
{ private $name, $must, $type, $minL, $maxL, $debug ;
const Name = 0 ,
Must = 1 ,
Type = 2 ,
MinL = 3 ,
MaxL = 4 ;
/**
* constructor
* ===========
*/
function __construct(array $Ctl, $debug)
{ $this->name = $Ctl[self::Name] ;
$this->must = $Ctl[self::Must] ;
$this->type = $Ctl[self::Type] ;
$this->minL = $Ctl[self::MinL] ;
$this->maxL = $Ctl[self::MaxL] ;
$this->Class = get_class($Ctl) ;
$this->execute() ;
}
function execute()
{ user_error("Class[".$this->Class."] Name[".$this->name."] Must[".$this->must."] Type[".$this->type."] minL[".$this->minL."] maxL[".$this->maxL."]",
E_USER_NOTICE) ;
} |
Partager