<?

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

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

require_once(
MODULES_DIR."/template.mod.php");

// Must be at the bottom, donno why, but probably because it extends a
// class that is only included in this file.
//$modules[$name]= new ErrorTemplateModule();

/**
 * ErrorTemplateModule
 *
 * Extend this module to view the used form with the error messages
 * appended. Include the calling form.
 * @package   Modules
 * @author    Herman Suijs
 * @see          TemplateModule
 */
class ErrorTemplateModule extends TemplateModule {
  var 
$name "ErrorTemplateModule";
  var 
$id MOD_ERRORTEMPLATE;
  var 
$execlevel 19;
  var 
$templateID "errortemplate";

  
/**
   * Constructor
   *
   * Set options and call the superConstructor
   */
  
function ErrorTemplateModule() {
    
//$this->options[] = new Option("name:alias1:alias2","regular expression",required,stay_enabled_if_omitted,"default");
    
$this->options[] = new Option("error:errortemplate:errorfile","",true,false);
    
$this->content ERROR_CONTENT;
    
$this->html true;
    
$this->TemplateModule();
  } 
/* function ErrorTemplateModule() */
  
  /**
   * Do action
   *
   * Get the variables, parse the template and put the content back in the
   * FormHandler
   * @see form-handler
   */
  
function do_action() {
    global 
$debug;
    
//call_user_method(do_action,get_parent_class($this));
    
$this->template_action();
    if (
$this->action()) {
      
$debug->add(DB_XFLOW,$this->name,"Displaycontent changed to template");
      
//$debug->add_message("Errorcontent changed to template",$this->name);
      //$formHandler->set_content($this->tpl->return_file($this->templateID),ERROR_CONTENT);
    
/* if ($this->action()) */
    
$this->set_content();
  } 
/* function do_action() */

/* class ErrorTemplateModule exte... */

$modules[$name]= new ErrorTemplateModule();