function og_context_entity_property_info

7.x-2.x og_context.module og_context_entity_property_info()
7.x-1.x og_context.module og_context_entity_property_info()

Implements hook_entity_property_info().

Add the current-group to the system token (i.e. like current-user).

File

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

Code

function og_context_entity_property_info() {
  $info = array();

  foreach (og_get_all_group_entity() as $entity_type => $label) {
    $params = array('@label' => $label);
    $properties = &$info['site']['properties'];
    $properties['og_context__' . $entity_type] = array(
      'label' => t('Current OG group of @label entity type', $params),
      'description' => t('The @label that is an OG group from context, if exists.', $params),
      'getter callback' => 'og_context_get_properties',
      'type' => $entity_type,
    );
  }

  return $info;
}