commit | author | age
|
838c87
|
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). |
a00888
|
32 |
|
T |
33 |
Search: |
|
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 |
838c87
|
37 |
|
T |
38 |
|
|
39 |
*/ |
|
40 |
|
|
41 |
$form["title"] = "Web Aliasdomain"; |
|
42 |
$form["description"] = ""; |
526b99
|
43 |
$form["name"] = "web_aliasdomain"; |
838c87
|
44 |
$form["action"] = "web_aliasdomain_edit.php"; |
T |
45 |
$form["db_table"] = "web_domain"; |
|
46 |
$form["db_table_idx"] = "domain_id"; |
|
47 |
$form["db_history"] = "yes"; |
|
48 |
$form["tab_default"] = "domain"; |
|
49 |
$form["list_default"] = "web_aliasdomain_list.php"; |
|
50 |
$form["auth"] = 'yes'; // yes / no |
|
51 |
|
|
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 ( |
|
59 |
'title' => "Domain", |
|
60 |
'width' => 100, |
|
61 |
'template' => "templates/web_aliasdomain_edit.htm", |
|
62 |
'fields' => array ( |
|
63 |
################################## |
|
64 |
# Begin Datatable fields |
|
65 |
################################## |
|
66 |
'server_id' => array ( |
|
67 |
'datatype' => 'INTEGER', |
|
68 |
'formtype' => 'SELECT', |
|
69 |
'default' => '', |
|
70 |
'datasource' => array ( 'type' => 'SQL', |
9adcf5
|
71 |
'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
838c87
|
72 |
'keyfield'=> 'server_id', |
T |
73 |
'valuefield'=> 'server_name' |
|
74 |
), |
|
75 |
'value' => '' |
|
76 |
), |
|
77 |
'domain' => array ( |
|
78 |
'datatype' => 'VARCHAR', |
|
79 |
'formtype' => 'TEXT', |
8c1761
|
80 |
'filters' => array( 0 => array( 'event' => 'SAVE', |
M |
81 |
'type' => 'IDNTOASCII'), |
|
82 |
1 => array( 'event' => 'SHOW', |
|
83 |
'type' => 'IDNTOUTF8'), |
|
84 |
2 => array( 'event' => 'SAVE', |
|
85 |
'type' => 'TOLOWER') |
|
86 |
), |
8ec1d8
|
87 |
'validators' => array ( 0 => array ( 'type' => 'CUSTOM', |
M |
88 |
'class' => 'validate_domain', |
|
89 |
'function' => 'alias_domain', |
|
90 |
'errmsg'=> 'domain_error_regex'), |
|
91 |
), |
838c87
|
92 |
'default' => '', |
T |
93 |
'value' => '', |
|
94 |
'width' => '30', |
a00888
|
95 |
'maxlength' => '255', |
T |
96 |
'searchable' => 1 |
838c87
|
97 |
), |
T |
98 |
'type' => array ( |
|
99 |
'datatype' => 'VARCHAR', |
|
100 |
'formtype' => 'SELECT', |
|
101 |
'default' => 'y', |
|
102 |
'value' => array('vhost' => 'Site', 'alias' => 'Alias', 'subdomain' => 'Subdomain') |
|
103 |
), |
|
104 |
'parent_domain_id' => array ( |
|
105 |
'datatype' => 'INTEGER', |
|
106 |
'formtype' => 'SELECT', |
|
107 |
'default' => '', |
|
108 |
'datasource' => array ( 'type' => 'SQL', |
|
109 |
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain", |
|
110 |
'keyfield'=> 'domain_id', |
|
111 |
'valuefield'=> 'domain' |
|
112 |
), |
|
113 |
'value' => '' |
|
114 |
), |
|
115 |
'redirect_type' => array ( |
|
116 |
'datatype' => 'VARCHAR', |
|
117 |
'formtype' => 'SELECT', |
|
118 |
'default' => 'y', |
bfcdef
|
119 |
'value' => array('' => 'no_redirect_txt', 'no' => 'no_flag_txt', 'R' => 'R', 'L' => 'L', 'R,L' => 'R,L', 'R=301,L' => 'R=301,L', 'last' => 'last', 'break' => 'break', 'redirect' => 'redirect', 'permanent' => 'permanent', 'proxy' => 'proxy') |
838c87
|
120 |
), |
T |
121 |
'redirect_path' => array ( |
|
122 |
'datatype' => 'VARCHAR', |
|
123 |
'formtype' => 'TEXT', |
61c772
|
124 |
'validators' => array ( 0 => array ( 'type' => 'REGEX', |
43b345
|
125 |
'regex' => '@^(([\.]{0})|((ftp|https?)://([-\w\.]+)+(:\d+)?(/([\w/_\.\-\,\+\?\~!:%]*(\?\S+)?)?)?)|(\[scheme\]://([-\w\.]+)+(:\d+)?(/([\w/_\.\-\,\+\?\~!:%]*(\?\S+)?)?)?)|(/(?!.*\.\.)[\w/_\.\-]{1,255}/))$@', |
61c772
|
126 |
'errmsg'=> 'redirect_error_regex'), |
T |
127 |
), |
838c87
|
128 |
'default' => '', |
T |
129 |
'value' => '', |
|
130 |
'width' => '30', |
|
131 |
'maxlength' => '255' |
|
132 |
), |
|
133 |
'subdomain' => array ( |
|
134 |
'datatype' => 'VARCHAR', |
|
135 |
'formtype' => 'SELECT', |
8cf78b
|
136 |
'default' => 'www', |
f65288
|
137 |
'validators' => array ( 0 => array ( 'type' => 'CUSTOM', |
M |
138 |
'class' => 'validate_domain', |
|
139 |
'function' => 'web_domain_autosub', |
|
140 |
'errmsg'=> 'domain_error_autosub'), |
|
141 |
), |
9539ce
|
142 |
'value' => array('none' => 'none_txt', 'www' => 'www.', '*' => '*.') |
838c87
|
143 |
), |
bfcdef
|
144 |
'seo_redirect' => array ( |
T |
145 |
'datatype' => 'VARCHAR', |
|
146 |
'formtype' => 'SELECT', |
|
147 |
'default' => '', |
|
148 |
'value' => array('' => 'no_redirect_txt', 'non_www_to_www' => 'domain.tld => www.domain.tld', 'www_to_non_www' => 'www.domain.tld => domain.tld', '*_domain_tld_to_domain_tld' => '*.doman.tld => domain.tld', '*_domain_tld_to_www_domain_tld' => '*.domain.tld => www.domain.tld', '*_to_domain_tld' => '* => domain.tld', '*_to_www_domain_tld' => '* => www.domain.tld') |
|
149 |
), |
838c87
|
150 |
'active' => array ( |
T |
151 |
'datatype' => 'VARCHAR', |
|
152 |
'formtype' => 'CHECKBOX', |
|
153 |
'default' => 'y', |
|
154 |
'value' => array(0 => 'n',1 => 'y') |
|
155 |
), |
|
156 |
################################## |
|
157 |
# ENDE Datatable fields |
|
158 |
################################## |
|
159 |
) |
|
160 |
); |
|
161 |
|
bfcdef
|
162 |
if($_SESSION["s"]["user"]["typ"] == 'admin') { |
T |
163 |
|
|
164 |
$form["tabs"]['advanced'] = array ( |
|
165 |
'title' => "Options", |
|
166 |
'width' => 100, |
|
167 |
'template' => "templates/web_aliasdomain_advanced.htm", |
|
168 |
'readonly' => false, |
|
169 |
'fields' => array ( |
|
170 |
################################## |
|
171 |
# Begin Datatable fields |
|
172 |
################################## |
|
173 |
'proxy_directives' => array ( |
|
174 |
'datatype' => 'TEXT', |
|
175 |
'formtype' => 'TEXT', |
|
176 |
'default' => '', |
|
177 |
'value' => '', |
|
178 |
'width' => '30', |
|
179 |
'maxlength' => '255' |
|
180 |
), |
|
181 |
################################## |
|
182 |
# ENDE Datatable fields |
|
183 |
################################## |
|
184 |
) |
|
185 |
); |
|
186 |
|
|
187 |
} |
|
188 |
|
838c87
|
189 |
|
9539ce
|
190 |
?> |