Config added for surfbar
[mailer.git] / inc / modules / admin / what-config_surfbar.php
index e49887b..10d587c 100644 (file)
@@ -40,7 +40,35 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) {
 // Add description as navigation point
 ADD_DESCR("admin", basename(__FILE__));
 
-die("<pre>".print_r($_CONFIG, true)."</pre>");
+// Was the form submitted?
+if (isset($_POST['ok'])) {
+       // Replace german decimal comma with computer decimal dot
+       if (isset($_POST['surfbar_static_reward'])) $_POST['surfbar_static_reward'] = str_replace(",", ".", $_POST['surfbar_static_reward']);
+
+       // Save settings
+       ADMIN_SAVE_SETTINGS($_POST);
+} else {
+       // Prepare content
+       $content = array(
+               'surfbar_static_reward' => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']),
+               'surfbar_static_time'   => $_CONFIG['surfbar_static_time'],
+               'surfbar_static_lock'   => $_CONFIG['surfbar_static_lock']
+       );
+
+       // Prepare payment model for template
+       if ($_CONFIG['surfbar_pay_model'] == "STATIC") {
+               // Static model
+               define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , " checked=\"checked\"");
+               define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', "");
+       } else {
+               // Dynamic model
+               define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , "");
+               define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', " checked=\"checked\"");
+       }
+
+       // Load template
+       LOAD_TEMPLATE("admin_config_surfbar", false, $content);
+}
 
 //
 ?>