You are here

function prev_next_admin_validate in Previous/Next API 7.2

Same name and namespace in other branches
  1. 6 prev_next.module \prev_next_admin_validate()
  2. 7 prev_next.module \prev_next_admin_validate()

Validate callback.

File

./prev_next.admin.inc, line 150
Creates the administrative interface for previous next.

Code

function prev_next_admin_validate($form, &$form_state) {
  if ($form_state['values']['op'] == t('Re-index')) {
    drupal_goto('admin/config/system/prev_next/re-index');
  }

  // Max_nid is just a markup field and should not cause a variable to be set.
  unset($form_state['values']['max_nid']);

  // The variables must be non-negative and numeric.
  if (!is_numeric($form_state['values']['prev_next_batch_size']) || $form_state['values']['prev_next_batch_size'] <= 0) {
    form_set_error('prev_next_batch_size', t('The batch size must be a number and greater than zero.'));
  }
}