Marius Cramer
2013-11-14 b1a6a5a3991cec5cd08873b01376e45d0b247f18
interface/web/tools/form/tpl_default.tform.php
@@ -60,21 +60,21 @@
*/
$form['title']       = 'tpl_default_head_txt';
$form['description']    = 'tpl_default_desc_txt';
$form['name']       = 'tpl_default';
$form['action']      = 'tpl_default.php';
$form['db_table']   = 'sys_user'; // needs to be 'sys_user_theme'
$form['db_table_idx']   = 'userid'; //??
$form["db_history"]   = "no";
$form['tab_default']   = 'main';
$form['list_default']   = 'index.php';
$form['auth']      = 'no'; //?
$form['title']   = 'tpl_default_head_txt';
$form['description']  = 'tpl_default_desc_txt';
$form['name']   = 'tpl_default';
$form['action']  = 'tpl_default.php';
$form['db_table'] = 'sys_user'; // needs to be 'sys_user_theme'
$form['db_table_idx'] = 'userid'; //??
$form["db_history"] = "no";
$form['tab_default'] = 'main';
$form['list_default'] = 'index.php';
$form['auth']  = 'no'; //?
//* 0 = id of the user, > 0 id must match with id of current user
$form['auth_preset']['userid']  = 0;
$form['auth_preset']['userid']  = 0;
//* 0 = default groupid of the user, > 0 id must match with groupid of current user
$form['auth_preset']['groupid'] = 0;
$form['auth_preset']['groupid'] = 0;
//** Permissions are: r = read, i = insert, u = update, d = delete
$form['auth_preset']['perm_user']  = 'riud';
@@ -84,98 +84,98 @@
//* Pick out modules
//* TODO: limit to activated modules of the user
$modules_list = array();
$handle = @opendir(ISPC_WEB_PATH);
while ($file = @readdir ($handle)) {
    if ($file != '.' && $file != '..') {
        if(@is_dir(ISPC_WEB_PATH."/$file")) {
            if(is_file(ISPC_WEB_PATH."/$file/lib/module.conf.php") and $file != 'login' && $file != 'designer' && $file != 'mailuser') {
$handle = @opendir(ISPC_WEB_PATH);
while ($file = @readdir($handle)) {
   if ($file != '.' && $file != '..') {
      if(@is_dir(ISPC_WEB_PATH."/$file")) {
         if(is_file(ISPC_WEB_PATH."/$file/lib/module.conf.php") and $file != 'login' && $file != 'designer' && $file != 'mailuser') {
            $modules_list[$file] = $file;
         }
        }
      }
   }
}
//* Languages
$language_list = array();
$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang');
while ($file = @readdir ($handle)) {
    if ($file != '.' && $file != '..') {
        if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') {
$handle = @opendir(ISPC_ROOT_PATH.'/lib/lang');
while ($file = @readdir($handle)) {
   if ($file != '.' && $file != '..') {
      if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file, -4, 4) == '.lng') {
         $tmp = substr($file, 0, 2);
         $language_list[$tmp] = $tmp;
        }
      }
   }
}
}
//* Load themes
$themes_list = array();
$handle = @opendir(ISPC_THEMES_PATH);
while ($file = @readdir ($handle)) {
    if (substr($file, 0, 1) != '.') {
        if(@is_dir(ISPC_THEMES_PATH."/$file")) {
$handle = @opendir(ISPC_THEMES_PATH);
while ($file = @readdir($handle)) {
   if (substr($file, 0, 1) != '.') {
      if(@is_dir(ISPC_THEMES_PATH."/$file")) {
         if($file == 'default' || (@file_exists(ISPC_THEMES_PATH."/$file/ISPC_VERSION") && trim(@file_get_contents(ISPC_THEMES_PATH."/$file/ISPC_VERSION")) == ISPC_APP_VERSION)) {
                $themes_list[$file] = $file;
            }
        }
            $themes_list[$file] = $file;
         }
      }
   }
}
$form['tabs']['main'] = array (
   'title'    => 'Settings',
   'width'    => 80,
   'template'    => 'templates/interface_settings.htm',
   'fields'    => array (
   ##################################
   # Beginn Datenbankfelder
   ##################################
                'startmodule' => array (
         'datatype'   => 'VARCHAR',
         'formtype'   => 'SELECT',
         'regex'      => '',
         'errmsg'   => '',
         'default'   => '',
         'value'      => $modules_list,
         'separator'   => '',
         'width'      => '30',
         'maxlength'   => '255',
         'rows'      => '',
         'cols'      => ''
   'title'  => 'Settings',
   'width'  => 80,
   'template'  => 'templates/interface_settings.htm',
   'fields'  => array (
      //#################################
      // Beginn Datenbankfelder
      //#################################
      'startmodule' => array (
         'datatype' => 'VARCHAR',
         'formtype' => 'SELECT',
         'regex'  => '',
         'errmsg' => '',
         'default' => '',
         'value'  => $modules_list,
         'separator' => '',
         'width'  => '30',
         'maxlength' => '255',
         'rows'  => '',
         'cols'  => ''
      ),
      'language' => array (
         'datatype'   => 'VARCHAR',
         'formtype'   => 'SELECT',
                        'validators'   => array ( 0 => array (   'type'   => 'NOTEMPTY',
                                                                'errmsg'=> 'language_is_empty'),
                                                   1 => array (   'type'   => 'REGEX',
                                                                'regex' => '/^[a-z]{2}$/i',
                                                                'errmsg'=> 'language_regex_mismatch'),
                                                ),
         'regex'      => '',
         'errmsg'   => '',
         'default'   => '',
         'value'      => $language_list,
         'separator'   => '',
         'width'      => '30',
         'maxlength'   => '2',
         'rows'      => '',
         'cols'      => ''
         'datatype' => 'VARCHAR',
         'formtype' => 'SELECT',
         'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
               'errmsg'=> 'language_is_empty'),
            1 => array ( 'type' => 'REGEX',
               'regex' => '/^[a-z]{2}$/i',
               'errmsg'=> 'language_regex_mismatch'),
         ),
         'regex'  => '',
         'errmsg' => '',
         'default' => '',
         'value'  => $language_list,
         'separator' => '',
         'width'  => '30',
         'maxlength' => '2',
         'rows'  => '',
         'cols'  => ''
      ),
                'app_theme' => array (
                            'datatype'   => 'VARCHAR',
                            'formtype'   => 'SELECT',
                            'regex'   => '',
                            'errmsg'   => '',
                            'default'   => 'default',
                            'value'   => $themes_list,
                            'separator'   => '',
                            'width'   => '30',
                            'maxlength'   => '255',
                            'rows'   => '',
                            'cols'   => ''
                    )
   ##################################
   # ENDE Datenbankfelder
   ##################################
      'app_theme' => array (
         'datatype' => 'VARCHAR',
         'formtype' => 'SELECT',
         'regex' => '',
         'errmsg' => '',
         'default' => 'default',
         'value' => $themes_list,
         'separator' => '',
         'width' => '30',
         'maxlength' => '255',
         'rows' => '',
         'cols' => ''
      )
      //#################################
      // ENDE Datenbankfelder
      //#################################
   )
);