function spaces_set_space in Spaces 6.2
Same name and namespace in other branches
- 5.2 spaces.module \spaces_set_space()
- 6.3 spaces.module \spaces_set_space()
- 6 spaces.module \spaces_set_space()
- 7.3 spaces.module \spaces_set_space()
- 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.
4 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.
- spaces_site_init in spaces_site/
spaces_site.module - Implementation of hook_init().
- space_setting_home::form in ./
spaces.spaces.inc
File
- ./
spaces.module, line 900
Code
function spaces_set_space($space = NULL, $reset = FALSE) {
static $current_space;
if (!isset($current_space) || $reset) {
$current_space = $space;
if ($space) {
// Context integration with spaces_type setter.
context_set_by_condition('spaces_type', $space->type);
}
}
return is_object($current_space) ? $current_space : FALSE;
}