e4a40f8023c71ffbb8a2f2299b78c40f32d750cf
[mailer.git] / inc / modules / admin / what-config_surfbar.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 08/31/2008 *
4  * ================                             Last change: 08/31/2008 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : what-config_surfbar.php                          *
8  * -------------------------------------------------------------------- *
9  * Short description : Configuration for surfbar                        *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Konfiguration fuer Surfbar                       *
12  * -------------------------------------------------------------------- *
13  *                                                                      *
14  * -------------------------------------------------------------------- *
15  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
16  * For more information visit: http://www.mxchange.org                  *
17  *                                                                      *
18  * This program is free software; you can redistribute it and/or modify *
19  * it under the terms of the GNU General Public License as published by *
20  * the Free Software Foundation; either version 2 of the License, or    *
21  * (at your option) any later version.                                  *
22  *                                                                      *
23  * This program is distributed in the hope that it will be useful,      *
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
26  * GNU General Public License for more details.                         *
27  *                                                                      *
28  * You should have received a copy of the GNU General Public License    *
29  * along with this program; if not, write to the Free Software          *
30  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
31  * MA  02110-1301  USA                                                  *
32  ************************************************************************/
33
34 // Some security stuff...
35 if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) {
36         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
37         require($INC);
38 }
39
40 // Add description as navigation point
41 ADD_DESCR("admin", basename(__FILE__));
42
43 // Was the form submitted?
44 if (isset($_POST['ok'])) {
45         // Replace german decimal comma with computer decimal dot
46         if (isset($_POST['surfbar_static_reward']))   $_POST['surfbar_static_reward']   = str_replace(",", ".", $_POST['surfbar_static_reward']);
47         if (isset($_POST['surfbar_dynamic_percent'])) $_POST['surfbar_dynamic_percent'] = str_replace(",", ".", $_POST['surfbar_dynamic_percent']);
48
49         // Save settings
50         ADMIN_SAVE_SETTINGS($_POST);
51 } else {
52         // Prepare content
53         $content = array(
54                 'surfbar_static_reward'   => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']),
55                 'surfbar_static_costs'    => TRANSLATE_COMMA($_CONFIG['surfbar_static_costs']),
56                 // @TODO Rewrite this to tiny selection boxes
57                 'surfbar_static_time'     => $_CONFIG['surfbar_static_time'],
58                 // @TODO Rewrite this to tiny selection boxes
59                 'surfbar_restart_time'    => $_CONFIG['surfbar_restart_time'],
60                 'surfbar_static_lock'     => $_CONFIG['surfbar_static_lock'],
61                 'surfbar_dynamic_percent' => TRANSLATE_COMMA($_CONFIG['surfbar_dynamic_percent']),
62                 'surfbar_max_order'       => $_CONFIG['surfbar_max_order'],
63                 // @TODO Rewrite this to tiny selection boxes
64                 'surfbar_stats_reload'    => $_CONFIG['surfbar_stats_reload']
65         );
66
67         // Prepare payment model for template
68         if ($_CONFIG['surfbar_pay_model'] == "STATIC") {
69                 // Static model
70                 define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , " checked=\"checked\"");
71                 define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', "");
72         } else {
73                 // Dynamic model
74                 define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , "");
75                 define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', " checked=\"checked\"");
76         }
77
78         // Prepare auto-sart
79         if ($_CONFIG['surfbar_autostart'] == "Y") {
80                 // Yes selected
81                 define('__CONFIG_SURFBAR_AUTOSTART_Y' , " checked=\"checked\"");
82                 define('__CONFIG_SURFBAR_AUTOSTART_N', "");
83         } else {
84                 // No selected
85                 define('__CONFIG_SURFBAR_AUTOSTART_Y' , "");
86                 define('__CONFIG_SURFBAR_AUTOSTART_N', " checked=\"checked\"");
87         }
88
89         // Load template
90         LOAD_TEMPLATE("admin_config_surfbar", false, $content);
91 }
92
93 //
94 ?>