1+ <?php
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+ 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
37+
38+
39+ */
40+
41+ $ app ->uses ('getconf ' );
42+ $ mlManager = $ app ->getconf ->get_server_config ($ conf ['server_id ' ], 'mail ' )['mailinglist_manager ' ];
43+
44+ $ form ["title " ] = "Mailing List " ;
45+ $ form ["description " ] = "" ;
46+ $ form ["name " ] = "mail_ml_membership " ;
47+ $ form ["action " ] = "mail_ml_membership_edit.php " ;
48+ $ form ["db_table " ] = "mail_ml_membership " ;
49+ $ form ["db_table_idx " ] = "subscriber_id " ;
50+ $ form ["db_history " ] = "yes " ;
51+ $ form ["tab_default " ] = "membership " ;
52+ $ form ["list_default " ] = "mail_ml_membership_list.php " ;
53+ $ form ["auth " ] = 'yes ' ; // yes / no
54+
55+ $ form ["auth_preset " ]["userid " ] = 0 ; // 0 = id of the user, > 0 id must match with id of current user
56+ $ form ["auth_preset " ]["groupid " ] = 0 ; // 0 = default groupid of the user, > 0 id must match with groupid of current user
57+ $ form ["auth_preset " ]["perm_user " ] = 'riud ' ; //r = read, i = insert, u = update, d = delete
58+ $ form ["auth_preset " ]["perm_group " ] = 'riud ' ; //r = read, i = insert, u = update, d = delete
59+ $ form ["auth_preset " ]["perm_other " ] = '' ; //r = read, i = insert, u = update, d = delete
60+
61+ $ form ["tabs " ]['membership ' ] = array (
62+ 'title ' => "Membership " ,
63+ 'width ' => 100 ,
64+ 'template ' => "templates/mail_ml_membership_edit.htm " ,
65+ 'fields ' => array (
66+ 'server_id ' => array (
67+ 'datatype ' => 'INTEGER ' ,
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 ' => ''
76+ ),
77+ 'mailinglist_id ' => array (
78+ 'datatype ' => 'INTEGER ' ,
79+ 'formtype ' => 'SELECT ' ,
80+ 'default ' => '' ,
81+ 'datasource ' => array ( 'type ' => 'SQL ' ,
82+ 'querystring ' => 'SELECT mailinglist_id, CONCAT_WS( \'@ \', listname, domain) as listname FROM mail_mailinglist WHERE {AUTHSQL} ORDER BY listname ' ,
83+ 'keyfield ' => 'mailinglist_id ' ,
84+ 'valuefield ' => 'listname '
85+ ),
86+ 'value ' => ''
87+ ),
88+ 'email ' => array (
89+ 'datatype ' => 'VARCHAR ' ,
90+ 'formtype ' => 'TEXT ' ,
91+ 'filters ' => array ( 0 => array ( 'event ' => 'SAVE ' ,
92+ 'type ' => 'IDNTOASCII ' ),
93+ 1 => array ( 'event ' => 'SHOW ' ,
94+ 'type ' => 'IDNTOUTF8 ' ),
95+ 2 => array ( 'event ' => 'SAVE ' ,
96+ 'type ' => 'TOLOWER ' )
97+ ),
98+ 'validators ' => array ( 0 => array ( 'type ' => 'ISEMAIL ' ,
99+ 'errmsg ' => 'email_error_isemail ' ),
100+ 1 => array ( 'type ' => 'UNIQUE ' ,
101+ 'errmsg ' => 'email_error_unique ' ),
102+ ),
103+ 'default ' => '' ,
104+ 'value ' => '' ,
105+ 'width ' => '30 ' ,
106+ 'maxlength ' => '255 ' ,
107+ 'searchable ' => 1
108+ ),
109+ 'name ' => array (
110+ 'datatype ' => 'VARCHAR ' ,
111+ 'formtype ' => 'TEXT ' ,
112+ 'default ' => '' ,
113+ 'value ' => '' ,
114+ 'width ' => '30 ' ,
115+ 'maxlength ' => '255 ' ,
116+ 'searchable ' => 2
117+ ),
118+ 'welcome_msg ' => array (
119+ 'datatype ' => 'VARCHAR ' ,
120+ 'formtype ' => 'CHECKBOX ' ,
121+ 'default ' => 'y ' ,
122+ 'value ' => array (0 => 'n ' , 1 => 'y ' )
123+ ),
124+ 'goodbye_msg ' => array (
125+ 'datatype ' => 'VARCHAR ' ,
126+ 'formtype ' => 'CHECKBOX ' ,
127+ 'default ' => 'n ' ,
128+ 'value ' => array (0 => 'n ' , 1 => 'y ' )
129+ ),
130+ ),
131+ );
0 commit comments