You are here

function media_page_delete in D7 Media 7

Menu callback; shows delete confirmation form.

1 string reference to 'media_page_delete'
media_menu in ./media.module
Implement of hook_menu().

File

includes/media.pages.inc, line 66
Common pages for the Media module.

Code

function media_page_delete($file) {
  drupal_set_title(t('<em>Delete @type</em> @title', array(
    '@type' => $file->type != FILE_TYPE_NONE ? $file->type : '',
    '@title' => $file->filename,
  )), PASS_THROUGH);

  // Don't bother showing the form if the item is in use, since we won't allow
  // them to delete it anyway.
  $references = file_usage_list($file);
  if (!empty($references)) {
    return t('The file %title is in use and cannot be deleted.', array(
      '%title' => $file->filename,
    ));
  }
  else {
    $files = array(
      $file->fid => $file,
    );
    return drupal_get_form('media_multiple_delete_confirm', $files, '<front>', 'media/' . $file->fid);
  }
}