]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_surfbar.php
fooRequestElementBar() functions renamed, adding of request parameters added:
[mailer.git] / inc / modules / admin / what-config_surfbar.php
index ee4f738d1dfe04e500e082dc897068d4cb0eec16..81ac1596c621aaa9f4ffb499cc73d1eefbc487d9 100644 (file)
@@ -1,7 +1,7 @@
 <?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                          *
@@ -17,7 +17,7 @@
  * Needs to be in all Files and every File needs "svn propset           *
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  ************************************************************************/
 
 // Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
-       require($INC);
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+       die();
 }
 
 // Add description as navigation point
-ADD_DESCR('admin', __FILE__);
+addMenuDescription('admin', __FILE__);
 
 // Was the form submitted?
-if (IS_FORM_SENT()) {
+if (isFormSent()) {
        // Replace german decimal comma with computer decimal dot
-       if (REQUEST_ISSET_POST(('surfbar_static_reward')))   REQUEST_SET_POST('surfbar_static_reward'  , convertCommaToDot(REQUEST_POST('surfbar_static_reward')));
-       if (REQUEST_ISSET_POST(('surfbar_static_costs')))    REQUEST_SET_POST('surfbar_static_costs'   , convertCommaToDot(REQUEST_POST('surfbar_static_costs')));
-       if (REQUEST_ISSET_POST(('surfbar_dynamic_percent'))) REQUEST_SET_POST('surfbar_dynamic_percent', convertCommaToDot(REQUEST_POST('surfbar_dynamic_percent')));
+       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(
@@ -72,86 +71,26 @@ if (IS_FORM_SENT()) {
                'surfbar_low_interval'    => createTimeSelections(getConfig('surfbar_low_interval')  , 'surfbar_low_interval'  , 'WDh', 'left'),
        );
 
-       // Prepare payment model for template
-       if (getConfig('surfbar_pay_model') == 'STATIC') {
-               // Static model
-               define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , ' chkecked="checked"');
-               define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', '');
-       } else {
-               // Dynamic model
-               define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , '');
-               define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', ' chkecked="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
 
-       // Prepare auto-sart
-       if (getConfig('surfbar_autostart') == 'Y') {
-               // Yes selected
-               define('__CONFIG_SURFBAR_AUTOSTART_Y', ' chkecked="checked"');
-               define('__CONFIG_SURFBAR_AUTOSTART_N', '');
-       } else {
-               // No selected
-               define('__CONFIG_SURFBAR_AUTOSTART_Y', '');
-               define('__CONFIG_SURFBAR_AUTOSTART_N', ' chkecked="checked"');
-       }
+       // 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 - if
 
-       // Prepare notify limits
-       if (getConfig('surfbar_notify_limits') == 'Y') {
-               // Yes selected
-               define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', ' chkecked="checked"');
-               define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', '');
-       } else {
-               // No selected
-               define('__CONFIG_SURFBAR_NOTIFY_LIMITS_Y', '');
-               define('__CONFIG_SURFBAR_NOTIFY_LIMITS_N', ' chkecked="checked"');
-       }
-
-       // Prepare notify admin about unlocked emails
-       if (getConfig('surfbar_notify_admin_unlock') == 'Y') {
-               // Yes selected
-               define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_Y', ' chkecked="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', ' chkecked="checked"');
-       }
-
-       // Prepare order migration
-       if (getConfig('surfbar_migrate_order') == 'Y') {
-               // Yes selected
-               define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', ' chkecked="checked"');
-               define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', '');
-       } else {
-               // No selected
-               define('__CONFIG_SURFBAR_MIGRATE_ORDER_Y', '');
-               define('__CONFIG_SURFBAR_MIGRATE_ORDER_N', ' chkecked="checked"');
-       }
-
-       // Pause URL mode
-       if (getConfig('surfbar_pause_mode') == 'INTERNAL') {
-               // Internal pause page
-               define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', ' chkecked="checked"');
-               define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', '');
-       } else {
-               // External pause page (if not empty)
-               define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', '');
-               define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', ' chkecked="checked"');
-       }
-
-       // Notification mode
-       if (getConfig('surfbar_notification_mode') == 'INSTANT') {
-               // Instant notification
-               define('__CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', ' selected="selected"');
-               define('__CONFIG_SURFBAR_NOTIFICATION_MODE_RESET'  , '');
-       } else {
-               // Only daily reset
-               define('__CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', '');
-               define('__CONFIG_SURFBAR_NOTIFICATION_MODE_RESET'  , ' selected="selected"');
-       }
+       // 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]
 ?>