You are here

function opigno_simple_ui_remove_member_confirm in Opigno 7

Confirmation form for deleting an OG membership.

1 string reference to 'opigno_simple_ui_remove_member_confirm'
opigno_simple_ui_og_menu in modules/simple_ui/includes/opigno_simple_ui.og.inc
Implements hook_menu().

File

modules/simple_ui/includes/opigno_simple_ui.og.inc, line 193
OG specific enhancements.

Code

function opigno_simple_ui_remove_member_confirm($form, $form_state, $gid, $og_membership_id) {
  $og_membership = og_membership_load($og_membership_id);
  $entity = current(entity_load($og_membership->entity_type, array(
    $og_membership->etid,
  )));
  $form['og_membership_id'] = array(
    '#type' => 'value',
    '#value' => $og_membership_id,
  );
  $form['gid'] = array(
    '#type' => 'value',
    '#value' => $gid,
  );

  // @todo - we process the entity as a user (hence $entity->name), but this is a bit restrictive.
  $form['entity'] = array(
    '#type' => 'value',
    '#value' => $entity->name,
  );
  return confirm_form($form, t("Are you sure you want to remove %entity from this group ?", array(
    '%entity' => $entity->name,
  )), "node/{$gid}/group");
}