Introduced (means, being added and then used) more wrappers for ext-order/other
authorRoland Häder <roland@mxchange.org>
Wed, 23 Jan 2013 14:31:38 +0000 (14:31 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 23 Jan 2013 14:31:38 +0000 (14:31 +0000)
inc/libs/order_functions.php
inc/libs/other_functions.php
inc/modules/member/what-order.php
inc/wrapper-functions.php

index cbdff252a2187034bd4a6e9f7cb123f53c227927..5c35c7885c15616ae343eb31240b650c315abcdf 100644 (file)
@@ -167,7 +167,7 @@ function getMaxUnconfirmed () {
 }
 
 // Getter for 'max_text_length' config entry
-function getMaxTextLenngth () {
+function getMaxTextLength () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
@@ -178,5 +178,65 @@ function getMaxTextLenngth () {
        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]
 ?>
index 1aba657195fe7a3ea55d88245ae9757c3bcea3ff..a2b9fffed7d573072267cbbcc82842818dafe54c 100644 (file)
@@ -124,5 +124,41 @@ function getActivateXchange () {
        return $GLOBALS[__FUNCTION__];
 }
 
+// "Getter" for admin_notify
+function getAdminNotify () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('admin_notify');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for internal_stats
+function getInternalStats () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('internal_stats');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for display_debug_sqls
+function getDisplayDebugSqls () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('display_debug_sqls');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>
index a084b89e4a183d00f3de18ee64636fefff2e7cc4..f0d56c922af0e6d8fbffa81a0d71af5104a97af6 100644 (file)
@@ -100,7 +100,7 @@ LIMIT 1",
                 * and check the text and subject against some filters
                 */
                $data['url'] = '';
-               if (getConfig('allow_url_in_text') == 'Y') {
+               if (!isAllowUrlInTextEnabled()) {
                        // Test submitted text against some filters (length, URLs in text etc.)
                        if ((isInStringIgnoreCase('https://', postRequestElement('text'))) || (isInStringIgnoreCase('http://', postRequestElement('text'))) || (isInStringIgnoreCase('www', postRequestElement('text')))) {
                                // URL found
@@ -118,7 +118,7 @@ LIMIT 1",
                } // END - if
 
                // Shall I test the subject line against URLs?
-               if (getConfig('allow_url_in_subject') == 'Y') {
+               if (!isAllowUrlInSubjectEnabled()) {
                        // Check the subject line for issues
                        setPostRequestElement('subject', str_replace(chr(92), '[nl]', substr(postRequestElement('subject'), 0, 200)));
                        if ((isInStringIgnoreCase('https://', postRequestElement('subject'))) || (isInStringIgnoreCase('http://', postRequestElement('subject'))) || (isInStringIgnoreCase('www', postRequestElement('subject')))) {
@@ -134,7 +134,7 @@ LIMIT 1",
                } // END - if
 
                // Enougth receivers entered?
-               if ((postRequestElement('receiver') < getConfig('order_min')) && (!isAdmin())) {
+               if ((postRequestElement('receiver') < getOrderMin()) && (!isAdmin())) {
                        // Less than allowed receivers entered!
                        $data['url'] = 'modules.php?module=login&amp;what=order&amp;code=' . getCode('MORE_RECEIVERS3');
                } // END - if
index 6e41821cd2bc15cc9945465e00287c3549c5d40b..e3f992d0be3bb609554533671b21c8e6637116db 100644 (file)
@@ -1619,7 +1619,7 @@ function isDisplayDebugSqlEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.2.2')) && (getConfig('display_debug_sqls') == 'Y'));
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.2.2')) && (getDisplayDebugSqls() == 'Y'));
        } // END - if
 
        // Return cache
@@ -1655,7 +1655,7 @@ function ifInternalStatsEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Then determine it
-               $GLOBALS[__FUNCTION__] = (getConfig('internal_stats') == 'Y');
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.2.6')) && (getInternalStats() == 'Y'));
        } // END - if
 
        // Return cached value
@@ -1667,7 +1667,7 @@ function isAdminNotificationEnabled () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.3.0')) && (getConfig('admin_notify') == 'Y'));
+               $GLOBALS[__FUNCTION__] = ((isExtensionInstalledAndNewer('other', '0.3.0')) && (getAdminNotify() == 'Y'));
        } // END - if
 
        // Return cache