New wrapper functions introduced
[mailer.git] / inc / filters.php
index 77a02c56cab62268ca3545ee5b3eaf5722ed7e84..254630b39eb25aca5da88beeb32fc74b9b8a978f 100644 (file)
@@ -524,7 +524,7 @@ function FILTER_COMPILE_EXPRESSION_CODE ($code) {
        } // END - if
 
        // Do we have non-HTML mode?
-       if ((getScriptOutputMode() != '0') || ($outputMode != '0')) $code = decodeEntities($code);
+       if ((!isHtmlOutputMode()) || ($outputMode != '0')) $code = decodeEntities($code);
 
        // Return compiled code
        //* DEBUG: */ debugOutput(__FUNCTION__.'['.__LINE__.']:<pre>'.($code).'</pre>');
@@ -548,7 +548,7 @@ function FILTER_UPDATE_EXTENSION_DATA ($ext_name) {
 // Load more reset scripts
 function FILTER_RUN_RESET_INCLUDES () {
        // Is the reset set or old sql_patches?
-       if (((!isResetModeEnabled()) || (!isExtensionInstalled('sql_patches'))) && (getScriptOutputMode() == '0')) {
+       if (((!isResetModeEnabled()) || (!isExtensionInstalled('sql_patches'))) && (isHtmlOutputMode())) {
                // Then abort here
                debug_report_bug(__FUNCTION__, __LINE__, 'Cannot run reset! enabled='.intval(isResetModeEnabled()).',ext='.intval(isExtensionInstalled('sql_patches')).' Please report this bug. Thanks');
        } // END - if
@@ -638,14 +638,14 @@ function FILTER_DETERMINE_WHAT_ACTION () {
        } // END - if
 
        // Get all values
-       if ((getScriptOutputMode() != 1) && (getScriptOutputMode() != -1)) {
+       if ((!isCssOutputMode()) && (!isRawOutputMode())) {
                // Fix module
                if (!isModuleSet()) {
                        // Is the request element set?
                        if (isGetRequestParameterSet('module')) {
                                // Set module from request
                                setModule(getRequestParameter('module'));
-                       } elseif (getScriptOutputMode() == '0') {
+                       } elseif (isHtmlOutputMode()) {
                                // Set default module 'index'
                                setModule('index');
                        } else {
@@ -655,10 +655,14 @@ function FILTER_DETERMINE_WHAT_ACTION () {
                } // END - if
 
                // Fix 'what' if not yet set
-               if (!isWhatSet())   setWhat(getWhatFromModule(getModule()));
+               if (!isWhatSet()) {
+                       setWhat(getWhatFromModule(getModule()));
+               } // END - if
 
                // Fix 'action' if not yet set
-               if (!isActionSet()) setAction(getActionFromModuleWhat(getModule(), getWhat()));
+               if (!isActionSet()) {
+                       setAction(getActionFromModuleWhat(getModule(), getWhat()));
+               } // END - if
        } else {
                // Set action/what to empty
                setAction('');
@@ -667,7 +671,7 @@ function FILTER_DETERMINE_WHAT_ACTION () {
 
        // Set default 'what' value
        //* DEBUG: */ debugOutput('-' . getModule() . '/' . getWhat() . '-');
-       if ((!isWhatSet()) && (!isActionSet()) && (getScriptOutputMode() != 1) && (getScriptOutputMode() != -1)) {
+       if ((!isWhatSet()) && (!isActionSet()) && (!isCssOutputMode()) && (!isRawOutputMode())) {
                if (getModule() == 'admin') {
                        // Set 'action' value to 'login' in admin menu
                        setAction(getActionFromModuleWhat(getModule(), getWhat()));
@@ -684,7 +688,7 @@ function FILTER_DETERMINE_WHAT_ACTION () {
 // Sends out pooled mails
 function FILTER_TRIGGER_SENDING_POOL () {
        // Are we in normal output mode?
-       if (getScriptOutputMode() != 0) {
+       if (!isHtmlOutputMode()) {
                // Only in normal output mode to prevent race-conditons!
        } // END - if
 
@@ -722,7 +726,7 @@ function FILTER_RUN_DAILY_RESET () {
        if ((isInstallationPhase()) || (!isInstalled()) || (!isAdminRegistered()) || (!isExtensionInstalled('sql_patches'))) return;
 
        // Shall we run the reset scripts? If a day has changed, maybe also a week/month has changed... Simple! :D
-       if (((getDay(getConfig('last_update')) != getDay()) || ((isConfigEntrySet('DEBUG_RESET')) && (getConfig('DEBUG_RESET') == 'Y'))) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestParameterSet('register')) && (getScriptOutputMode() != 1)) {
+       if (((getDay(getConfig('last_update')) != getDay()) || ((isConfigEntrySet('DEBUG_RESET')) && (getConfig('DEBUG_RESET') == 'Y'))) && (!isInstallationPhase()) && (isAdminRegistered()) && (!isGetRequestParameterSet('register')) && (!isCssOutputMode())) {
                // Tell every module we are in reset-mode!
                doReset();
        } // END - if
@@ -784,7 +788,7 @@ function FILTER_COUNT_MODULE () {
 // Handles fatal errors
 function FILTER_HANDLE_FATAL_ERRORS () {
        // Do we have errors to handle and right output mode?
-       if ((!ifFatalErrorsDetected()) || (getScriptOutputMode() != '0')) {
+       if ((!ifFatalErrorsDetected()) || (!isHtmlOutputMode())) {
                // Abort executing here
                return false;
        } // END - if
@@ -885,7 +889,7 @@ function FILTER_DISPLAY_COPYRIGHT () {
 function FILTER_DISPLAY_PARSING_TIME () {
        // Shall we display the parsing time and number of queries?
        // 1234                            5                      54    4         5              5       4    4                       5       543    3                   4432    2             33     2    2                              21
-       if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestParameterSet('frame'))) || (isInstallationPhase())) && (getScriptOutputMode() == '0') && ($GLOBALS['header_sent'] == 2)) {
+       if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestParameterSet('frame'))) || (isInstallationPhase())) && (isHtmlOutputMode()) && ($GLOBALS['header_sent'] == 2)) {
                // Then display it here
                displayParsingTime();
        } // END - if