3838
3939*/
4040global $ app ;
41+ $ app ->uses ('getconf ' );
42+ $ global_config = $ app ->getconf ->get_global_config ();
4143
4244$ form ["title " ] = "Mailbox " ;
4345$ form ["description " ] = "" ;
230232 )
231233);
232234
233- $ form ["tabs " ]['autoresponder ' ] = array (
234- 'title ' => "Autoresponder " ,
235- 'width ' => 100 ,
236- 'template ' => "templates/mail_user_autoresponder_edit.htm " ,
237- 'fields ' => array (
238- ##################################
239- # Begin Datatable fields
240- ##################################
241- 'autoresponder_subject ' => array (
242- 'datatype ' => 'VARCHAR ' ,
243- 'formtype ' => 'TEXT ' ,
244- 'default ' => 'Out of office reply ' ,
245- 'value ' => '' ,
246- 'width ' => '30 ' ,
247- 'maxlength ' => '255 '
248- ),
249- 'autoresponder_text ' => array (
250- 'datatype ' => 'TEXT ' ,
251- 'formtype ' => 'TEXTAREA ' ,
252- 'default ' => '' ,
253- 'value ' => '' ,
254- 'cols ' => '30 ' ,
255- 'rows ' => '15 '
256- ),
257- 'autoresponder ' => array (
258- 'datatype ' => 'VARCHAR ' ,
259- 'formtype ' => 'CHECKBOX ' ,
260- 'default ' => 'n ' ,
261- 'value ' => array (1 => 'y ' ,0 => 'n ' )
262- ),
263- 'autoresponder_start_date ' => array (
264- 'datatype ' => 'DATETIME ' ,
265- 'formtype ' => 'DATETIME ' ,
266- 'validators ' => array ( 0 => array ( 'type ' => 'CUSTOM ' ,
267- 'class ' => 'validate_autoresponder ' ,
268- 'function ' => 'start_date ' ,
269- 'errmsg ' => 'autoresponder_start_date_is_required ' ),
270- )
271- ),
272- 'autoresponder_end_date ' => array (
273- 'datatype ' => 'DATETIME ' ,
274- 'formtype ' => 'DATETIME ' ,
275- 'validators ' => array ( 0 => array ( 'type ' => 'CUSTOM ' ,
276- 'class ' => 'validate_autoresponder ' ,
277- 'function ' => 'end_date ' ,
278- 'errmsg ' => 'autoresponder_end_date_isgreater ' ),
279- ),
280- ),
281- ##################################
282- # END Datatable fields
283- ##################################
284- )
285- );
235+ if ($ global_config ['mail ' ]['mailbox_show_autoresponder_tab ' ] === 'y ' ) {
236+ $ form ["tabs " ]['autoresponder ' ] = array (
237+ 'title ' => "Autoresponder " ,
238+ 'width ' => 100 ,
239+ 'template ' => "templates/mail_user_autoresponder_edit.htm " ,
240+ 'fields ' => array (
241+ ##################################
242+ # Begin Datatable fields
243+ ##################################
244+ 'autoresponder_subject ' => array (
245+ 'datatype ' => 'VARCHAR ' ,
246+ 'formtype ' => 'TEXT ' ,
247+ 'default ' => 'Out of office reply ' ,
248+ 'value ' => '' ,
249+ 'width ' => '30 ' ,
250+ 'maxlength ' => '255 '
251+ ),
252+ 'autoresponder_text ' => array (
253+ 'datatype ' => 'TEXT ' ,
254+ 'formtype ' => 'TEXTAREA ' ,
255+ 'default ' => '' ,
256+ 'value ' => '' ,
257+ 'cols ' => '30 ' ,
258+ 'rows ' => '15 '
259+ ),
260+ 'autoresponder ' => array (
261+ 'datatype ' => 'VARCHAR ' ,
262+ 'formtype ' => 'CHECKBOX ' ,
263+ 'default ' => 'n ' ,
264+ 'value ' => array (1 => 'y ' ,0 => 'n ' )
265+ ),
266+ 'autoresponder_start_date ' => array (
267+ 'datatype ' => 'DATETIME ' ,
268+ 'formtype ' => 'DATETIME ' ,
269+ 'validators ' => array ( 0 => array ( 'type ' => 'CUSTOM ' ,
270+ 'class ' => 'validate_autoresponder ' ,
271+ 'function ' => 'start_date ' ,
272+ 'errmsg ' => 'autoresponder_start_date_is_required ' ),
273+ )
274+ ),
275+ 'autoresponder_end_date ' => array (
276+ 'datatype ' => 'DATETIME ' ,
277+ 'formtype ' => 'DATETIME ' ,
278+ 'validators ' => array ( 0 => array ( 'type ' => 'CUSTOM ' ,
279+ 'class ' => 'validate_autoresponder ' ,
280+ 'function ' => 'end_date ' ,
281+ 'errmsg ' => 'autoresponder_end_date_isgreater ' ),
282+ ),
283+ ),
284+ ##################################
285+ # END Datatable fields
286+ ##################################
287+ )
288+ );
289+ }
286290
287- $ form ["tabs " ]['filter_records ' ] = array (
288- 'title ' => "Mail Filter " ,
289- 'width ' => 100 ,
290- 'template ' => "templates/mail_user_mailfilter_edit.htm " ,
291- 'fields ' => array (
292- ##################################
293- # Begin Datatable fields
294- ##################################
295- 'move_junk ' => array (
296- 'datatype ' => 'VARCHAR ' ,
297- 'formtype ' => 'CHECKBOX ' ,
298- 'default ' => 'n ' ,
299- 'value ' => array (0 => 'n ' ,1 => 'y ' )
291+
292+ if ($ global_config ['mail ' ]['mailbox_show_mail_filter_tab ' ] === 'y ' ) {
293+ $ form ["tabs " ]['filter_records ' ] = array (
294+ 'title ' => "Mail Filter " ,
295+ 'width ' => 100 ,
296+ 'template ' => "templates/mail_user_mailfilter_edit.htm " ,
297+ 'fields ' => array (
298+ ##################################
299+ # Begin Datatable fields
300+ ##################################
301+ 'move_junk ' => array (
302+ 'datatype ' => 'VARCHAR ' ,
303+ 'formtype ' => 'CHECKBOX ' ,
304+ 'default ' => 'n ' ,
305+ 'value ' => array (0 => 'n ' ,1 => 'y ' )
306+ ),
307+ ##################################
308+ # END Datatable fields
309+ ##################################
300310 ),
301- ##################################
302- # END Datatable fields
303- ##################################
304- ),
305- 'plugins ' => array (
306- 'filter_records ' => array (
307- 'class ' => 'plugin_listview ' ,
308- 'options ' => array (
309- 'listdef ' => 'list/mail_user_filter.list.php ' ,
310- 'sqlextwhere ' => "mailuser_id = " .@$ app ->functions ->intval (@$ _REQUEST ['id ' ]),
311- 'sql_order_by ' => "ORDER BY rulename "
311+ 'plugins ' => array (
312+ 'filter_records ' => array (
313+ 'class ' => 'plugin_listview ' ,
314+ 'options ' => array (
315+ 'listdef ' => 'list/mail_user_filter.list.php ' ,
316+ 'sqlextwhere ' => "mailuser_id = " .@$ app ->functions ->intval (@$ _REQUEST ['id ' ]),
317+ 'sql_order_by ' => "ORDER BY rulename "
318+ )
312319 )
313- )
314- )
315- );
320+ )
321+ );
322+ }
316323
317- if ($ _SESSION ["s " ]["user " ]["typ " ] == 'admin ' ) {
318-
319- $ form ["tabs " ]['mailfilter ' ] = array (
320- 'title ' => "Custom Rules " ,
321- 'width ' => 100 ,
322- 'template ' => "templates/mail_user_custom_rules_edit.htm " ,
323- 'fields ' => array (
324- ##################################
325- # Begin Datatable fields
326- ##################################
327- 'custom_mailfilter ' => array (
328- 'datatype ' => 'TEXT ' ,
329- 'formtype ' => 'TEXTAREA ' ,
330- 'default ' => '' ,
331- 'value ' => '' ,
332- 'cols ' => '30 ' ,
333- 'rows ' => '15 '
334- ),
335- ##################################
336- # END Datatable fields
337- ##################################
338- )
339- );
340324
325+ if ($ _SESSION ["s " ]["user " ]["typ " ] == 'admin ' && $ global_config ['mail ' ]['mailbox_show_custom_rules_tab ' ] === 'y ' ) {
326+ $ form ["tabs " ]['mailfilter ' ] = array (
327+ 'title ' => "Custom Rules " ,
328+ 'width ' => 100 ,
329+ 'template ' => "templates/mail_user_custom_rules_edit.htm " ,
330+ 'fields ' => array (
331+ ##################################
332+ # Begin Datatable fields
333+ ##################################
334+ 'custom_mailfilter ' => array (
335+ 'datatype ' => 'TEXT ' ,
336+ 'formtype ' => 'TEXTAREA ' ,
337+ 'default ' => '' ,
338+ 'value ' => '' ,
339+ 'cols ' => '30 ' ,
340+ 'rows ' => '15 '
341+ ),
342+ ##################################
343+ # END Datatable fields
344+ ##################################
345+ )
346+ );
341347}
342348
343-
344- ?>
349+ ?>
0 commit comments