<?php


    $_table = 'module_contact_form';

    if(file_exists('_modules/contact_form/l18n/'.$cfg['admin']['language'].'.php')) {
        require_once('_modules/contact_form/l18n/'.$cfg['admin']['language'].'.php');
    }
    $table_config = array(
        'table' => 'module_contact_form',
        'multiSelect' => true,    
        'idField'=>'modConId',
    );
    $table_fields = array(
        'modConId' => array(
            'type' => 'id', 
            'default_list' => true,           
        ),  
        'modConSubject' => array(
            'type' => 'text', 
            'length' => 200,
            'size'=>400      
        ), 
        'modConEmail' => array(
            'type' => 'text', 
            'length' => 100,
            'size'=>200      
        ),  
        'modConMailFrom' => array(
            'type' => 'text', 
            'length' => 100,
            'size'=>200      
        ),    
        'modConFields' => array(
            'type' => 'checkboxes',
            'values' => array('name', 'email', 'message', 'subject'),
            'labels' => array(_t('name'), _t('email'), _t('message'), _t('subject'))   
        ),  
        'modConReqFields' => array(
            'type' => 'checkboxes',
            'values' => array('name', 'email', 'message', 'subject'),
            'labels' => array(_t('name'), _t('email'), _t('message'), _t('subject'))   
        ),                                      
        'modConTemplate' => array(
            'type' => 'htmlarea',            
            'editor' => 'basic',
            'height' => '300',
            'legend'=>_t('legend_Template') 
        ),       
                       
                
    );
    


    function module_index() {
        global $module, $db, $cfg, $module_settings;

        /*
        if(!$module_settings['modUsrTable']) {
            $_SESSION['backend_alert'][]=array('type'=>'danger','message'=>'WrongModuleConfiguration','xtra'=>'modUsrTable');        
            Header('Location: /'.$cfg['admin']['slug'].'/modules/settings?id='.$module['modId']);
            exit;
        }
        */
        $table=mysqli_fetch_assoc(_mysqli_query($db, "SELECT * FROM tables WHERE tabName='".$module_settings['modConTable']."'"));
        Header('Location: /'.$cfg['admin']['slug'].'/table/view?tid='.$table['tabId']);
        exit;                        
    }



     

?>
