You are here

function group_membership_metadata in Group 7

Generates a group membership's metadata page.

Parameters

GroupMembership $group_membership: The group membership object.

Return value

array A render array suitable for use by drupal_render().

2 string references to 'group_membership_metadata'
GroupMembershipUIController::hook_menu in classes/group_membership.ui_controller.inc
Provides definitions for implementing hook_menu().
group_hook_info in ./group.module
Implements hook_hook_info().

File

pages/group_membership.inc, line 51
Page functions for group memberships.

Code

function group_membership_metadata(GroupMembership $group_membership) {
  $rows = array();

  // Loop over entries manually to keep indexes from messing things up.
  foreach (module_invoke_all('group_membership_metadata', $group_membership) as $metadata) {
    $rows[] = array(
      $metadata['description'],
      $metadata['value'],
    );
  }
  $table = array(
    '#theme' => 'table',
    '#header' => array(
      'description' => t('Description'),
      'value' => t('Value'),
    ),
    '#rows' => $rows,
    '#empty' => t('No metadata could be retrieved for this member'),
  );
  return $table;
}