X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Forder_functions.php;h=27f3bbf7e61dac917a0a7cca691bea869297ab25;hb=be0b83c7b9a7a8cf91ef6799bede2d49cfa5a131;hp=121265189de1fe2b8cf528f236eb8debe6c09873;hpb=c8d76610eb94093d4eed4fcd8a6cb72e74c8f6d8;p=mailer.git diff --git a/inc/libs/order_functions.php b/inc/libs/order_functions.php index 121265189d..27f3bbf7e6 100644 --- a/inc/libs/order_functions.php +++ b/inc/libs/order_functions.php @@ -16,8 +16,8 @@ * $Author:: $ * * -------------------------------------------------------------------- * * 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,17 +43,80 @@ if (!defined('__SECURITY')) { // Generates a selection list for mail order function addOrderSelectionOptions ($default) { // Currenty the list is hardcoded... + // @TODO Move this array into a filter $LIST = array('userid', 'zip', 'country', 'email', 'birth_year', 'last_online', 'ref_clicks', 'total_logins', 'mail_orders'); $OUT = ''; foreach ($LIST as $item) { + // Defaul selection $selected = ''; - if ($item == $default) $selected = ' selected="selected"'; - $OUT .= ''; + if ($item == $default) { + $selected = ' selected="selected"'; + } // END - if + + // 'ref_clicks' needs to be rewritten to 'referral_clicks' + if ($item == 'ref_clicks') { + $item = 'referral_clicks'; + } // END - if + + // Add option line + $OUT .= ''; } // END - foreach // Return the output return $OUT; } +//----------------------------------------------------------------------------- +// Wrapper functions for configuration entries +//----------------------------------------------------------------------------- + +// Getter for 'order_multi_page' config entry +function getOrderMultiPage () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('order_multi_page'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Determines whether 'order_multi_page' is set to 'Y' +function isOrderMultiPageEnabled () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = (getOrderMultiPage() == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Getter for 'order_mode' config entry +function getOrderMode () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('order_mode'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Getter for 'order_select' config entry +function getOrderSelect () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('order_select'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + // [EOF] ?>