Marius Burkard
2016-04-20 4569cae57f127afd093794310ccd290d2d9fdf36
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',
3c6ea9 101             'validators' => array (
FS 102                 0 => array ( 'type' => 'NOTEMPTY', 'errmsg'=> 'data_error_empty'),
103                 1 => array ( 'type' => 'ISIPV6', 'errmsg'=> 'ip_error_wrong'),
7fe908 104             ),
MC 105             'value'  => '',
106             'width'  => '30',
394b0f 107             'maxlength' => '255',
TB 108             'default' => ''
830d11 109         ),
F 110         /*
111         'aux' => array (
112             'datatype'    => 'INTEGER',
113             'formtype'    => 'TEXT',
114             'default'    => '0',
115             'value'        => '',
116             'width'        => '10',
117             'maxlength'    => '10'
118         ),
119         */
120         'ttl' => array (
7fe908 121             'datatype' => 'INTEGER',
MC 122             'formtype' => 'TEXT',
d229c2 123             'validators' => array (  0 => array ( 'type' => 'RANGE',
TB 124                     'range' => '60:',
125                     'errmsg'=> 'ttl_range_error'),
126             ),
b41803 127             'default' => '3600',
7fe908 128             'value'  => '',
MC 129             'width'  => '10',
130             'maxlength' => '10'
830d11 131         ),
F 132         'active' => array (
7fe908 133             'datatype' => 'VARCHAR',
MC 134             'formtype' => 'CHECKBOX',
135             'default' => 'Y',
136             'value'  => array(0 => 'N', 1 => 'Y')
830d11 137         ),
56b0b8 138         'stamp' => array (
7fe908 139             'datatype' => 'VARCHAR',
MC 140             'formtype' => 'TEXT',
141             'default' => '',
142             'value'  => '',
143             'width'  => '30',
144             'maxlength' => '255'
56b0b8 145         ),
F 146         'serial' => array (
7fe908 147             'datatype' => 'INTEGER',
MC 148             'formtype' => 'TEXT',
149             'default' => '',
150             'value'  => '',
151             'width'  => '10',
152             'maxlength' => '10'
56b0b8 153         ),
7fe908 154         //#################################
MC 155         // ENDE Datatable fields
156         //#################################
830d11 157     )
F 158 );
159
160
161
7fe908 162 ?>