You are here

function media_import_submit in D7 Media 7

Submit handler for media_import().

File

includes/media.admin.inc, line 492
This file contains the admin functions for the Media module.

Code

function media_import_submit($form, &$form_state) {
  if ($form_state['values']['op'] == t('Confirm')) {
    $files = $form_state['storage']['files'];
    $batch = array(
      'title' => t('Importing'),
      'operations' => array(
        array(
          'media_import_batch_import_files',
          array(
            $files,
          ),
        ),
      ),
      'finished' => 'media_import_batch_import_complete',
      'file' => drupal_get_path('module', 'media') . '/includes/media.admin.inc',
    );
    batch_set($batch);
    return;
  }
  $form_state['rebuild'] = TRUE;
}