You are here

function mass_contact_taxonomy_admin_edit_validate in Mass Contact 7

Category add/edit form validation callback.

Sets the form error and returns, whether selection is empty or not.

Parameters

array $form: A nested array of form elements that comprise the form.

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

Return value

bool Indicates whether a validation error has occurred or not.

1 string reference to 'mass_contact_taxonomy_admin_edit_validate'
mass_contact_taxonomy.inc in plugins/mass_contact_taxonomy.inc

File

plugins/mass_contact_taxonomy.inc, line 187

Code

function mass_contact_taxonomy_admin_edit_validate(array $form, array &$form_state) {
  if (!empty($form_state['values']['recipients']['mass_contact_taxonomy'])) {
    foreach ($form_state['values']['recipients']['mass_contact_taxonomy'] as $term_values) {
      $term_values_filtered = array_filter($term_values);
      if (!empty($term_values_filtered)) {
        return FALSE;
      }
    }
  }
  return TRUE;
}