]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
Naming convention applied on language strings, check added to wrapper:
[mailer.git] / inc / wrapper-functions.php
index 934e42f5f7cb5f989a7a0e6494a9bb4320d82c17..e568da44e2658b592d23434a043d680212fdfadd 100644 (file)
@@ -559,7 +559,7 @@ function getAction ($strict = true) {
        $action = null;
 
        // Is the value set?
-       if (isActionSet(($strict) && (getScriptOutputMode() == 0))) {
+       if (isActionSet(($strict) && (isHtmlOutputMode()))) {
                // Then use it
                $action = $GLOBALS['action'];
        } // END - if
@@ -682,7 +682,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, false, 'direct');
+       return addPointsThroughReferalSystem($subject, $userid, $points, false, 0, 'direct');
 }
 
 // Wrapper for redirectToUrl but URL comes from a configuration entry
@@ -963,7 +963,7 @@ function sendRawRedirect ($url) {
 
        // check if running on IIS < 6 with CGI-PHP
        if ((isset($_SERVER['SERVER_SOFTWARE'])) && (isset($_SERVER['GATEWAY_INTERFACE'])) &&
-               (strpos($_SERVER['GATEWAY_INTERFACE'],'CGI') !== false) &&
+               (strpos($_SERVER['GATEWAY_INTERFACE'], 'CGI') !== false) &&
                (preg_match('|^Microsoft-IIS/(\d)\.\d$|', trim($_SERVER['SERVER_SOFTWARE']), $matches)) &&
                ($matches[1] < 6)) {
                // Send the IIS header
@@ -1049,7 +1049,7 @@ function isValidUserId ($userid) {
 // Encodes entities
 function encodeEntities ($str) {
        // Secure it first
-       $str = secureString($str);
+       $str = secureString($str, true, true);
 
        // Encode dollar sign as well
        $str = str_replace('$', '&#36;', $str);
@@ -1514,6 +1514,18 @@ function getMtWord () {
        return $GLOBALS['mt_word'];
 }
 
+// "Getter" for mt_word2
+function getMtWord2 () {
+       // Do we have cache?
+       if (!isset($GLOBALS['mt_word2'])) {
+               // Determine it
+               $GLOBALS['mt_word2'] = getConfig('mt_word2');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS['mt_word2'];
+}
+
 // "Getter" for main_title
 function getMainTitle () {
        // Do we have cache?
@@ -1802,6 +1814,18 @@ function getIndexHome () {
        return $GLOBALS['index_home'];
 }
 
+// "Getter" for one_day
+function getOneDay () {
+       // Do we have cache?
+       if (!isset($GLOBALS['one_day'])) {
+               // Determine it
+               $GLOBALS['one_day'] = getConfig('ONE_DAY');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS['one_day'];
+}
+
 // Checks wether proxy configuration is used
 function isProxyUsed () {
        // Do we have cache?
@@ -1819,7 +1843,7 @@ function ifPostContainsSelections ($element = 'sel') {
        // Do we have cache?
        if (!isset($GLOBALS['post_contains_selections'][$element])) {
                // Determine it
-               $GLOBALS['post_contains_selections'][$element] = (countPostSelection($element) > 0);
+               $GLOBALS['post_contains_selections'][$element] = ((isPostRequestParameterSet($element)) && (countPostSelection($element) > 0));
        } // END - if
 
        // Return cache
@@ -1850,5 +1874,59 @@ function getTotalPoints ($userid) {
        return $GLOBALS['total_points'][$userid];
 }
 
+// Wrapper to check if url_blacklist is enabled
+function isUrlBlacklistEnabled () {
+       // Do we have cache?
+       if (!isset($GLOBALS['is_url_blacklist_enabled'])) {
+               // Determine it
+               $GLOBALS['is_url_blacklist_enabled'] = (getConfig('url_blacklist') == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS['is_url_blacklist_enabled'];
+}
+
+// Checks wether direct payment is allowed in configuration
+function isDirectPaymentAllowed () {
+       // Do we have cache?
+       if (!isset($GLOBALS['is_direct_payment_allowed'])) {
+               // Determine it
+               $GLOBALS['is_direct_payment_allowed'] = (getConfig('allow_direct_pay') == 'Y');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS['is_direct_payment_allowed'];
+}
+
+// Wrapper to check if current task is for extension (not update)
+function isExtensionTask ($content) {
+       // Do we have cache?
+       if (!isset($GLOBALS['is_extension_task'][$content['task_type'] . '_' . $content['infos']])) {
+               // Determine it
+               $GLOBALS['is_extension_task'][$content['task_type'] . '_' . $content['infos']] = (($content['task_type'] == 'EXTENSION') && (isExtensionNameValid($content['infos'])) && (!isExtensionInstalled($content['infos'])));
+       } // END - if
+
+       // Return cache
+       return $GLOBALS['is_extension_task'][$content['task_type'] . '_' . $content['infos']];
+}
+
+// Wrapper to check if output mode is CSS
+function isCssOutputMode () {
+       // Determine it
+       return (getScriptOutputMode() == 1);
+}
+
+// Wrapper to check if output mode is HTML
+function isHtmlOutputMode () {
+       // Determine it
+       return (getScriptOutputMode() == 0);
+}
+
+// Wrapper to check if output mode is RAW
+function isRawOutputMode () {
+       // Determine it
+       return (getScriptOutputMode() == -1);
+}
+
 // [EOF]
 ?>