<?

/**
 * dutchcheck.mod.php
 * @package   Modules
 */

/**
 * Module name
 */
define("MOD_DUTCHCHECK",$name);

/**
 * Regular expression for dutch Telefoon
 */
define("REGEX_TELEFOON","^((\+?[1-9][0-9])|0) ?(6 ?-? ?[0-9\. ]{8,}|[1-9][0-9]{1,2} ?-? ?[0-9\. ]{7,}|[1-9]{2}[0-9] ?-? ?[0-9\. ]{6,})$");
/**
 * Regular expression for dutch Postcode
 */
define("REGEX_POSTCODE","(^([1-9][0-9]{3})( ?)([a-zA-Z]{2})$)");

require_once(
MODULES_DIR."/fieldcheck.mod.php");
unset(
$modules[$name]);

/**
 * DutchCheckModule
 *
 * This module uses all the functionality from its superclass. It only adds
 * some checks on the specified fields in the constructor. The check on a
 * field value matches the regular expression.
 * @package   Modules
 * @author    Herman Suijs
 * @see          FieldCheckModule
 */

class DutchCheckModule extends FieldCheckModule {
  var 
$name "DutchCheckModule";
  var 
$id MOD_DUTCHCHECK;
  
//var $execlevel = 0; // set in FieldCheckModule

  /**
   * Constructor
   *
   * Set options and call the superConstructor
   */
  
function DutchCheckModule() {
    
$this->add_check("telefoon:telefoonnr:telefoonnummer:telnr:telnummer",REGEX_TELEFOON);
    
$this->replace_check("fax","fax:faxnr:faxnummer:telefax:tele-fax:telefaxnr:telefaxnummer",REGEX_TELEFOON);
    
$this->add_check("postcode:post-code:postc",REGEX_POSTCODE);
    
$this->add_check("tijd",REGEX_TIME);
    
$this->add_check("datum",REGEX_DATE);
    
$this->FieldCheckModule();
  } 
// end function DutchCheckModul /* function DutchCheckModule() */e
  
// end class /* class DutchCheckModule extends... */

// Donno why, but for this particular module, it will not (allways) work if
// it was created at the top of this file.
$modules[$name]= new DutchCheckModule();
//echo fh_serialize($modules[$name]);