You are here

function privatemsg_delete_folder_form in Privatemsg 5

Same name and namespace in other branches
  1. 5.3 privatemsg.module \privatemsg_delete_folder_form()

Prompt to delete a folder and all its messages.

1 string reference to 'privatemsg_delete_folder_form'
privatemsg_menu in ./privatemsg.module
Implementation of hook_menu().

File

./privatemsg.module, line 1389

Code

function privatemsg_delete_folder_form($fid) {
  $folder = db_result(db_query("SELECT name FROM {privatemsg_folder} WHERE fid = %d", $fid));
  if (empty($folder)) {
    drupal_set_message(t('Folder does not exist.'));
    drupal_goto('privatemsg/folders');
  }
  $message = t('Are you sure you wish to delete %folder and all its messages?', array(
    '%folder' => $folder,
  ));
  $form = confirm_form(array(), t('Delete folder?'), 'privatemsg/folders', $message, t('Delete'), t('Cancel'), 'delete');
  return $form;
}