<?php
/************************************************************************
- * MXChange v0.2.1 Start: 08/31/2008 *
- * ================ Last change: 08/31/2008 *
+ * Mailer v0.2.1-FINAL Start: 08/31/2008 *
+ * =================== Last change: 08/31/2008 *
* *
* -------------------------------------------------------------------- *
* File : what-config_surfbar.php *
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Konfiguration fuer Surfbar *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
* -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
- require($INC);
-}
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+ die();
+} // END - if
// Add description as navigation point
-ADD_DESCR("admin", basename(__FILE__));
+addMenuDescription('admin', __FILE__);
// Was the form submitted?
-if (isset($_POST['ok'])) {
+if (isFormSent()) {
// Replace german decimal comma with computer decimal dot
- if (isset($_POST['surfbar_static_reward'])) $_POST['surfbar_static_reward'] = str_replace(",", ".", $_POST['surfbar_static_reward']);
+ if (isPostRequestParameterSet('surfbar_static_reward')) setPostRequestParameter('surfbar_static_reward' , convertCommaToDot(postRequestParameter('surfbar_static_reward')));
+ if (isPostRequestParameterSet('surfbar_static_costs')) setPostRequestParameter('surfbar_static_costs' , convertCommaToDot(postRequestParameter('surfbar_static_costs')));
+ if (isPostRequestParameterSet('surfbar_dynamic_percent')) setPostRequestParameter('surfbar_dynamic_percent', convertCommaToDot(postRequestParameter('surfbar_dynamic_percent')));
// Save settings
- ADMIN_SAVE_SETTINGS($_POST);
+ adminSaveSettingsFromPostData();
} 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']
+ 'surfbar_static_time' => createTimeSelections(getConfig('surfbar_static_time') , 'surfbar_static_time' , 'ms' , 'left'),
+ 'surfbar_static_lock' => createTimeSelections(getConfig('surfbar_static_lock') , 'surfbar_static_lock' , 'hm' , 'left'),
+ 'surfbar_restart_time' => createTimeSelections(getConfig('surfbar_restart_time') , 'surfbar_restart_time' , 'ms' , 'left'),
+ 'surfbar_stats_reload' => createTimeSelections(getConfig('surfbar_stats_reload') , 'surfbar_stats_reload' , 'ms' , 'left'),
+ 'surfbar_purge_deleted' => createTimeSelections(getConfig('surfbar_purge_deleted') , 'surfbar_purge_deleted' , 'WDh', 'left'),
+ 'surfbar_purge_migrated' => createTimeSelections(getConfig('surfbar_purge_migrated'), 'surfbar_purge_migrated', 'WDh', 'left'),
+ 'surfbar_low_interval' => createTimeSelections(getConfig('surfbar_low_interval') , 'surfbar_low_interval' , 'WDh', 'left'),
);
- // 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\"");
- }
+ // Prepare further Y/N config entries
+ foreach (array('surfbar_autostart','surfbar_notify_limits','surfbar_notify_admin_unlock','surfbar_migrate_order','surfbar_guest_login_form') as $entry) {
+ $content[$entry . '_y'] = '';
+ $content[$entry . '_n'] = '';
+ $content[$entry . '_' . strtolower(getConfig($entry))] = ' checked="checked"';
+ } // END - foreach
+
+ // Even some more...
+ foreach (array('surfbar_pay_model_static','surfbar_pay_model_dynamic','surfbar_pause_mode_internal','surfbar_pause_mode_external','surfbar_notification_mode_instant','surfbar_notification_mode_reset') as $entry) {
+ $content[$entry] = '';
+ } // END - foreach
- // Prepare admin notify
- if ($_CONFIG['surfbar_notify_admin_unlock'] == "Y") {
- // Yes selected
- define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y' , " checked=\"checked\"");
- define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', "");
- } else {
- // No selected
- define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y' , "");
- define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', " checked=\"checked\"");
- }
+ // Prepare selections
+ foreach (array('surfbar_pay_model','surfbar_pause_mode','surfbar_notification_mode') as $entry) {
+ $content[$entry . '_' . strtolower(getConfig($entry))] = ' checked="checked"';
+ } // END - foreach
// Load template
- LOAD_TEMPLATE("admin_config_surfbar", false, $content);
+ loadTemplate('admin_config_surfbar', false, $content);
}
-//
+// [EOF]
?>