You are here

function og_panels_context_create_group in Organic groups 5.7

Same name and namespace in other branches
  1. 5.8 includes/groupcontext.inc \og_panels_context_create_group()
  2. 5 includes/groupcontext.inc \og_panels_context_create_group()
  3. 5.3 includes/groupcontext.inc \og_panels_context_create_group()
  4. 6 includes/og.panelscontext.inc \og_panels_context_create_group()

It's important to remember that $conf is optional here, because contexts are not always created from the UI.

1 string reference to 'og_panels_context_create_group'
og_panels_panels_contexts in ./og_panels.module
Implementation of hook_panels_contexts()

File

includes/groupcontext.inc, line 12
contexts/group.inc

Code

function og_panels_context_create_group($empty, $data = NULL, $conf = FALSE) {
  $context = new panels_context('group');
  $context->plugin = 'group';
  if ($empty) {
    return $context;
  }
  if ($conf) {
    $data = node_load($data['nid']);
  }
  if (!empty($data)) {
    og_set_group_context($data);
    $context->data = $data;
    $context->title = $data->title;
    $context->argument = $data->nid;
    return $context;
  }
}