You are here

function taxonomy_term_depth_batch_depth_update_form_submit in Taxonomy Term Depth 7

File

./taxonomy_term_depth.batch.inc, line 23

Code

function taxonomy_term_depth_batch_depth_update_form_submit($form, &$form_state) {
  $identity = isset($form_state['triggering_element']['#identity']) ? $form_state['triggering_element']['#identity'] : 'unknown';
  $options = array();
  switch ($identity) {
    case 'btn_rebuild_all':
      batch_set(array(
        'operations' => array(
          array(
            'taxonomy_term_depth_batch_callbacks_update_term_depth',
            array(
              $options,
            ),
          ),
        ),
        'title' => t('Updating depths for all terms'),
        'file' => TAXONOMY_TERM_DEPTH_ROOT_REL . '/taxonomy_term_depth.batch.inc',
      ));
      break;
    default:
      drupal_set_message(t('Wrong operation selected'));
  }
}