]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
Extension ext-coupon continued, naming convention, many improvements:
[mailer.git] / inc / wrapper-functions.php
index 81fbc2f8b03e1ee70af368e25d0b0e0658ac7259..1520f1191589d24b8c4d5c1f94ee645459b0c6af 100644 (file)
@@ -740,7 +740,7 @@ function addPointsDirectly ($subject, $userid, $points) {
        unset($GLOBALS['ref_level']);
 
        // Call more complicated method (due to more parameters)
-       return addPointsThroughReferalSystem($subject, $userid, $points, false, 0, 'direct');
+       return addPointsThroughReferalSystem($subject, $userid, $points, false, 0, 'DIRECT');
 }
 
 // Wrapper for redirectToUrl but URL comes from a configuration entry
@@ -752,7 +752,7 @@ function redirectToConfiguredUrl ($configEntry) {
 // Wrapper function to redirect from member-only modules to index
 function redirectToIndexMemberOnlyModule () {
        // Do the redirect here
-       redirectToUrl('modules.php?module=index&code=' . getCode('MODULE_MEMBER_ONLY') . '&mod=' . getModule());
+       redirectToUrl('modules.php?module=index&code=' . getCode('MODULE_MEMBER_ONLY') . '&mod=' . getModule());
 }
 
 // Wrapper function to redirect to current URL
@@ -761,9 +761,9 @@ function redirectToRequestUri () {
 }
 
 // Wrapper function to redirect to de-refered URL
-function redirectToDereferedUrl ($URL) {
+function redirectToDereferedUrl ($url) {
        // Redirect to to
-       redirectToUrl(generateDerefererUrl($URL));
+       redirectToUrl(generateDerefererUrl($url));
 }
 
 // Wrapper function for checking if extension is installed and newer or same version
@@ -1220,7 +1220,9 @@ function getYear ($timestamp = null) {
        // Is it cached?
        if (!isset($GLOBALS[__FUNCTION__][$timestamp])) {
                // null is time()
-               if (is_null($timestamp)) $timestamp = time();
+               if (is_null($timestamp)) {
+                       $timestamp = time();
+               } // END - if
 
                // Then create it
                $GLOBALS[__FUNCTION__][$timestamp] = date('Y', $timestamp);
@@ -2442,12 +2444,57 @@ function firstCharUpperCase ($str) {
 }
 
 // Shortens calls with configuration entry as first argument (the second will become obsolete in the future)
-function createConfigurationTimeSelections ($configEntry, $stamps) {
+function createConfigurationTimeSelections ($configEntry, $stamps, $align = 'center') {
        // Get the configuration entry
        $configValue = getConfig($configEntry);
 
        // Call inner method
-       return createTimeSelections($configValue, $configEntry, $stamps);
+       return createTimeSelections($configValue, $configEntry, $stamps, $align);
+}
+
+// Shortens converting of German comma to Computer's version in POST data
+function convertCommaToDotInPostData ($postEntry) {
+       // Read and convert given entry
+       $postValue = convertCommaToDot(postRequestParameter($postEntry));
+
+       // ... and set it again
+       setPostRequestParameter($postEntry, $postValue);
+}
+
+// Converts German commas to Computer's version in all entries
+function convertCommaToDotInPostDataArray (array $postEntries) {
+       // Replace german decimal comma with computer decimal dot
+       foreach ($postEntries as $entry) {
+               // Is the entry there?
+               if (isPostRequestParameterSet($entry)) {
+                       // Then convert it
+                       convertCommaToDotInPostData($entry);
+               } // END - if
+       } // END - foreach
+}
+
+// Getter for 'check_double_email'
+function getCheckDoubleEmail () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = getConfig('check_double_email');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether 'check_double_email' is "YES"
+function isCheckDoubleEmailEnabled () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = (getCheckDoubleEmail() == 'Y');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
 }
 
 // [EOF]