Missing function CACHE_PURGE_ADMIN_MENU() added (stub)
[mailer.git] / inc / functions.php
index 44fdf95282a4dbaeeb6d67974b1420ba5e968137..533e824c60ed1327130ef6161141f9dcc89eaf06 100644 (file)
@@ -207,11 +207,8 @@ function LOAD_TEMPLATE($template, $return=false, $content="") {
        $_CONFIG['num_templates']++;
 
        // Init some data
-       $ACTION = SQL_ESCAPE($GLOBALS['action']);
-       $WHAT = SQL_ESCAPE($GLOBALS['what']);
        $ret = "";
        if (empty($GLOBALS['refid'])) $GLOBALS['refid'] = 0;
-       $REFID = $GLOBALS['refid'];
 
        // @DEPRECATED Try to remove this if() block
        if ($template == "member_support_form") {
@@ -2239,13 +2236,21 @@ function isSessionVariableSet($var) {
 }
 // Returns wether the value of the session variable or NULL if not set
 function get_session($var) {
+       global $cacheArray;
+
        // Default is not found! ;-)
        $value = null;
 
-       // Is the variable there?
-       if (isSessionVariableSet($var)) {
+       // Is the variable there or cached values?
+       if (isset($cacheArray['session'][$var])) {
+               // Get cached value (skips a lot SQL_ESCAPE() calles!
+               $value = $cacheArray['session'][$var];
+       } elseif (isSessionVariableSet($var)) {
                // Then  get it secured!
                $value = SQL_ESCAPE($_SESSION[$var]);
+
+               // Cache the value
+               $cacheArray['session'][$var] = $value;
        } // END - if
 
        // Return the value
@@ -2510,6 +2515,26 @@ function REBUILD_CACHE ($cache, $inc="") {
                } // END - if
        } // END - if
 }
+// Purge admin menu cache
+function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") {
+       global $_CONFIG, $cacheInstance;
+
+       // Is the cache extension enabled or no cache instance or admin menu cache disabled?
+       if (!EXT_IS_ACTIVE("cache")) {
+               // Cache extension not active
+               return false;
+       } elseif (!is_object($cacheInstance)) {
+               // No cache instance!
+               DEBUG_LOG(__FUNCTION__.": No cache instance found.");
+               return false;
+       } elseif ((!isset($_CONFIG['cache_admin_menu'])) || ($_CONFIG['cache_admin_menu'] == "N")) {
+               // Caching disabled (currently experiemental!)
+               return false;
+       }
+
+       // Experiemental feature!
+       trigger_error("You have to delete the admin_*.cache files by yourself at this point.");
+}
 //
 //////////////////////////////////////////////////
 //                                              //