Same name and namespace in other branches
  1. 4.7.x modules/contact.module \contact_admin_edit()
  2. 5.x modules/contact/contact.module \contact_admin_edit()

Category edit page.

1 string reference to 'contact_admin_edit'
contact_menu in modules/contact/contact.module
Implementation of hook_menu().

File

modules/contact/contact.admin.inc, line 25
Admin page callbacks for the contact module.

Code

function contact_admin_edit($form_state = array(), $op, $contact = NULL) {
  if (empty($contact) || $op == 'add') {
    $contact = array(
      'category' => '',
      'recipients' => '',
      'reply' => '',
      'weight' => 0,
      'selected' => 0,
      'cid' => NULL,
    );
  }
  $form['contact_op'] = array(
    '#type' => 'value',
    '#value' => $op,
  );
  $form['category'] = array(
    '#type' => 'textfield',
    '#title' => t('Category'),
    '#maxlength' => 255,
    '#default_value' => $contact['category'],
    '#description' => t("Example: 'website feedback' or 'product information'."),
    '#required' => TRUE,
  );
  $form['recipients'] = array(
    '#type' => 'textarea',
    '#title' => t('Recipients'),
    '#default_value' => $contact['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' => $contact['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' => $contact['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' => $contact['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' => $contact['cid'],
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}