You are here

function privatemsg_empty_folder_form in Privatemsg 5.3

Same name and namespace in other branches
  1. 5 privatemsg.module \privatemsg_empty_folder_form()

Prompt to delete all the messages in a folder.

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

File

./privatemsg.module, line 1331

Code

function privatemsg_empty_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 want to delete every message in %folder?', array(
    '%folder' => $folder,
  ));
  $form = confirm_form(array(), t('Empty folder?'), 'privatemsg/folders', $message, t('Empty'), t('Cancel'), 'empty');
  return $form;
}