tbrehm
2013-08-02 2332b2279d8a8599b4f041370315edc9544b1560
commit | author | age
73c2f2 1 <?php
T 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
4c28d9 33     Search:
F 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
73c2f2 37
T 38
39 */
40
41 $form["title"]             = "Database";
42 $form["description"]     = "";
43 $form["name"]             = "database";
44 $form["action"]            = "database_edit.php";
45 $form["db_table"]        = "web_database";
46 $form["db_table_idx"]    = "database_id";
47 $form["db_history"]        = "yes";
48 $form["tab_default"]    = "database";
49 $form["list_default"]    = "database_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'] = array (
59     'title'     => "Database",
60     'width'     => 100,
61     'template'     => "templates/database_edit.htm",
62     'fields'     => array (
63     ##################################
64     # Begin Datatable fields
65     ##################################
66         'server_id' => array (
67             'datatype'    => 'INTEGER',
68             'formtype'    => 'SELECT',
69             'default'    => '',
70             'datasource'    => array (     'type'    => 'SQL',
9adcf5 71                                         'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND {AUTHSQL} AND db_server = 1 ORDER BY server_name',
73c2f2 72                                         'keyfield'=> 'server_id',
T 73                                         'valuefield'=> 'server_name'
74                                      ),
75             'value'        => ''
76         ),
5a43e7 77         'parent_domain_id' => array (
T 78             'datatype'    => 'INTEGER',
79             'formtype'    => 'SELECT',
80             'default'    => '',
81             'datasource'    => array (     'type'    => 'SQL',
82                                         'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
83                                         'keyfield'=> 'domain_id',
84                                         'valuefield'=> 'domain'
85                                      ),
664f54 86             'value'        => array('0' => 'select_site_txt')
5a43e7 87         ),
73c2f2 88         'type' => array (
T 89             'datatype'    => 'VARCHAR',
90             'formtype'    => 'SELECT',
91             'default'    => 'y',
2332b2 92             'value'        => array(
T 93                               'mongo' => 'MongoDB',
94                               'mysql' => 'MySQL'
95                            )
73c2f2 96         ),
T 97         'database_name' => array (
98             'datatype'    => 'VARCHAR',
99             'formtype'    => 'TEXT',
100             'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
101                                                         'errmsg'=> 'database_name_error_empty'),
1ca823 102                                         1 => array (    'type'    => 'REGEX',
73c2f2 103                                                         'regex' => '/^[a-zA-Z0-9_]{2,64}$/',
T 104                                                         'errmsg'=> 'database_name_error_regex'),
105                                     ),
106             'default'    => '',
107             'value'        => '',
108             'width'        => '30',
4c28d9 109             'maxlength'    => '255',
F 110             'searchable' => 1
73c2f2 111         ),
10b4c8 112         'database_name_prefix' => array (
T 113             'datatype'    => 'VARCHAR',
114             'formtype'    => 'TEXT',
115             'default'    => '',
116             'value'        => '',
117             'width'        => '30',
118             'maxlength'    => '25'
119         ),
381520 120         'database_user_id' => array (
M 121             'datatype'    => 'INTEGER',
122             'formtype'    => 'SELECT',
73c2f2 123             'default'    => '',
381520 124             'datasource'    => array (     'type'    => 'SQL',
M 125                                         'querystring' => "SELECT database_user_id,database_user FROM web_database_user WHERE {AUTHSQL} ORDER BY database_user",
126                                         'keyfield'=> 'database_user_id',
127                                         'valuefield'=> 'database_user'
128                                      ),
664f54 129             'value'        => array('0' => 'select_dbuser_txt')
73c2f2 130         ),
381520 131         'database_ro_user_id' => array (
M 132             'datatype'    => 'INTEGER',
133             'formtype'    => 'SELECT',
73c2f2 134             'default'    => '',
381520 135             'datasource'    => array (     'type'    => 'SQL',
M 136                                         'querystring' => "SELECT database_user_id,database_user FROM web_database_user WHERE {AUTHSQL} ORDER BY database_user",
137                                         'keyfield'=> 'database_user_id',
138                                         'valuefield'=> 'database_user'
139                                      ),
664f54 140             'value'        => array('0' => 'no_dbuser_txt')
73c2f2 141         ),
be9816 142         'database_charset' => array (
R 143             'datatype'    => 'VARCHAR',
144             'formtype'    => 'SELECT',
145             'default'    => 'y',
5b831f 146             'value'        => array('' => 'DB-Default','latin1' => 'Latin 1','utf8' => 'UTF-8')
be9816 147         ),
73c2f2 148         'remote_access' => array (
T 149             'datatype'    => 'VARCHAR',
150             'formtype'    => 'CHECKBOX',
b445c6 151             'default'    => 'n',
73c2f2 152             'value'        => array(0 => 'n',1 => 'y')
T 153         ),
154         'active' => array (
155             'datatype'    => 'VARCHAR',
156             'formtype'    => 'CHECKBOX',
157             'default'    => 'y',
158             'value'        => array(0 => 'n',1 => 'y')
159         ),
6aa01c 160         'remote_ips' => array (
O 161           'datatype'  => 'TEXT',
162           'formtype'  => 'TEXT',
163           'validators'  => array (  0 => array (  'type' => 'CUSTOM',
164                                                   'class' => 'validate_database',
165                                                   'function' => 'valid_ip_list',
166                                                   'errmsg' => 'database_remote_error_ips'),
167                                  ),
168           'default' => '',
169           'value'   => '',
4c28d9 170           'width'   => '60',
F 171           'searchable' => 2
6aa01c 172         ),
73c2f2 173     ##################################
T 174     # ENDE Datatable fields
175     ##################################
176     )
177 );
178
179
2332b2 180 ?>