Rewrote reset and some extensions:
[mailer.git] / inc / wrapper-functions.php
index ad438537284caee8426dee8900fe0f69baef1b08..1ddfd1145b21ead490b752f6fae9532ab8c9154b 100644 (file)
@@ -389,10 +389,28 @@ function isHourlyResetEnabled () {
        return ((isset($GLOBALS['hourly_enabled'])) && ($GLOBALS['hourly_enabled'] === TRUE));
 }
 
-// Checks whether the reset mode is active
+// Checks whether the daily reset mode is active
+function isDailyResetEnabled () {
+       // Now simply check it
+       return ((isset($GLOBALS['daily_enabled'])) && ($GLOBALS['daily_enabled'] === TRUE));
+}
+
+// Checks whether the weekly reset mode is active
+function isWeeklyResetEnabled () {
+       // Now simply check it
+       return ((isset($GLOBALS['weekly_enabled'])) && ($GLOBALS['weekly_enabled'] === TRUE));
+}
+
+// Checks whether the monthly reset mode is active
+function isMonthlyResetEnabled () {
+       // Now simply check it
+       return ((isset($GLOBALS['monthly_enabled'])) && ($GLOBALS['monthly_enabled'] === TRUE));
+}
+
+// Checks whether one of the reset modes is enabled
 function isResetModeEnabled () {
        // Now simply check it
-       return ((isset($GLOBALS['reset_enabled'])) && ($GLOBALS['reset_enabled'] === TRUE));
+       return ((isHourlyResetEnabled()) || (isDailyResetEnabled()) || (isWeeklyResetEnabled()) || (isMonthlyResetEnabled()));
 }
 
 // Checks whether the debug mode is enabled
@@ -419,12 +437,36 @@ function isDebugHourlyEnabled () {
        return $GLOBALS[__FUNCTION__];
 }
 
-// Checks whether the debug reset is enabled
-function isDebugResetEnabled () {
+// Checks whether the debug daily is enabled
+function isDebugDailyEnabled () {
+       // Is cache set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Simply check it
+               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_DAILY')) && (getConfig('DEBUG_DAILY') == 'Y'));
+       } // END - if
+
+       // Return it
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks whether the debug weekly is enabled
+function isDebugWeeklyEnabled () {
+       // Is cache set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Simply check it
+               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_WEEKLY')) && (getConfig('DEBUG_WEEKLY') == 'Y'));
+       } // END - if
+
+       // Return it
+       return $GLOBALS[__FUNCTION__];
+}
+
+// Checks whether the debug monthly is enabled
+function isDebugMonthlyEnabled () {
        // Is cache set?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Simply check it
-               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_RESET')) && (getConfig('DEBUG_RESET') == 'Y'));
+               $GLOBALS[__FUNCTION__] = ((isConfigEntrySet('DEBUG_MONTHLY')) && (getConfig('DEBUG_MONTHLY') == 'Y'));
        } // END - if
 
        // Return it
@@ -2243,12 +2285,48 @@ function getAdminMenu () {
        return $GLOBALS[__FUNCTION__];
 }
 
-// "Getter" for last_month
-function getLastMonth () {
+// "Getter" for last_hourly
+function getLastHourly () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('last_hourly');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for last_daily
+function getLastDaily () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('last_daily');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for last_weekly
+function getLastWeekly () {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('last_weekly');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for last_monthly
+function getLastMonthly () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
-               $GLOBALS[__FUNCTION__] = getConfig('last_month');
+               $GLOBALS[__FUNCTION__] = getConfig('last_monthly');
        } // END - if
 
        // Return cache