You are here

function node_import_js in Node import 6

JS callback to continue the specified task and returns the status of it. This function will take at most one second.

Parameters

$task: Full loaded $task.

Return value

JSON.

1 string reference to 'node_import_js'
node_import_menu in ./node_import.module
Implementation of hook_menu().

File

./node_import.inc, line 976
Public API of the Node import module.

Code

function node_import_js($task) {
  node_import_do_task($task, 'ms', 1000);
  echo drupal_json(array(
    'status' => 1,
    'message' => format_plural($task['row_done'], t('1 row imported'), t('@count rows imported')) . '<br />' . format_plural($task['row_error'], t('1 row with errors'), t('@count rows with errors')),
    'percentage' => $task['status'] == NODE_IMPORT_STATUS_DONE ? 100 : round(floor(100.0 * $task['file_offset'] / $task['file']->filesize), 0),
  ));
  exit;
}