Marius Cramer
2015-08-06 37b29231e47a0c4458dc1c15d98588f16f07e1e2
commit | author | age
fed17d 1 <?php
FS 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 global $app;
36
37 $form["title"]    = "DNS SPF Record";
38 $form["description"]  = "";
39 $form["name"]    = "dns_spf";
40 $form["action"]   = "dns_spf_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
47
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 (
55     'title'  => "DNS SPF",
56     'width'  => 100,
57     'template'  => "templates/dns_spf_edit.htm",
58     'fields'  => array (
59         //#################################
60         // Begin Datatable fields
61         //#################################
62         'server_id' => array (
63             'datatype' => 'INTEGER',
64             'formtype' => 'SELECT',
65             'default' => '',
66             'value'  => '',
67             'width'  => '30',
68             'maxlength' => '255'
69         ),
70         'zone' => array (
71             'datatype' => 'INTEGER',
72             'formtype' => 'TEXT',
73             'default' => @$app->functions->intval($_REQUEST["zone"]),
74             'value'  => '',
75             'width'  => '30',
76             'maxlength' => '255'
77         ),
78         'name' => array (
79             'datatype' => 'VARCHAR',
80             'formtype' => 'TEXT',
81             'filters'   => array( 0 => array( 'event' => 'SAVE',
82                     'type' => 'IDNTOASCII'),
83                 1 => array( 'event' => 'SHOW',
84                     'type' => 'IDNTOUTF8'),
85                 2 => array( 'event' => 'SAVE',
86                     'type' => 'TOLOWER')
87             ),
88             'validators' => array (  0 => array ( 'type' => 'REGEX',
89                     'regex' => '/^[a-zA-Z0-9\.\-\_]{0,255}$/',
90                     'errmsg'=> 'name_error_regex'),
91             ),
92             'default' => '',
93             'value'  => '',
94             'width'  => '30',
95             'maxlength' => '255'
96         ),
97         'type' => array (
98             'datatype' => 'VARCHAR',
99             'formtype' => 'TEXT',
100             'default' => 'TXT',
101             'value'  => '',
102             'width'  => '5',
103             'maxlength' => '5'
104         ),
105         'data' => array (
106             'datatype' => 'VARCHAR',
107             'formtype' => 'TEXT',
108             'default' => '',
109             'value'  => '',
110             'width'  => '30',
111             'maxlength' => '255'
112         ),
113         /*
114         'aux' => array (
115             'datatype'    => 'INTEGER',
116             'formtype'    => 'TEXT',
117             'default'    => '0',
118             'value'        => '',
119             'width'        => '10',
120             'maxlength'    => '10'
121         ),
122         */
123         'ttl' => array (
124             'datatype' => 'INTEGER',
125             'formtype' => 'TEXT',
126             'validators' => array (  0 => array ( 'type' => 'RANGE',
127                     'range' => '60:',
128                     'errmsg'=> 'ttl_range_error'),
129             ),
b41803 130             'default' => '3600',
fed17d 131             'value'  => '',
FS 132             'width'  => '10',
133             'maxlength' => '10'
134         ),
135         'active' => array (
136             'datatype' => 'VARCHAR',
137             'formtype' => 'CHECKBOX',
138             'default' => 'Y',
139         ),
140         'stamp' => array (
141             'datatype' => 'VARCHAR',
142             'formtype' => 'TEXT',
143             'default' => '',
144             'value'  => '',
145             'width'  => '30',
146             'maxlength' => '255'
147         ),
148         'serial' => array (
149             'datatype' => 'INTEGER',
150             'formtype' => 'TEXT',
151             'default' => '',
152             'value'  => '',
153             'width'  => '10',
154             'maxlength' => '10'
155         ),
156         //#################################
157         // End Datatable fields
158         //#################################
159     )
160 );
161
162
163
164 ?>