Fixes for stripped HTML tags, and false warnings in debug log
[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 ((!defined('__SECURITY')) || (!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", __FILE__);
42
43 // Was the form submitted?
44 if (IS_FORM_SENT()) {
45         // Replace german decimal comma with computer decimal dot
46         if (REQUEST_ISSET_POST(('surfbar_static_reward')))   REQUEST_SET_POST('surfbar_static_reward'  , REVERT_COMMA(REQUEST_POST('surfbar_static_reward')));
47         if (REQUEST_ISSET_POST(('surfbar_static_costs')))    REQUEST_SET_POST('surfbar_static_costs'   , REVERT_COMMA(REQUEST_POST('surfbar_static_costs')));
48         if (REQUEST_ISSET_POST(('surfbar_dynamic_percent'))) REQUEST_SET_POST('surfbar_dynamic_percent', REVERT_COMMA(REQUEST_POST('surfbar_dynamic_percent')));
49
50         // Save settings
51         ADMIN_SAVE_SETTINGS_POST();
52 } else {
53         // Prepare content
54         $content = array(
55                 'surfbar_static_reward'   => TRANSLATE_COMMA(getConfig('surfbar_static_reward')),
56                 'surfbar_static_costs'    => TRANSLATE_COMMA(getConfig('surfbar_static_costs')),
57                 'surfbar_static_time'     => CREATE_TIME_SELECTIONS(getConfig('surfbar_static_time')   , "surfbar_static_time"   , "ms" , "left"),
58                 'surfbar_static_lock'     => CREATE_TIME_SELECTIONS(getConfig('surfbar_static_lock')   , "surfbar_static_lock"   , "hm" , "left"),
59                 'surfbar_restart_time'    => CREATE_TIME_SELECTIONS(getConfig('surfbar_restart_time')  , "surfbar_restart_time"  , "ms" , "left"),
60                 'surfbar_dynamic_percent' => TRANSLATE_COMMA(getConfig('surfbar_dynamic_percent')),
61                 'surfbar_max_order'       => getConfig('surfbar_max_order'),
62                 'surfbar_stats_reload'    => CREATE_TIME_SELECTIONS(getConfig('surfbar_stats_reload')  , "surfbar_stats_reload"  , "ms" , "left"),
63                 'surfbar_purge_deleted'   => CREATE_TIME_SELECTIONS(getConfig('surfbar_purge_deleted') , "surfbar_purge_deleted" , "WDh", "left"),
64                 'surfbar_purge_migrated'  => CREATE_TIME_SELECTIONS(getConfig('surfbar_purge_migrated'), "surfbar_purge_migrated", "WDh", "left"),
65                 'surfbar_pause_url'       => getConfig('surfbar_pause_url'),
66                 'surfbar_warn_low_points' => getConfig('surfbar_warn_low_points'),
67                 'surfbar_low_interval'    => CREATE_TIME_SELECTIONS(getConfig('surfbar_low_interval')  , "surfbar_low_interval"  , "WDh", "left"),
68         );
69
70         // Prepare payment model for template
71         if (getConfig('surfbar_pay_model') == "STATIC") {
72                 // Static model
73                 define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , " checked=\"checked\"");
74                 define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', "");
75         } else {
76                 // Dynamic model
77                 define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , "");
78                 define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', " checked=\"checked\"");
79         }
80
81         // Prepare auto-sart
82         if (getConfig('surfbar_autostart') == "Y") {
83                 // Yes selected
84                 define('__CONFIG_SURFBAR_AUTOSTART_Y', " checked=\"checked\"");
85                 define('__CONFIG_SURFBAR_AUTOSTART_N', "");
86         } else {
87                 // No selected
88                 define('__CONFIG_SURFBAR_AUTOSTART_Y', "");
89                 define('__CONFIG_SURFBAR_AUTOSTART_N', " checked=\"checked\"");
90         }
91
92         // Prepare notify limits
93         if (getConfig('surfbar_notify_limits') == "Y") {
94                 // Yes selected
95                 define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', " checked=\"checked\"");
96                 define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', "");
97         } else {
98                 // No selected
99                 define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', "");
100                 define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', " checked=\"checked\"");
101         }
102
103         // Prepare notify admin about unlocked emails
104         if (getConfig('surfbar_notify_admin_unlock') == "Y") {
105                 // Yes selected
106                 define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', " checked=\"checked\"");
107                 define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', "");
108         } else {
109                 // No selected
110                 define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', "");
111                 define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', " checked=\"checked\"");
112         }
113
114         // Prepare order migration
115         if (getConfig('surfbar_migrate_order') == "Y") {
116                 // Yes selected
117                 define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', " checked=\"checked\"");
118                 define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', "");
119         } else {
120                 // No selected
121                 define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', "");
122                 define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', " checked=\"checked\"");
123         }
124
125         // Pause URL mode
126         if (getConfig('surfbar_pause_mode') == "INTERNAL") {
127                 // Internal pause page
128                 define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', " checked=\"checked\"");
129                 define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', "");
130         } else {
131                 // External pause page (if not empty)
132                 define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', "");
133                 define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', " checked=\"checked\"");
134         }
135
136         // Notification mode
137         if (getConfig('surfbar_notification_mode') == "INSTANT") {
138                 // Instant notification
139                 define('__CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', " selected=\"selected\"");
140                 define('__CONFIG_SURFBAR_NOTIFICATION_MODE_RESET'  , "");
141         } else {
142                 // Only daily reset
143                 define('__CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', "");
144                 define('__CONFIG_SURFBAR_NOTIFICATION_MODE_RESET'  , " selected=\"selected\"");
145         }
146
147         // Load template
148         LOAD_TEMPLATE("admin_config_surfbar", false, $content);
149 }
150
151 //
152 ?>