]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_doubler.php
Updated copyright year.
[mailer.git] / inc / modules / admin / what-config_doubler.php
index a05621cc0a43b26a38c30f9249ab1406f1e750ff..e40339be5273f99aa4930975b409abd542132dcf 100644 (file)
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -42,38 +41,15 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 } // END - if
 
 // Add description as navigation point
-addMenuDescription('admin', __FILE__);
+addYouAreHereLink('admin', __FILE__);
 
-if (isFormSent()) {
-       // Replace commata with decimal dot
-       setPostRequestElement('doubler_charge', (convertCommaToDot(postRequestElement('doubler_charge')) / 100));
-       setPostRequestElement('doubler_ref'   , (convertCommaToDot(postRequestElement('doubler_ref')) / 100));
-       setPostRequestElement('doubler_min'   , convertCommaToDot(postRequestElement('doubler_min')));
-       setPostRequestElement('doubler_max'   , convertCommaToDot(postRequestElement('doubler_max')));
-       setPostRequestElement('doubler_left'  , convertCommaToDot(postRequestElement('doubler_left')));
+if (isFormSent('save_config')) {
+       // Replace german decimal comma with computer decimal dot
+       convertCommaToDotInPostDataArray(array('doubler_charge', 'doubler_ref', 'doubler_min', 'doubler_max', 'doubler_left'));
 
        // Save settings
        adminSaveSettingsFromPostData();
 } else {
-       // Prepare data for the template
-       // - Charge rate
-       $content['charge']  = translateComma((getConfig('doubler_charge') * 100), false);
-       // - Referal rate
-       $content['referal'] = translateComma((getConfig('doubler_ref') * 100), false);
-       // - Minimum points to double
-       $content['minimum'] = translateComma(getConfig('doubler_min'), false);
-       // - Maximum points to double
-       $content['maximum'] = translateComma(getConfig('doubler_max'), false);
-       // - Points left on users account after doubling
-       $content['left']    = translateComma(getConfig('doubler_left'), false);
-
-       // Init all Y/N selections
-       foreach (array('jackpot','own','sent_all') as $entry) {
-               $content[$entry . '_y'] = '';
-               $content[$entry . '_n'] = '';
-               $content[$entry . '_' . strtolower(getConfig('doubler_' . $entry))] = ' checked="checked"';
-       } // END - foreach
-
        // Init other selections
        foreach (array('send_mode_direct','send_mode_reset') as $entry) {
                $content[$entry] = '';
@@ -85,18 +61,38 @@ if (isFormSent()) {
        } // END - foreach
 
        // Transfer options
-       $content['member_selection'] = addMemberSelectionBox(getConfig('doubler_userid'), false, true, true, 'doubler_userid');
+       $content['doubler_userid'] = addMemberSelectionBox(getDoublerUserid(), FALSE, TRUE, TRUE, 'doubler_userid');
 
        // Number of rows to display (option lines!!!)
        foreach (array('new','pay','old') as $entry) {
-               $content['display_' . $entry] = generateOptionList('/ARRAY/', array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_' . $entry));
+               $content['display_' . $entry] = generateOptions(
+                       '/ARRAY/',
+                       array(
+                               5,
+                               10,
+                               20,
+                               30,
+                               40,
+                               50,
+                               100
+                       ), array(
+                               5,
+                               10,
+                               20,
+                               30,
+                               40,
+                               50,
+                               100
+                       ),
+                       getConfig('doubler_display_' . $entry)
+               );
        } // END - foreach
 
        // Timeout selection box or input box?
-       $content['timeout_selection'] = createTimeSelections(getConfig('doubler_timeout')  , 'doubler_timeout'  , 'WDh');
+       $content['timeout_selection'] = createConfigurationTimeSelections('doubler_timeout', 'WDh');
 
        // Load template
-       loadTemplate('admin_config_doubler', false, $content);
+       loadTemplate('admin_config_doubler', FALSE, $content);
 }
 
 // [EOF]