X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-config_bonus.php;h=63fcbeecc06c94dc049a46b59d35ff1f26f9182f;hp=8e95c3aaacf065efeed1b74eabd8370a9625a339;hb=596c8ab32594401ca84abfbfe35513ddfff31bec;hpb=6914ebaaae909093df86d010e4c754a43d1a1aed diff --git a/inc/modules/admin/what-config_bonus.php b/inc/modules/admin/what-config_bonus.php index 8e95c3aaac..63fcbeecc0 100644 --- a/inc/modules/admin/what-config_bonus.php +++ b/inc/modules/admin/what-config_bonus.php @@ -14,12 +14,10 @@ * $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 * - * Copyright (c) 2009, 2010 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2012 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 * @@ -43,82 +41,77 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { } // END - if // Add description as navigation point -addMenuDescription('admin', __FILE__); +addYouAreHereLink('admin', __FILE__); if (isFormSent()) { - // Replace german decimal commas to computer decimal dots - setPostRequestParameter('login_bonus', convertCommaToDot(postRequestParameter('login_bonus'))); - setPostRequestParameter('turbo_bonus', convertCommaToDot(postRequestParameter('turbo_bonus'))); - setPostRequestParameter('bonus_ref', convertCommaToDot(postRequestParameter('bonus_ref'))); - setPostRequestParameter('bonus_order', convertCommaToDot(postRequestParameter('bonus_order'))); - setPostRequestParameter('bonus_notify_points', convertCommaToDot(postRequestParameter('bonus_notify_points'))); + // Replace german decimal comma with computer decimal dot + convertCommaToDotInPostDataArray(array('login_bonus', 'turbo_bonus', 'bonus_ref', 'bonus_order', 'bonus_notify_points')); // Generate string for saving ranks - setPostRequestParameter('turbo_rates', ''); + setPostRequestElement('turbo_rates', ''); $RATES = array(); - foreach (postRequestParameter('rate') as $rate) { + foreach (postRequestElement('rate') as $rate) { + // Convert German comma to dot $rate = trim(convertCommaToDot($rate)); - if (!empty($rate)) $RATES[] = $rate; + + if (!empty($rate)) { + array_push($RATES, $rate); + } // END - if } // END - foreach - setPostRequestParameter('turbo_rates', trim(implode(';', $RATES))); - unsetPostRequestParameter('rate'); + setPostRequestElement('turbo_rates', trim(implode(';', $RATES))); + unsetPostRequestElement('rate'); // Automatically calculate bonus points for ranks 2 and 3 when not set - if (!isPostRequestParameterSet('turbo_rates')) setPostRequestParameter('turbo_rates', ''.round(getConfig('turbo_bonus') / 2).';'.round(getConfig('turbo_bonus') / 4).''); + if (!isPostRequestElementSet('turbo_rates')) { + setPostRequestElement('turbo_rates', ''.round(getConfig('turbo_bonus') / 2).';'.round(getConfig('turbo_bonus') / 4).''); + } // END - if // Save data adminSaveSettingsFromPostData(); // Remember new settings - setConfigEntry('bonus_active' , postRequestParameter('bonus_active')); - setConfigEntry('bonus_enable_notify' , postRequestParameter('bonus_enable_notify')); - setConfigEntry('bonus_disable_notify', postRequestParameter('bonus_disable_notify')); + setConfigEntry('bonus_active' , postRequestElement('bonus_active')); + setConfigEntry('bonus_enable_notify' , postRequestElement('bonus_enable_notify')); + setConfigEntry('bonus_disable_notify', postRequestElement('bonus_disable_notify')); } else { // Transfer options to template - $content['form_selection'] = addMemberSelectionBox(getBonusUserId(), false, true, true, 'bonus_userid'); + $content['bonus_userid'] = addMemberSelectionBox(getBonusUserid(), FALSE, TRUE, TRUE, 'bonus_userid'); // Initialize array for the points list - $RANKS = explode(';', getConfig('turbo_rates')); + $RANKS = explode(';', getTurboRates()); // Automatically calculate bonus points for ranks 2 and 3 when not set - if (getConfig('turbo_rates') == '') $RANKS = array(round(getConfig('turbo_bonus') / 2), round(getConfig('turbo_bonus') / 4)); + if (getTurboRates() == '') $RANKS = array(round(getConfig('turbo_bonus') / 2), round(getConfig('turbo_bonus') / 4)); // Generate list $OUT = '
    '; - $cnt = '0'; + $count = '0'; foreach ($RANKS as $k => $rate) { if (!empty($rate)) { // Print only when something is in $OUT .= '
  1. ({?POINTS?})
  2. '; } // END - if - $cnt++; + $count++; } // END - foreach // Maxmium entries $max = 10; - if ($cnt >= 8) $max = $cnt+3; + if ($count >= 8) $max = $count+3; // Add more empty fields - for ($i = $cnt; $i < $max; $i++) { + for ($i = $count; $i < $max; $i++) { $OUT .= '
  3. ({?POINTS?})
  4. '; } // END - for $OUT .= '
'; $content['trates_list'] = $OUT; // Selection boxes - $content['login_timeout_selection'] = createTimeSelections(getConfig('login_timeout') , 'login_timeout' , 'WDh'); - $content['bonus_timeout_selection'] = createTimeSelections(getConfig('bonus_timeout') , 'bonus_timeout' , 'WDh'); - $content['wait_selection'] = createTimeSelections(getConfig('bonus_notify_wait'), 'bonus_notify_wait', 'ms' ); - - // Init Y/N selections - foreach (array('active','login_yn','stats_yn','order_yn','ref_yn','click_yn','enable_notify','disable_notify','new_member_notify','include_own') as $entry) { - $content[$entry . '_y'] = ''; - $content[$entry . '_n'] = ''; - $content[$entry . '_' . strtolower(getConfig('bonus_' . $entry))] = ' checked="checked"'; - } // END - foreach + $content['login_timeout_selection'] = createConfigurationTimeSelections('login_timeout' , 'WDh'); + $content['bonus_timeout_selection'] = createConfigurationTimeSelections('bonus_timeout' , 'WDh'); + $content['wait_selection'] = createConfigurationTimeSelections('bonus_notify_wait', 'ms' ); // Load final template - loadTemplate('admin_config_bonus', false, $content); + loadTemplate('admin_config_bonus', FALSE, $content); } // [EOF]