You are here

function ad_text_global_settings_validate in Advertisement 6.2

Same name and namespace in other branches
  1. 5.2 text/ad_text.module \ad_text_global_settings_validate()
  2. 5 text/ad_text.module \ad_text_global_settings_validate()
  3. 6.3 text/ad_text.module \ad_text_global_settings_validate()
  4. 6 text/ad_text.module \ad_text_global_settings_validate()
  5. 7 text/ad_text.module \ad_text_global_settings_validate()

Settings form validation handler.

File

text/ad_text.module, line 170
Enhances the ad module to support static text ads.

Code

function ad_text_global_settings_validate($form, &$form_state) {
  if ((int) $form_state['values']['header_min'] > (int) $form_state['values']['header_max']) {
    form_set_error('header_min', t('The header minimum length can not be greater than the header maximum length.'));
  }
  if ((int) $form_state['values']['body_min'] > (int) $form_state['values']['body_max']) {
    form_set_error('body_min', t('The body minimum length can not be greater than the body maximum length.'));
  }
}