You are here

function apachesolr_multilingual_confgen_admin_form_validate in Apache Solr Multilingual 7

Same name and namespace in other branches
  1. 6.3 apachesolr_multilingual_confgen/apachesolr_multilingual_confgen.admin.inc \apachesolr_multilingual_confgen_admin_form_validate()

File

apachesolr_multilingual_confgen/apachesolr_multilingual_confgen.admin.inc, line 347
Admin settings for Apache Solr Multilingual.

Code

function apachesolr_multilingual_confgen_admin_form_validate($form, $form_state) {
  $length_min = $form_state['values']['apachesolr_multilingual_lengthMin_spell'];
  $length_max = $form_state['values']['apachesolr_multilingual_lengthMax_spell'];
  if (!ctype_digit($length_min)) {
    form_set_error('apachesolr_multilingual_lengthMin_spell', t('Minimum number of characters needs to be numeric.'));
  }
  if (!ctype_digit($length_max)) {
    form_set_error('apachesolr_multilingual_lengthMax_spell', t('Maximum number of characters needs to be numeric.'));
  }
  if ($length_min < 0 || $length_min > $length_max) {
    form_set_error('apachesolr_multilingual_lengthMax_spell', t('Minimum number of characters need to be less than maximum number of characters.'));
  }
}