You are here

function popup_cache_attributes in Popup 7

Same name and namespace in other branches
  1. 8 includes/popup.util.inc \popup_cache_attributes()
  2. 7.x includes/popup.util.inc \popup_cache_attributes()
2 calls to popup_cache_attributes()
popup_get_ahah in includes/popup.util.inc
theme_popup_ahah_placeholder in includes/popup.theme.inc

File

includes/popup.util.inc, line 415

Code

function popup_cache_attributes($cache) {
  if (is_array($cache)) {
    $hash = md5(serialize($cache));
    cache_set($hash, $cache, 'cache', time() + 360000);
    return $hash;
  }
  else {
    $cached = cache_get($cache);
    return $cached ? $cached->data : FALSE;
  }
}