You are here

function spaces_init_context in Spaces 5.2

Same name and namespace in other branches
  1. 5 spaces.module \spaces_init_context()
  2. 6 spaces.module \spaces_init_context()
  3. 6.2 spaces.module \spaces_init_context()

Context prefix provider callback.

1 string reference to 'spaces_init_context'
spaces_context_prefix_provider in ./spaces.module
Implementation of hook_context_prefix_provider().

File

./spaces.module, line 44

Code

function spaces_init_context($type, $sid) {
  static $once;
  if (!isset($once)) {
    $once = FALSE;
  }
  if (!$once) {

    // @TODO: remove the hardcoded space type here and attempt to
    // discover through the context prefix param : (
    context_set('spaces', 'sid', $sid);
    $space = spaces_load($type, $sid, TRUE);
    spaces_set_space($space);
    $once = TRUE;
  }
}