You are here

function hook_group_membership_profile_info in Group 7

Provide information about group membership profiles exposed by your module.

Group membership profiles will show up on the admin/group/member overview page and are expected to be bundles or pseudo-bundles for group memberships.

An example of a pseudo-bundle is the Profile2 module for users: It doesn't really add bundles to a user, but in a way it still allows you to attach fields to a user. Same goes for the Group member profiles (gprofile) module.

This hook only facilitates the showing of your extra GroupMembership bundles in a coherent admin UI. All functionality regarding bundles should still be taken care of by the implementing module.

Return value

array An array of profiles (membership bundles), keyed by their machine name with each entry having the following keys:

  • label: The human readable label for the membership profile.
  • entity status: The status for the entity as defined by Entity API. If your profile isn't an entity, set this to ENTITY_IN_CODE if it should not be edited or ENTITY_CUSTOM if it is editable.
  • path: The administration path for the profile. This is where the 'edit' link will point to in the overview. All other paths, such as 'delete' will be derived from this path.
1 function implements hook_group_membership_profile_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

gprofile_group_membership_profile_info in modules/gprofile/gprofile.group.inc
Implements hook_group_membership_profile_info().
1 invocation of hook_group_membership_profile_info()
group_membership_profile_info in helpers/group.inc
Get the group membership profile information.

File

./group.api.php, line 484
Hooks provided by the Group module.

Code

function hook_group_membership_profile_info() {
  $profiles['special'] = array(
    'label' => t('Special profile'),
    'entity status' => ENTITY_FIXED,
    'path' => 'admin/group/member/mymodule/myprofile',
  );
  return $profiles;
}