<?php


    $_table = 'module_users';

    if(file_exists('_modules/users/l18n/'.$cfg['admin']['language'].'.php')) {
        require_once('_modules/users/l18n/'.$cfg['admin']['language'].'.php');
    }
    $table_config = array(
        'table' => 'module_users',
        'multiSelect' => true,    
        'idField'=>'modUsrId',
    );
    $table_fields = array(
        'modUsrId' => array(
            'type' => 'id', 
            'default_list' => true,           
        ),         
        'modUsrTable' => array(
            'type' => 'table'                         
        ),
        'modUsrMailFrom' => array(
            'type' => 'text',
            'length' => 80,
            'size' => 200,        
        ),        
        'modUsrFieldLogin' => array(
            'type' => 'table_field',
            'filter_table' => 'modUsrTable',
        ),
        'modUsrFieldPassword' => array(
            'type' => 'table_field',
            'filter_table' => 'modUsrTable',
        ),
        'modUsrFieldEmail' => array(
            'type' => 'table_field',
            'filter_table' => 'modUsrTable',
        ),
        'modUsrFieldActivationKey' => array(
            'type' => 'table_field',
            'filter_table' => 'modUsrTable',
        ),        
        'modUsrRegistrationMode' => array(
            'type' => 'select',
            'values' => array('no_hello_activation', 'hello', 'activation', 'hello_activation'),
            'labels' => array(_t('no_hello_activation'), _t('hello'), _t('activation'), _t('hello_activation')),            
        ),
        'modUsrPasswordResetPath' => array(
            'type' => 'text',
            'length' => 100,
            'size' => 200,
        ),
        'modUsrTabMessagesTemplates' => array(
            'type'=>'tab',
            'title'=>_t('MessagesTemplates')        
        ),
        'modUsrMTActivation' => array(
            'type' => 'htmlarea',            
            'editor' => 'basic',
            'height' => '300',
            'language' => true,
            'legend'=>_t('legend_MTActivation') 
        ),   
        'modUsrMTHello' => array(
            'type' => 'htmlarea',            
            'editor' => 'basic',
            'height' => '300',
            'language' => true,
            'legend'=>_t('legend_MTHello')             
        ),
        'modUsrMTPasswordReminder' => array(
            'type' => 'htmlarea',            
            'editor' => 'basic',
            'height' => '300',
            'language' => true,
            'legend'=>_t('legend_MTPasswordReminder')              
        ),                                           
                
                       
                
    );
    


    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['modUsrTable']."'"));
        Header('Location: /'.$cfg['admin']['slug'].'/table/view?tid='.$table['tabId']);
        exit;                        
    }



     

?>
