You are here

function og_context_add_js in Organic groups 7

Same name and namespace in other branches
  1. 7.2 og_context/og_context.module \og_context_add_js()

Add the group entity of the context to the Drupal javascript entity.

Parameters

$group: A group entity.

1 call to og_context_add_js()
og_context_preprocess_html in og_context/og_context.module
Implement hook_preprocess_html().

File

og_context/og_context.module, line 327
Get a group from a viewed page.

Code

function og_context_add_js($group) {

  // Static variable to indicate if group was already added to javascript.
  $js =& drupal_static(__FUNCTION__, FALSE);
  if (empty($js)) {
    drupal_add_js(array(
      'og' => array(
        'og_context' => $group,
      ),
    ), 'setting');
    $js = TRUE;
  }
}