You are here

function prev_next_admin_validate in Previous/Next API 6

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

Validate callback.

File

./prev_next.module, line 155

Code

function prev_next_admin_validate($form, &$form_state) {
  if ($form_state['values']['op'] == t('Re-index')) {
    drupal_goto('admin/settings/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.'));
  }
}