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