You are here

function eck__entity__delete_form in Entity Construction Kit (ECK) 7.3

Same name and namespace in other branches
  1. 7 eck.entity.inc \eck__entity__delete_form()
  2. 7.2 eck.entity.inc \eck__entity__delete_form()

Entity delete form.

1 string reference to 'eck__entity__delete_form'
eck__entity__delete in ./eck.entity.inc
Callback function for the delete functionality.

File

./eck.entity.inc, line 316
All the menus, pages, and functionality related to administering entities.

Code

function eck__entity__delete_form($form, &$form_state, $entity_type, $bundle, $entity) {
  $path = eck__entity_type__path();
  $form['entity'] = array(
    '#type' => 'value',
    '#value' => $entity,
  );
  $form['entity_type'] = array(
    '#type' => 'value',
    '#value' => $entity_type,
  );
  $form['bundle'] = array(
    '#type' => 'value',
    '#value' => $bundle,
  );
  $form['submit_redirect'] = array(
    '#type' => 'value',
    '#value' => "{$path}/{$entity_type->name}/{$bundle->name}",
  );
  $message = t("Are you sure that you want to delete %id", array(
    "%id" => $entity->id,
  ));
  $caption = t("This action cannot be undone.");
  return confirm_form($form, $message, "{$path}/{$entity_type->name}", $caption, t('Delete'));
}