You are here

function farm_asset_delete_form in farmOS 7

Delete confirmation form.

Parameters

array $form: The form array.

array $form_state: The form state array.

FarmAsset $farm_asset: The farm asset entity.

Return value

array Returns a form array.

2 string references to 'farm_asset_delete_form'
farm_asset_menu in modules/farm/farm_asset/farm_asset.module
Implements hook_menu().
farm_constraint_form_alter in modules/farm/farm_constraint/farm_constraint.module
Implements hook_form_alter().

File

modules/farm/farm_asset/farm_asset.pages.inc, line 232
Farm asset pages.

Code

function farm_asset_delete_form(array $form, array &$form_state, FarmAsset $farm_asset) {
  $form['farm_asset'] = array(
    '#type' => 'value',
    '#value' => $farm_asset,
  );

  // Always provide entity id in the same form key as in the entity edit form.
  $form['farm_asset_type_id'] = array(
    '#type' => 'value',
    '#value' => entity_id('farm_asset', $farm_asset),
  );
  $farm_asset_uri = entity_uri('farm_asset', $farm_asset);
  return confirm_form($form, t('Are you sure you want to delete %title?', array(
    '%title' => entity_label('farm_asset', $farm_asset),
  )), $farm_asset_uri['path'], t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}