You are here

function _smart_paging_settings_validate in Smart Paging 7.2

Same name and namespace in other branches
  1. 7 smart_paging.module \_smart_paging_settings_validate()

Smart Paging settings validation handler.

1 string reference to '_smart_paging_settings_validate'
smart_paging_form_alter in ./smart_paging.module
Implements hook_form_alter()

File

./smart_paging.module, line 355
Provides smart paging capability to Drupal contents.

Code

function _smart_paging_settings_validate($form, &$form_state) {
  if (isset($form_state['values']['smart_paging_pagebreak']) && (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 (isset($form_state['values']['smart_paging_character_count']) && !is_numeric($form_state['values']['smart_paging_character_count'])) {
    form_set_error('smart_paging_character_count', t('Character limit should be numeric value.'));
  }
  if (isset($form_state['values']['smart_paging_word_count']) && !is_numeric($form_state['values']['smart_paging_word_count'])) {
    form_set_error('smart_paging_word_count', t('Word limit should be numeric value.'));
  }
}