You are here

function mass_contact_admin_settings_header_validate in Mass Contact 7

Same name and namespace in other branches
  1. 6 mass_contact.module \mass_contact_admin_settings_header_validate()

Validates the message header administration settings form.

Parameters

array $form: An associative array containing the structure of the form.

array $form_state: A keyed array containing the current state of the form.

File

./mass_contact.admin.inc, line 471
The administrative settings pages.

Code

function mass_contact_admin_settings_header_validate(array $form, array &$form_state) {
  if (!empty($form_state['values']['mass_contact_default_sender_name'])) {
    if (empty($form_state['values']['mass_contact_default_sender_email'])) {
      form_set_error('mass_contact_default_sender_email', t('If you are going to specify default user settings, you must specify both a user name and a user email address.'));
    }
  }
  if (!empty($form_state['values']['mass_contact_default_sender_email'])) {
    if (empty($form_state['values']['mass_contact_default_sender_name'])) {
      form_set_error('mass_contact_default_sender_name', t('If you are going to specify default user settings, you must specify both a user name and a user email address.'));
    }
  }
}