Referal system refactured (and some parts fixed), wrapper function introduced:
[mailer.git] / inc / wrapper-functions.php
index 16b10bcb27e074add2f15b8a3968cf2ff49694f4..4384212523182b1da67ba855a6244deea58cda4c 100644 (file)
@@ -741,7 +741,16 @@ function isBlockModeEnabled () {
        return $GLOBALS['block_mode'];
 }
 
-// Wrapper function for addPointsThroughReferalSystem()
+/**
+ * Wrapper function for addPointsThroughReferalSystem(), you should generally
+ * avoid this function and use addPointsThroughReferalSystem() directly and add
+ * your special payment method entry to points_data instead.
+ *
+ * @param      $subject        A string-encoded subject for this add
+ * @param      $userid         The recipient (member) for given points
+ * @param      $points         Points to be added to member's account
+ * @return     $added          Wether the points has been added to the user's account
+ */
 function addPointsDirectly ($subject, $userid, $points) {
        // Reset level here
        initReferalSystem();
@@ -2557,6 +2566,12 @@ function parseFloat ($floatString){
     return floatval($floatString);
 }
 
+// Generates a YES/NO option list from given default
+function generateYesNoOptionList ($default = '') {
+       // Generate it
+       return generateOptionList('/ARRAY/', array('Y', 'N'), array('{--YES--}', '{--NO--}'), $default);
+}
+
 //-----------------------------------------------------------------------------
 //                        Configuration wrapper
 //-----------------------------------------------------------------------------