You are here

function prev_next_admin_submit in Previous/Next API 7.2

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

Submit callback.

1 string reference to 'prev_next_admin_submit'
prev_next_admin in ./prev_next.admin.inc
Menu callback argument. Creates the prev_next administration form.

File

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

Code

function prev_next_admin_submit($form, &$form_state) {
  $rebuild = FALSE;

  // Test sensitive values.
  foreach (node_type_get_types() as $type => $name) {
    if ($form_state['values'][PREV_NEXT_NODE_TYPE . $type . '_current'] != $form_state['values'][PREV_NEXT_NODE_TYPE . $type] || $form_state['values'][PREV_NEXT_NODE_TYPE . $type . '_indexing_criteria_current'] != $form_state['values'][PREV_NEXT_NODE_TYPE . $type . '_indexing_criteria'] || $form_state['values'][PREV_NEXT_NODE_TYPE . $type . '_same_type_current'] != $form_state['values'][PREV_NEXT_NODE_TYPE . $type . '_same_type'] || isset($form_state['values'][PREV_NEXT_NODE_TYPE . $type . '_category_criteria']) && $form_state['values'][PREV_NEXT_NODE_TYPE . $type . '_category_criteria_current'] != $form_state['values'][PREV_NEXT_NODE_TYPE . $type . '_category_criteria']) {
      $rebuild = TRUE;
    }
  }

  // If the search criterias has been changed, re-index.
  if ($rebuild) {
    prev_next_reindex();
    drupal_set_message(t('The Prev/Next index will be rebuilt.'));
  }
  $form_state['redirect'] = 'admin/config/system/prev_next';
}