You are here

function taxonomy_edge_rebuild_page_confirm_submit in Taxonomy Edge 7

Same name and namespace in other branches
  1. 8 taxonomy_edge.admin.inc \taxonomy_edge_rebuild_page_confirm_submit()
  2. 6 taxonomy_edge.admin.inc \taxonomy_edge_rebuild_page_confirm_submit()
  3. 7.2 taxonomy_edge.admin.inc \taxonomy_edge_rebuild_page_confirm_submit()

Submit callback; rebuild tree.

File

./taxonomy_edge.admin.inc, line 129
Pages for taxonomy edge settings and more.

Code

function taxonomy_edge_rebuild_page_confirm_submit($form, &$form_state) {
  $form_state['redirect'] = 'admin/structure/taxonomy';
  module_load_include('rebuild.inc', 'taxonomy_edge');
  if (!empty($form_state['values']['vocabulary']->vid)) {
    $vids = array(
      $form_state['values']['vocabulary']->vid,
    );
  }
  else {
    $vocabularies = taxonomy_get_vocabularies();
    foreach ($vocabularies as $vocabulary) {
      $vids[] = $vocabulary->vid;
    }
  }
  switch ($form_state['values']['type']) {
    case 'edges':
      return taxonomy_edge_rebuild_edges_batch($vids);
    case 'order':
      return taxonomy_edge_rebuild_order_batch($vids);
    case 'all':
      return taxonomy_edge_rebuild_all_batch($vids);
  }
}