You are here

function _widgets_cache_scope in Widgets 7

2 calls to _widgets_cache_scope()
widgets_get_cache_scope in ./widgets.module
widgets_set_cache_scope in ./widgets.module

File

./widgets.module, line 1062
Exposes global functionality for creating widget sets.

Code

function _widgets_cache_scope($name, $scope = NULL, $action = 'get') {
  static $cache_scope = array();
  if ($action == 'set') {
    if (!$cache_scope[$name][$scope]) {
      $cache_scope[$name][$scope] = array();
    }
    $cache_scope[$name][$scope] = TRUE;
  }
  elseif ($action == 'reset') {
    if ($cache_scope[$name][$scope]) {
      $cache_scope[$name][$scope] = FALSE;
    }
  }
  if (isset($cache_scope[$name])) {
    return $cache_scope[$name];
  }
  else {
    return FALSE;
  }
}