You are here

function group_membership_multiple_delete_confirm in Group 7

Multiple group membership deletion confirmation form.

2 string references to 'group_membership_multiple_delete_confirm'
group_group_member_operations in ./group.group.inc
Implements hook_group_member_operations().
hook_group_member_operations in ./group.api.php
Add mass group member operations.

File

admin/group_membership.inc, line 338
Group membership overview admin UI.

Code

function group_membership_multiple_delete_confirm($form, &$form_state, $mids) {
  $form['#submit'][] = 'group_membership_multiple_delete_confirm_submit';
  $form['members'] = array(
    '#prefix' => '<ul>',
    '#suffix' => '</ul>',
    '#tree' => TRUE,
  );
  foreach (group_membership_load_multiple($mids) as $mid => $group_membership) {
    $wrapper = entity_metadata_wrapper('group_membership', $group_membership);
    if (!isset($gid)) {
      $gid = $group_membership->gid;
    }
    $form['members'][$mid] = array(
      '#type' => 'hidden',
      '#value' => $mid,
      '#prefix' => '<li>',
      '#suffix' => $wrapper->user
        ->label() . "</li>\n",
    );
  }
  $question = format_plural(count($mids), 'Are you sure you want to remove this member?', 'Are you sure you want to remove these members?');
  return confirm_form($form, $question, "group/{$gid}/members", NULL, t('remove'));
}