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