You are here

function commerce_file_license_delete_form_submit in Commerce File 7

Submit callback for commerce_file_license_delete_form().

1 string reference to 'commerce_file_license_delete_form_submit'
commerce_file_license_delete_form in includes/commerce_file_license.forms.inc
Form callback: confirmation form for deleting a license.

File

includes/commerce_file_license.forms.inc, line 394
Forms for creating / editing, deleting, issuing licenses

Code

function commerce_file_license_delete_form_submit($form, &$form_state) {
  $entity = $form_state[COMMERCE_FILE_LICENSE_ENTITY_NAME];
  $tokens = array(
    '@filename' => $entity->file['filename'],
    '@owner_name' => $entity->owner->name,
  );
  if ($entity
    ->delete()) {
    drupal_set_message(t('The file license has been deleted for @filename owned by @owner_name.', $tokens));
  }
  else {
    drupal_set_message(t('The file license could not be deleted for @filename owned by @owner_name.', $tokens), 'error');
  }
}