]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/order_functions.php
Fixes and cleanups
[mailer.git] / inc / libs / order_functions.php
index 121265189de1fe2b8cf528f236eb8debe6c09873..f6da85ea7949b5bf28be1dc881b452216ca71d88 100644 (file)
@@ -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 - 2011 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 *
@@ -46,8 +46,18 @@ function addOrderSelectionOptions ($default) {
        $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 'referral_clicks'
+               if ($item == 'ref_clicks') {
+                       $item = 'referral_clicks';
+               } // END - if
+
+               // Add option line
                $OUT .= '<option value="' . $item . '"' . $selected . '>{--ADMIN_ORDER_SELECT_COLUMN_' . strtoupper($item) . '--}</option>';
        } // END - foreach
 
@@ -55,5 +65,33 @@ function addOrderSelectionOptions ($default) {
        return $OUT;
 }
 
+//-----------------------------------------------------------------------------
+//                Wrapper functions for configuration entries
+//-----------------------------------------------------------------------------
+
+// Getter for 'order_multi_page' config entry
+function getOrderMultiPage () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('order_multi_page');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Determines wether 'order_multi_page' is set to 'Y'
+function isOrderMultiPageEnabled () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = (getOrderMultiPage() == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>