You are here

function joomla_batch_finished in Joomla to Drupal 7.2

1 string reference to 'joomla_batch_finished'
joomla_import_form_submit in ./joomla.module
Submit import form.

File

./joomla.batch.inc, line 541

Code

function joomla_batch_finished($success, $results, $operations) {
  if ($success) {
    drupal_set_message(t('Processed @users_total users (@users_new new, @users_duplicate duplicates, @users_updated updated, @users_failed errors)', array(
      '@users_total' => $results['accounts_total'],
      '@users_duplicate' => $results['accounts_duplicate'],
      '@users_new' => $results['accounts_new'],
      '@users_updated' => $results['accounts_updated'],
      '@users_failed' => $results['accounts_failed'],
    )));
    drupal_set_message(t('Processed @total sections (@new new, @updated updated, @failed errors)', array(
      '@total' => $results['sections_total'],
      '@new' => $results['sections_new'],
      '@updated' => $results['sections_updated'],
      '@failed' => $results['sections_failed'],
    )));
    drupal_set_message(t('Processed @total categories (@new new, @updated updated, @failed errors)', array(
      '@total' => $results['categories_total'],
      '@new' => $results['categories_new'],
      '@updated' => $results['categories_updated'],
      '@failed' => $results['categories_failed'],
    )));
    drupal_set_message(t('Processed @total content items (@new new, @updated updated, @failed errors)', array(
      '@total' => $results['content_total'],
      '@new' => $results['content_new'],
      '@updated' => $results['content_updated'],
      '@failed' => $results['content_failed'],
    )));
    drupal_set_message(t('Processed @total comments (@new new, @updated updated, @failed errors)', array(
      '@total' => $results['comments_total'],
      '@new' => $results['comments_new'],
      '@updated' => $results['comments_updated'],
      '@failed' => $results['comments_failed'],
    )));
  }
  else {
    $error_operation = reset($operations);
    $message = t('An error occurred while processing %error_operation with arguments: @arguments', array(
      '%error_operation' => $error_operation[0],
      '@arguments' => print_r($error_operation[1], TRUE),
    ));
    drupal_set_message($message, 'error');
  }
}