You are here

function feeds_import_form_submit in Feeds 7

Same name and namespace in other branches
  1. 8.2 feeds.pages.inc \feeds_import_form_submit()
  2. 6 feeds.pages.inc \feeds_import_form_submit()
  3. 7.2 feeds.pages.inc \feeds_import_form_submit()

Submit handler for feeds_import_form().

File

./feeds.pages.inc, line 75
Menu callbacks, form callbacks and helpers.

Code

function feeds_import_form_submit($form, &$form_state) {

  // Save source and import.
  $source = feeds_source($form['#importer_id']);
  $source
    ->addConfig($form_state['values']['feeds']);
  $source
    ->save();

  // Refresh feed if import on create is selected.
  if ($source->importer->config['import_on_create']) {
    feeds_batch_set(t('Importing'), 'import', $form['#importer_id']);
  }

  // Add to schedule, make sure importer is scheduled, too.
  $source
    ->schedule();
  $source->importer
    ->schedule();
}