You are here

function joomla_import_form_submit in Joomla to Drupal 7.2

Same name and namespace in other branches
  1. 6 joomla.module \joomla_import_form_submit()
  2. 7 joomla.module \joomla_import_form_submit()

Submit import form.

File

./joomla.module, line 321
The joomla module used for migrate Joomla to Drupal.

Code

function joomla_import_form_submit($form, &$form_state) {
  $joomla_update_duplicate = (bool) $form_state['values']['joomla_update_duplicate'];
  $jos = array();
  $jos['users'] = (bool) $form_state['values']['joomla_import_users'];
  $jos['comments'] = (bool) $form_state['values']['joomla_import_comments'];
  $jos['categories'] = (bool) $form_state['values']['joomla_import_categories'];
  $jos['content'] = (bool) $form_state['values']['joomla_import_content'];
  $op = !empty($jos) ? array(
    'joomla_batch_save',
    array(
      $jos,
      $joomla_update_duplicate,
    ),
  ) : NULL;
  db_set_active();
  $batch = array(
    'title' => t('Importing'),
    'operations' => array(
      $op,
    ),
    'progress_message' => t('Importing joomla content, please be patient...'),
    'finished' => 'joomla_batch_finished',
    'file' => drupal_get_path('module', 'joomla') . '/joomla.batch.inc',
  );
  batch_set($batch);
}