You are here

function node_import_load in Node import 6

Load an import task by id. Used in hook_menu().

Parameters

$taskid: Integer.

Return value

FALSE or the task object.

Related topics

File

./node_import.module, line 137
Let users import content from CSV or TSV file.

Code

function node_import_load($taskid) {
  if (isset($taskid)) {
    $values = db_fetch_array(db_query("SELECT * FROM {node_import_tasks} WHERE taskid = %d", $taskid));
    if ($values !== FALSE) {
      foreach (array(
        'file_options',
        'headers',
        'map',
        'defaults',
        'options',
      ) as $key) {
        $values[$key] = unserialize($values[$key]);
      }
      $values['file'] = db_fetch_object(db_query("SELECT * FROM {files} WHERE fid = %d", $values['fid']));
      module_invoke_all('node_import_task', $values, 'load');
      return $values;
    }
  }
  return FALSE;
}