function og_context_add_js

7.x-2.x og_context.module og_context_add_js($context)
7.x-1.x og_context.module og_context_add_js($group)

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

Parameters

$context: The context array.

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

File

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

Code

function og_context_add_js($context) {
  // Static variable to indicate if group was already added to javascript.
  $js = &drupal_static(__FUNCTION__, FALSE);

  if (!$js) {
    drupal_add_js(array('ogContext' => array('groupType' => $context['group_type'], 'gid' => $context['gid'])), 'setting');
    $js = TRUE;
  }
}