You are here

function hook_group_member_operation_links in Group 7

Add group member operation links.

This hook enables modules to inject custom operations into the operations column of the table found at group/%/members by associating a callback function with the operation, which is called when the form is submitted.

The callback function receives the GroupMembership of the table row and should return an array of links to display in the operations column.

Parameters

GroupMembership $group_membership: The membership to format links for.

Return value

array An array of links, declared as in theme_links(). At the very least, the 'title' and 'href' keys should be defined.

See also

group_members_form()

theme_links()

1 function implements hook_group_member_operation_links()

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

group_group_member_operation_links in ./group.group.inc
Implements hook_group_member_operation_links().
1 invocation of hook_group_member_operation_links()
group_members_form in admin/group_membership.inc
Builds the group member overview table.

File

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

Code

function hook_group_member_operation_links(GroupMembership $group_membership) {
  $operations = array();

  // Add membership management links.
  if (group_access('administer members', group_load($group_membership->gid))) {
    $operations['edit-membership'] = array(
      'title' => t('edit'),
      'href' => 'group/member/' . $group_membership->mid . '/edit',
    );
    $operations['cancel-membership'] = array(
      'title' => t('cancel'),
      'href' => 'group/member/' . $group_membership->mid . '/cancel',
    );
  }
  return $operations;
}