You are here

function smart_paging_admin_settings_validate in Smart Paging 7

Same name and namespace in other branches
  1. 7.2 includes/smart_paging.admin.inc \smart_paging_admin_settings_validate()
1 string reference to 'smart_paging_admin_settings_validate'
smart_paging_admin_settings in includes/smart_paging.admin.inc
Smart Paging administration settings.

File

includes/smart_paging.admin.inc, line 113
Admin interface callbacks/handlers to configure Smart Paging.

Code

function smart_paging_admin_settings_validate($form, &$form_state) {
  if (strpos($form_state['values']['smart_paging_pagebreak'], '<') === FALSE || strpos($form_state['values']['smart_paging_pagebreak'], '>') != drupal_strlen($form_state['values']['smart_paging_pagebreak']) - 1) {
    form_set_error('smart_paging_pagebreak', t('Page break placeholder is not a valid HTML tag or comment.'));
  }
  if (!is_numeric($form_state['values']['smart_paging_character_count'])) {
    form_set_error('smart_paging_character_count', t('Character limit should be numeric value.'));
  }
  if (!is_numeric($form_state['values']['smart_paging_word_count'])) {
    form_set_error('smart_paging_word_count', t('Word limit should be numeric value.'));
  }
}