You are here

function og_context_entity_property_info in Organic groups 7.2

Same name and namespace in other branches
  1. 7 og_context/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_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;
}