You are here

function oa_core_get_space_home_context in Open Atrium Core 7.2

Returns the current space id context Returns zero if on the site home page

Parameters

boolean $from_session only use the context stored in $SESSION:

Return value

int Space ID

File

includes/oa_core.util.inc, line 242
Code for Utility functions for OpenAtrium spaces

Code

function oa_core_get_space_home_context() {
  if (variable_get('install_task') !== 'done') {

    // don't run this during the installer
    return 0;
  }
  $space_id = oa_core_get_space_context();
  $node = menu_get_object();
  if (drupal_is_front_page() && !(isset($node) && $node->type == OA_SPACE_TYPE)) {
    return 0;

    // front page, not a space page
  }
  return $space_id;
}