You are here

function word_link_exchange_import_form_submit in Word Link 7

Same name and namespace in other branches
  1. 8 modules/word_link_exchange/word_link_exchange.module \word_link_exchange_import_form_submit()
  2. 7.2 modules/word_link_exchange/word_link_exchange.module \word_link_exchange_import_form_submit()

Submit for word_link_exchange_import_form.

File

modules/word_link_exchange/word_link_exchange.module, line 228
Code for the Word link exchange module.

Code

function word_link_exchange_import_form_submit($form, &$form_state) {
  $operations = array();

  // Set batch operation when import from file.
  if (!empty($form_state['values']['file'])) {
    $operations[] = array(
      'word_link_exchange_import_from_file',
      array(
        $form_state['values']['file'],
        $form_state['values']['update'],
      ),
    );
  }

  // Set batch operation when import from taxonomy.
  if (!empty($form_state['values']['vocabularies'])) {
    foreach ($form_state['values']['vocabularies'] as $vid) {
      $operations[] = array(
        'word_link_exchange_import_from_taxonomy',
        array(
          $vid,
          $form_state['values']['import_limit'],
        ),
      );
    }
  }
  $batch = array(
    'title' => t('Importing links...'),
    'operations' => $operations,
    'finished' => 'word_link_exchange_import_batch_finish',
  );
  batch_set($batch);
}