You are here

function og_set_group_context in Organic groups 6

Same name and namespace in other branches
  1. 5.8 og.module \og_set_group_context()
  2. 5 og.module \og_set_group_context()
  3. 5.2 og.module \og_set_group_context()
  4. 5.3 og.module \og_set_group_context()
  5. 5.7 og.module \og_set_group_context()
  6. 6.2 og.module \og_set_group_context()

API function; Set the group context for the current request. Modules may set this as needed. This context is originally set during og_determine_context().

Parameters

$node: The group node object that should be set as the context. You can use og_determine_context_get_group() to assist you with finding the appropriate group node.

Return value

The group node object if set.

5 calls to og_set_group_context()
og_get_group_context in ./og.module
API function for getting the group context (if any) for the current request. Used for things like setting current theme and breadcrumbs. This context is set during og_determine_context().
og_init in ./og.module
og_panels_context_create_group in includes/og.panelscontext.inc
It's important to remember that $conf is optional here, because contexts are not always created from the UI.
og_views_handler_argument_og_group_nid::query in modules/og_views/includes/og_views_handler_argument_og_group_nid.inc
og_views_handler_filter_og_group_nid::query in modules/og_views/includes/og_views_handler_filter_og_group_nid.inc

File

./og.module, line 563

Code

function og_set_group_context($node = NULL) {
  static $stored_group_node;
  if (!empty($node) && og_is_group_type($node->type)) {
    $stored_group_node = $node;
  }
  return !empty($stored_group_node) ? $stored_group_node : NULL;
}