You are here

function og_context_get_properties in Organic groups 7

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

Property getter callback.

1 string reference to 'og_context_get_properties'
og_context_entity_property_info in og_context/og_context.module
Implements hook_entity_property_info().

File

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

Code

function og_context_get_properties($data = array(), array $options, $name, $type) {
  switch ($name) {
    case 'current_group':

      // Get the current group.
      // @code
      //   $wrapper = entity_metadata_site_wrapper();
      //   wrapper->current_group->value()
      // @endcode
      return ($group = og_context()) ? $group : NULL;
  }
}