You are here

function privatemsg_rename_folder_form in Privatemsg 5.3

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

Display form to rename a folder.

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

File

./privatemsg.module, line 1275

Code

function privatemsg_rename_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');
  }
  $form['old_name'] = array(
    '#type' => 'hidden',
    '#value' => $folder,
  );
  $form['new_name'] = array(
    '#type' => 'textfield',
    '#title' => t('New folder name'),
    '#size' => 24,
    '#maxlength' => 64,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Rename folder'),
    '#prefix' => '<div class="container-inline">',
    '#suffix' => l(t('Cancel'), 'privatemsg/folders') . '</div>',
  );
  return $form;
}