Till Brehm
2016-07-24 b9a3ef486ebcde18a5ade37865ff8f397185d24f
commit | author | age
e22f1e 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).
b1a6a5 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
e22f1e 37
T 38
39 */
40
b1a6a5 41 $form["title"]    = "Mail Domain";
MC 42 $form["description"]  = "";
43 $form["name"]    = "mail_domain";
44 $form["action"]   = "mail_domain_edit.php";
45 $form["db_table"]  = "mail_domain";
46 $form["db_table_idx"] = "domain_id";
47 $form["db_history"]  = "yes";
48 $form["tab_default"] = "domain";
49 $form["list_default"] = "mail_domain_list.php";
50 $form["auth"]   = 'yes'; // yes / no
e22f1e 51
T 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"]['domain'] = array (
b1a6a5 59     'title'  => "Domain",
MC 60     'width'  => 100,
61     'template'  => "templates/mail_domain_edit.htm",
62     'fields'  => array (
63         //#################################
64         // Begin Datatable fields
65         //#################################
e22f1e 66         'server_id' => array (
b1a6a5 67             'datatype' => 'INTEGER',
MC 68             'formtype' => 'SELECT',
69             'default' => '',
70             'datasource' => array (  'type' => 'SQL',
71                 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name',
72                 'keyfield'=> 'server_id',
73                 'valuefield'=> 'server_name'
74             ),
75             'value'  => ''
e22f1e 76         ),
T 77         'domain' => array (
b1a6a5 78             'datatype' => 'VARCHAR',
MC 79             'formtype' => 'TEXT',
80             'filters'   => array( 0 => array( 'event' => 'SAVE',
81                     'type' => 'IDNTOASCII'),
82                 1 => array( 'event' => 'SHOW',
83                     'type' => 'IDNTOUTF8'),
84                 2 => array( 'event' => 'SAVE',
85                     'type' => 'TOLOWER')
86             ),
87             'validators' => array (  0 => array ( 'type' => 'NOTEMPTY',
88                     'errmsg'=> 'domain_error_empty'),
89                 1 => array ( 'type' => 'UNIQUE',
90                     'errmsg'=> 'domain_error_unique'),
1fad40 91                 2 => array ( 'type' => 'ISDOMAIN',
b1a6a5 92                     'errmsg'=> 'domain_error_regex'),
MC 93             ),
94             'default' => '',
95             'value'  => '',
96             'width'  => '30',
97             'maxlength' => '255',
4c28d9 98             'searchable' => 1
e22f1e 99         ),
b1a6a5 100         'dkim' => array (
MC 101             'datatype'      => 'VARCHAR',
102             'formtype'      => 'CHECKBOX',
103             'default'       => 'n',
104             'value'         => array(0 => 'n', 1 => 'y')
e22f1e 105         ),
b1a6a5 106         'dkim_private' => array (
MC 107             'datatype'      => 'TEXT',
108             'formtype'      => 'TEXTAREA',
109             'default'       => '',
110             'value'         => '',
111             'cols'          => '30',
112             'rows'          => '10',
113             'validators'    => array (  0 => array ('type'  => 'CUSTOM',
114                     'class' => 'validate_dkim',
115                     'function' => 'check_private_key',
116                     'errmsg'=> 'dkim_private_key_error'),
117             ),
118         ),
119         'dkim_public' => array (
120             'datatype'      => 'TEXT',
121             'formtype'      => 'TEXTAREA',
122             'default'       => '',
123             'value'         => '',
124             'cols'          => '30',
125             'rows'          => '10'
126         ),
69f5c9 127         'dkim_selector' => array (
FS 128             'datatype'      => 'VARCHAR',
129             'formtype'      => 'TEXT',
130             'default'       => 'default',
131             'value'         => 'default',
132             'width'  => '20',
133             'maxlength' => '63',
134             'validators' => array (  0 => array (   'type' => 'REGEX',
135                     'regex' => '/^[a-z0-9]{0,63}$/',
136                     'errmsg'=> 'dkim_selector_error'),
137             ),
138         ),
b1a6a5 139         'active' => array (
MC 140             'datatype' => 'VARCHAR',
141             'formtype' => 'CHECKBOX',
142             'default' => 'y',
143             'value'  => array(0 => 'n', 1 => 'y')
144         ),
145         //#################################
146         // ENDE Datatable fields
147         //#################################
e22f1e 148     )
T 149 );
150
151
bd68aa 152 ?>