Marius Cramer
2015-08-06 37b29231e47a0c4458dc1c15d98588f16f07e1e2
commit | author | age
f14188 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).
32
33
34 */
35
65ea2e 36 global $app;
M 37
7fe908 38 $form["title"]    = "DNS mx";
MC 39 $form["description"]  = "";
40 $form["name"]    = "dns_mx";
41 $form["action"]   = "dns_mx_edit.php";
42 $form["db_table"]  = "dns_rr";
43 $form["db_table_idx"] = "id";
44 $form["db_history"]  = "yes";
45 $form["tab_default"] = "dns";
46 $form["list_default"] = "dns_a_list.php";
47 $form["auth"]   = 'yes'; // yes / no
f14188 48
T 49 $form["auth_preset"]["userid"]  = 0; // 0 = id of the user, > 0 id must match with id of current user
50 $form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
51 $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
52 $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
53 $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
54
55 $form["tabs"]['dns'] = array (
7fe908 56     'title'  => "DNS mx",
MC 57     'width'  => 100,
58     'template'  => "templates/dns_mx_edit.htm",
59     'fields'  => array (
60         //#################################
61         // Begin Datatable fields
62         //#################################
f14188 63         'server_id' => array (
7fe908 64             'datatype' => 'INTEGER',
MC 65             'formtype' => 'SELECT',
66             'default' => '',
67             'value'  => '',
68             'width'  => '30',
69             'maxlength' => '255'
f14188 70         ),
T 71         'zone' => array (
7fe908 72             'datatype' => 'INTEGER',
MC 73             'formtype' => 'TEXT',
74             'default' => @$app->functions->intval($_REQUEST["zone"]),
75             'value'  => '',
76             'width'  => '30',
77             'maxlength' => '255'
f14188 78         ),
T 79         'name' => array (
7fe908 80             'datatype' => 'VARCHAR',
MC 81             'formtype' => 'TEXT',
82             'filters'   => array( 0 => array( 'event' => 'SAVE',
83                     'type' => 'IDNTOASCII'),
84                 1 => array( 'event' => 'SHOW',
85                     'type' => 'IDNTOUTF8'),
86                 2 => array( 'event' => 'SAVE',
87                     'type' => 'TOLOWER')
88             ),
89             'validators' => array (  0 => array ( 'type' => 'REGEX',
7e6190 90                     'regex' => '/^[a-zA-Z0-9\.\-\*]{0,255}$/',
7fe908 91                     'errmsg'=> 'name_error_regex'),
MC 92             ),
93             'default' => '',
94             'value'  => '',
95             'width'  => '30',
96             'maxlength' => '255'
f14188 97         ),
T 98         'type' => array (
7fe908 99             'datatype' => 'VARCHAR',
MC 100             'formtype' => 'TEXT',
101             'default' => 'MX',
102             'value'  => '',
103             'width'  => '5',
104             'maxlength' => '5'
f14188 105         ),
T 106         'data' => array (
7fe908 107             'datatype' => 'VARCHAR',
MC 108             'formtype' => 'TEXT',
109             'filters'   => array( 0 => array( 'event' => 'SAVE',
110                     'type' => 'IDNTOASCII'),
111                 1 => array( 'event' => 'SHOW',
112                     'type' => 'IDNTOUTF8'),
113                 2 => array( 'event' => 'SAVE',
114                     'type' => 'TOLOWER')
115             ),
116             'validators' => array (  0 => array ( 'type' => 'NOTEMPTY',
117                     'errmsg'=> 'data_error_empty'),
118                 1 => array ( 'type' => 'REGEX',
91bb61 119                     'regex' => '/^[a-zA-Z0-9\.\-]{1,255}$/',
7fe908 120                     'errmsg'=> 'data_error_regex'),
MC 121             ),
122             'default' => '',
123             'value'  => '',
124             'width'  => '30',
125             'maxlength' => '255'
f14188 126         ),
7fe908 127
f14188 128         'aux' => array (
7fe908 129             'datatype' => 'INTEGER',
MC 130             'formtype' => 'TEXT',
131             'default' => '10',
132             'value'  => '',
133             'width'  => '10',
134             'maxlength' => '10'
f14188 135         ),
7fe908 136
f14188 137         'ttl' => array (
7fe908 138             'datatype' => 'INTEGER',
MC 139             'formtype' => 'TEXT',
d229c2 140             'validators' => array (  0 => array ( 'type' => 'RANGE',
TB 141                     'range' => '60:',
142                     'errmsg'=> 'ttl_range_error'),
143             ),
b41803 144             'default' => '3600',
7fe908 145             'value'  => '',
MC 146             'width'  => '10',
147             'maxlength' => '10'
f14188 148         ),
T 149         'active' => array (
7fe908 150             'datatype' => 'VARCHAR',
MC 151             'formtype' => 'CHECKBOX',
152             'default' => 'Y',
153             'value'  => array(0 => 'N', 1 => 'Y')
f14188 154         ),
56b0b8 155         'stamp' => array (
7fe908 156             'datatype' => 'VARCHAR',
MC 157             'formtype' => 'TEXT',
158             'default' => '',
159             'value'  => '',
160             'width'  => '30',
161             'maxlength' => '255'
56b0b8 162         ),
F 163         'serial' => array (
7fe908 164             'datatype' => 'INTEGER',
MC 165             'formtype' => 'TEXT',
166             'default' => '',
167             'value'  => '',
168             'width'  => '10',
169             'maxlength' => '10'
56b0b8 170         ),
7fe908 171         //#################################
MC 172         // ENDE Datatable fields
173         //#################################
f14188 174     )
T 175 );
176
177
178
7fe908 179 ?>