tbrehm
2013-08-02 2332b2279d8a8599b4f041370315edc9544b1560
commit | author | age
381520 1 <?php
M 2
3 /*
4     Form Definition
5
6     Tabledefinition
7
8     Datatypes:
9     - INTEGER (Forces the input to Int)
10     - DOUBLE
11     - CURRENCY (Formats the values to currency notation)
12     - VARCHAR (no format check, maxlength: 255)
13     - TEXT (no format check)
14     - DATE (Dateformat, automatic conversion to timestamps)
15
16     Formtype:
17     - TEXT (Textfield)
18     - TEXTAREA (Textarea)
19     - PASSWORD (Password textfield, input is not shown when edited)
20     - SELECT (Select option field)
21     - RADIO
22     - CHECKBOX
23     - CHECKBOXARRAY
24     - FILE
25
26     VALUE:
27     - Wert oder Array
28
29     Hint:
30     The ID field of the database table is not part of the datafield definition.
31     The ID field must be always auto incement (int or bigint).
2332b2 32
381520 33     Search:
M 34     - searchable = 1 or searchable = 2 include the field in the search
35     - searchable = 1: this field will be the title of the search result
36     - searchable = 2: this field will be included in the description of the search result
37
38
39 */
40
41 $form["title"]             = "Database User";
42 $form["description"]     = "";
43 $form["name"]             = "database_user";
44 $form["action"]            = "database_user_edit.php";
45 $form["db_table"]        = "web_database_user";
46 $form["db_table_idx"]    = "database_user_id";
615a0a 47 $form["db_history"]        = "yes";
381520 48 $form["tab_default"]    = "database_user";
M 49 $form["list_default"]    = "database_user_list.php";
50 $form["auth"]            = 'yes'; // yes / no
51
52 $form["auth_preset"]["userid"]  = 0; // 0 = id of the user, > 0 id must match with id of current user
53 $form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
54 $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
55 $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
56 $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
57
58 $form["tabs"]['database_user'] = array (
59     'title'     => "Database User",
60     'width'     => 100,
61     'template'     => "templates/database_user_edit.htm",
62     'fields'     => array (
63     ##################################
64     # Begin Datatable fields
65     ##################################
317b4d 66         'server_id' => array (
M 67             'datatype'    => 'INTEGER',
68             'formtype'    => 'SELECT',
69             'default'    => '',
70             'datasource'    => array (     'type'    => 'SQL',
71                                         'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND {AUTHSQL} AND db_server = 1 ORDER BY server_name',
72                                         'keyfield'=> 'server_id',
73                                         'valuefield'=> 'server_name'
74                                      ),
75             'value'        => ''
76         ),
381520 77         'database_user' => array (
M 78             'datatype'    => 'VARCHAR',
79             'formtype'    => 'TEXT',
80             'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
81                                                         'errmsg'=> 'database_user_error_empty'),
82                                         1 => array (    'type'    => 'UNIQUE',
83                                                         'errmsg'=> 'database_user_error_unique'),
84                                         2 => array (    'type'    => 'REGEX',
85                                                         'regex' => '/^[a-zA-Z0-9_]{2,64}$/',
86                                                         'errmsg'=> 'database_user_error_regex'),
87                                     ),
88             'default'    => '',
89             'value'        => '',
90             'width'        => '30',
91             'maxlength'    => '255',
921224 92             'searchable' => 1
381520 93         ),
10b4c8 94         'database_user_prefix' => array (
T 95             'datatype'    => 'VARCHAR',
96             'formtype'    => 'TEXT',
97             'default'    => '',
98             'value'        => '',
99             'width'        => '30',
100             'maxlength'    => '25'
101         ),
381520 102         'database_password' => array (
M 103             'datatype'    => 'VARCHAR',
104             'formtype'    => 'PASSWORD',
105             'encryption' => 'MYSQL',
106             'default'    => '',
107             'value'        => '',
108             'width'        => '30',
109             'maxlength'    => '255'
110         ),
2332b2 111         'database_password_mongo' => array (
T 112             'datatype'    => 'VARCHAR',
113             'formtype'    => 'PASSWORD',
114             'default'    => '',
115             'value'        => '',
116             'width'        => '30',
117             'maxlength'    => '255'
118         ),
381520 119     ##################################
M 120     # ENDE Datatable fields
121     ##################################
122     )
123 );
124
125
126 ?>