X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Forder_functions.php;h=019b84029c2fe3b18eb20c20d4f223c9ad0c07dc;hp=ef7549cf848bb52a34fe0232f7fa8d59ee9580a7;hb=49acdb7a7adbcf25a8e8683b5581bfcec72b23bd;hpb=c3b4eaf29946349ff058691db2dcb615a5379bb2 diff --git a/inc/libs/order_functions.php b/inc/libs/order_functions.php index ef7549cf84..019b84029c 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 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2015 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,25 +43,200 @@ 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"'; + if ($item == $default) { + $selected = ' selected="selected"'; + } // END - if - // 'ref_clicks' needs to be rewritten to 'referal_clicks' + // 'ref_clicks' needs to be rewritten to 'referral_clicks' if ($item == 'ref_clicks') { - $item = 'referal_clicks'; + $item = 'referral_clicks'; } // END - if // Add option line - $OUT .= ''; + $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 'autosend_member_mails' config entry +function getAutosendMemberMails () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('autosend_member_mails'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Determines whether 'autosend_member_mails' is set to 'Y' +function isAutosendMemberMailsEnabled () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = (getAutosendMemberMails() == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Getter for 'order_max_full' config entry +function getOrderMaxFull () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('order_max_full'); + } // 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__]; +} + +// Getter for 'max_unconfirmed' config entry +function getMaxUnconfirmed () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('max_unconfirmed'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Getter for 'max_text_length' config entry +function getMaxTextLength () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('max_text_length'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Getter for 'order_min' config entry +function getOrderMin () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('order_min'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Getter for 'allow_url_in_text' config entry +function getAllowUrlInText () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('allow_url_in_text'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Determines whether 'allow_url_in_text' is set to 'Y' +function isAllowUrlInTextEnabled () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = (getAllowUrlInText() == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Getter for 'allow_url_in_subject' config entry +function getAllowUrlInSubject () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('allow_url_in_subject'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + +// Determines whether 'allow_url_in_subject' is set to 'Y' +function isAllowUrlInSubjectEnabled () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = (getAllowUrlInSubject() == 'Y'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + // [EOF] ?>