You are here

function taxonomy_entity_index_admin_form_submit in Taxonomy Entity Index 7

Form submit handler for the batch reindexing form. Processes the batch.

See also

taxonomy_entity_index_admin_form()

taxonomy_entity_index_reindex()

taxonomy_entity_index_reindex_finished()

File

./taxonomy_entity_index.admin.inc, line 33

Code

function taxonomy_entity_index_admin_form_submit($form, &$form_state) {
  $types = array_filter($form_state['values']['types']);

  // Add an operation for each entity type.
  foreach ($types as $type) {
    $operations[] = array(
      'taxonomy_entity_index_reindex_entity_type',
      array(
        $type,
      ),
    );
  }

  // Set a batch operation for each selected entity type.
  $batch = array(
    'operations' => $operations,
    'finished' => 'taxonomy_entity_index_reindex_finished',
    'file' => drupal_get_path('module', 'taxonomy_entity_index') . '/taxonomy_entity_index.admin.inc',
  );

  // Execute the batch.
  batch_set($batch);
}