You are here

function spaces_set_space in Spaces 6.3

Same name and namespace in other branches
  1. 5.2 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.

Return value

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

3 calls to spaces_set_space()
spaces_get_space in ./spaces.module
Wrapper function around spaces_set_space(). Retrieves the current active space for a given space type.
spaces_init_space in ./spaces.module
Initialize a space and set it to be the current active space.
spaces_og_nodeapi in spaces_og/spaces_og.module
Implementation of hook_nodeapi().

File

./spaces.module, line 75

Code

function spaces_set_space($space = NULL) {
  static $active_space;
  if (isset($space)) {
    $active_space = $space;
    if ($active_space && module_exists('context') && ($plugin = context_get_plugin('condition', 'spaces_type'))) {
      $plugin
        ->execute($space);
    }
  }
  return isset($active_space) ? $active_space : FALSE;
}