You are here

function spaces_site_init in Spaces 6.2

Same name and namespace in other branches
  1. 6 spaces_site/spaces_site.module \spaces_site_init()

Implementation of hook_init().

File

spaces_site/spaces_site.module, line 158

Code

function spaces_site_init() {

  // Check that no space has already been initialized before
  // claiming the current space.
  $space = spaces_get_space();
  if (!$space) {
    context_set('spaces', 'sid', 1);
    $space = spaces_load('site', 1, TRUE);
    if (!$space) {
      $space = spaces_load('site', NULL, TRUE);
    }
    $space->sid = '1';
    spaces_set_space($space);
  }
}