You are here

function spaces_set_space in Spaces 5.2

Same name and namespace in other branches
  1. 6.3 spaces.module \spaces_set_space()
  2. 6 spaces.module \spaces_set_space()
  3. 6.2 spaces.module \spaces_set_space()
  4. 7.3 spaces.module \spaces_set_space()
  5. 7 spaces.module \spaces_set_space()

Sets the specified space as the current active space. Returns the active space if no space is provided.

Parameters

$space: The space object to set as the active space. Optional.

$reset: Optional flag to reset the static cache.

Return value

The active space object or FALSE if there is no active space.

2 calls to spaces_set_space()
spaces_get_space in ./spaces.module
Wrapper function around spaces_set_space(). Retrieves the current active space.
spaces_init_context in ./spaces.module
Context prefix provider callback.

File

./spaces.module, line 863

Code

function spaces_set_space($space = NULL, $reset = FALSE) {
  static $current_space;
  if (!isset($current_space) || $reset) {
    $current_space = $space;
  }
  return $current_space ? $current_space : FALSE;
}