Old config.php is now automatically updated to new config-local.php format, several...
[mailer.git] / inc / modules / admin / what-config_beg.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 01/09/2005 *
4  * ================                             Last change: 01/09/2005 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : what-config_beg.php                              *
8  * -------------------------------------------------------------------- *
9  * Short description : Setup beg link                                   *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Bettel-Link einstellen                           *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * Needs to be in all Files and every File needs "svn propset           *
18  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
19  * -------------------------------------------------------------------- *
20  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
21  * For more information visit: http://www.mxchange.org                  *
22  *                                                                      *
23  * This program is free software; you can redistribute it and/or modify *
24  * it under the terms of the GNU General Public License as published by *
25  * the Free Software Foundation; either version 2 of the License, or    *
26  * (at your option) any later version.                                  *
27  *                                                                      *
28  * This program is distributed in the hope that it will be useful,      *
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
31  * GNU General Public License for more details.                         *
32  *                                                                      *
33  * You should have received a copy of the GNU General Public License    *
34  * along with this program; if not, write to the Free Software          *
35  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
36  * MA  02110-1301  USA                                                  *
37  ************************************************************************/
38
39 // Some security stuff...
40 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
41         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
42         require($INC);
43 }
44
45 // Add description as navigation point
46 ADD_DESCR('admin', __FILE__);
47
48 if (IS_FORM_SENT()) {
49         // Translate german decimal commas to computer decimal dots
50         REQUEST_SET_POST('beg_points'      , convertCommaToDot(REQUEST_POST('beg_points')      ));
51         REQUEST_SET_POST('beg_points_max'  , convertCommaToDot(REQUEST_POST('beg_points_max')  ));
52         REQUEST_SET_POST('beg_notify_bonus', convertCommaToDot(REQUEST_POST('beg_notify_bonus')));
53
54         // Save settings
55         ADMIN_SAVE_SETTINGS_POST();
56
57         // Remember new settings
58         setConfigEntry('beg_rallye'       , REQUEST_POST('beg_rallye'));
59         setConfigEntry('beg_ral_en_notify', REQUEST_POST('beg_ral_en_notify'));
60         setConfigEntry('beg_ral_di_notify', REQUEST_POST('beg_ral_di_notify'));
61 } else {
62         // Prepare constants for the template
63         $content['points']           = translateComma(getConfig('beg_points')      , false);
64         $content['points_max']       = translateComma(getConfig('beg_points_max')  , false);
65         $content['notify_bonus']     = translateComma(getConfig('beg_notify_bonus'), false);
66         $content['timeout']          = createTimeSelections(getConfig('beg_timeout')    , 'beg_timeout'    , 'Dhm');
67         $content['uid_timeout']      = createTimeSelections(getConfig('beg_uid_timeout'), 'beg_uid_timeout', 'Dhm');
68         $content['ip_timeout']       = createTimeSelections(getConfig('beg_ip_timeout') , 'beg_ip_timeout' , 'Dhm');
69         $content['wait_selection']   = createTimeSelections(getConfig('beg_notify_wait'), 'beg_notify_wait', 'ms' );
70         $content['ranks']            = getConfig('beg_ranks');
71
72         // Activate / Deactivate beg rallye (Y/N)
73         switch (getConfig('beg_rallye'))
74         {
75                 case 'Y':
76                         $content['rallye_yes'] = ' checked="checked"';
77                         $content['rallye_no']  = '';
78                         break;
79
80                 case 'N':
81                         $content['rallye_yes'] = '';
82                         $content['rallye_no']  = ' checked="checked"';
83                         break;
84         }
85
86         switch (getConfig('beg_active'))
87         {
88                 case 'Y':
89                         $content['active_yes'] = ' checked="checked"';
90                         $content['active_no']  = '';
91                         break;
92
93                 case 'N':
94                         $content['active_yes'] = '';
95                         $content['active_no']  = ' checked="checked"';
96                         break;
97         }
98
99         switch (getConfig('beg_mode'))
100         {
101                 case 'DIRECT':
102                         $content['mode_direct'] = ' checked="checked"';
103                         $content['mode_ref']    = '';
104                         break;
105
106                 case 'REF':
107                         $content['mode_direct'] = '';
108                         $content['mode_ref']    = ' checked="checked"';
109                         break;
110         }
111
112         switch (getConfig('beg_ral_en_notify'))
113         {
114                 case 'Y':
115                         $content['ral_enable_notify_yes'] = ' checked="checked"';
116                         $content['ral_enable_notify_no']  = '';
117                         break;
118
119                 case 'N':
120                         $content['ral_enable_notify_yes'] = '';
121                         $content['ral_enable_notify_no']  = ' checked="checked"';
122                         break;
123         }
124
125         switch (getConfig('beg_ral_di_notify'))
126         {
127                 case 'Y':
128                         $content['ral_disable_notify_yes'] = ' checked="checked"';
129                         $content['ral_disable_notify_no']  = '';
130                         break;
131
132                 case 'N':
133                         $content['ral_disable_notify_yes'] = '';
134                         $content['ral_disable_notify_no']  = ' checked="checked"';
135                         break;
136         }
137
138         switch (getConfig('beg_new_mem_notify'))
139         {
140                 case 'Y':
141                         $content['new_member_notify_yes'] = ' checked="checked"';
142                         $content['new_member_notify_no']  = '';
143                         break;
144
145                 case 'N':
146                         $content['new_member_notify_yes'] = '';
147                         $content['new_member_notify_no']  = ' checked="checked"';
148                         break;
149         }
150
151         switch (getConfig('beg_include_own'))
152         {
153                 case 'Y':
154                         $content['include_own_yes'] = ' checked="checked"';
155                         $content['include_own_no']  = '';
156                         break;
157
158                 case 'N':
159                         $content['include_own_yes'] = '';
160                         $content['include_own_no']  = ' checked="checked"';
161                         break;
162         }
163
164         // Init elements
165         $content['pay_mode_img']  = '';
166         $content['pay_mode_js']   = '';
167         $content['pay_mode_both'] = '';
168         $content['pay_mode_none'] = '';
169
170         // Set pay mode
171         $content['pay_mode_'.strtolower(getConfig('beg_pay_mode'))] = ' selected="selected"';
172
173         // Member selection box
174         $content['member_selection'] = ADD_MEMBER_SELECTION_BOX(getConfig('beg_uid'), false, true, true, 'beg_uid');
175
176         // Load form template
177         LOAD_TEMPLATE('admin_config_beg', false, $content);
178 }
179
180 //
181 ?>