<?

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

/**
 * Module name
 */
define("MOD_MAILTEMPLATE",$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 MailTemplateModule();

/**
 * MailTemplateModule
 *
 * This module uses a template to construct the content of the mail that is
 * being sent to the owner of the form.
 * @package   Modules
 * @author    Herman Suijs
 * @see          TemplateModule
 */
class MailTemplateModule extends TemplateModule {
  var 
$name "MailTemplateModule";
  var 
$id MOD_MAILTEMPLATE;
  var 
$execlevel 19;
  var 
$templateID "mailtemplate";

  
/**
   * Constructor
   *
   * Set options and call the superConstructor
   */
  
function MailTemplateModule() {
    
//$this->options[] = new Option("name:alias1:alias2","regular expression",required,stay_enabled_if_omitted,"default");
    
$this->options[] = new Option("mailtemplate:mailfile:templatemail","",true,false);
    
$this->content MAIL_CONTENT;
    
$this->TemplateModule();
  } 
/* function MailTemplateModule() */
  
  /**
   * 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_message("Mailcontent changed to template",$this->name);
      
$debug->add(DB_XFLOW,$this->name,"Mailcontent changed to template");
      
$this->set_content();
      
/*
      $formHandler->set_header("",MAIL_CONTENT);
      $formHandler->set_header("",MAIL_CONTENT);
      $formHandler->set_content($this->tpl->return_file($this->templateID),MAIL_CONTENT);
      */
    
/* if ($this->action()) */
  
/* function do_action() */

/* class MailTemplateModule exten... */

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