contact_admin_edit

5 contact.module contact_admin_edit($cid = NULL)
6 contact.admin.inc contact_admin_edit($form_state = array(), $op, $contact = NULL)

Category edit page.

1 string reference to 'contact_admin_edit'

File

modules/contact/contact.module, line 157
Enables the use of personal and site-wide contact forms.

Code

function contact_admin_edit($cid = NULL) {
  if (arg(3) == "edit" && $cid > 0) {
    $edit = db_fetch_array(db_query("SELECT * FROM {contact} WHERE cid = %d", $cid));
  }
  $form['category'] = array(
    '#type' => 'textfield', 
    '#title' => t('Category'), 
    '#maxlength' => 255, 
    '#default_value' => $edit['category'], 
    '#description' => t("Example: 'website feedback' or 'product information'."), 
    '#required' => TRUE,
  );
  $form['recipients'] = array(
    '#type' => 'textarea', 
    '#title' => t('Recipients'), 
    '#default_value' => $edit['recipients'], 
    '#description' => t("Example: 'webmaster@example.com' or 'sales@example.com,support@example.com'. To specify multiple recipients, separate each e-mail address with a comma."), 
    '#required' => TRUE,
  );
  $form['reply'] = array(
    '#type' => 'textarea', 
    '#title' => t('Auto-reply'), 
    '#default_value' => $edit['reply'], 
    '#description' => t('Optional auto-reply. Leave empty if you do not want to send the user an auto-reply message.'),
  );
  $form['weight'] = array(
    '#type' => 'weight', 
    '#title' => t('Weight'), 
    '#default_value' => $edit['weight'], 
    '#description' => t('When listing categories, those with lighter (smaller) weights get listed before categories with heavier (larger) weights. Categories with equal weights are sorted alphabetically.'),
  );
  $form['selected'] = array(
    '#type' => 'select', 
    '#title' => t('Selected'), 
    '#options' => array(
      '0' => t('No'),
      '1' => t('Yes'),
    ), 
    '#default_value' => $edit['selected'], 
    '#description' => t('Set this to <em>Yes</em> if you would like this category to be selected by default.'),
  );
  $form['cid'] = array(
    '#type' => 'value', 
    '#value' => $edit['cid'],
  );
  $form['submit'] = array(
    '#type' => 'submit', 
    '#value' => t('Submit'),
  );

  return $form;
}
Login or register to post comments