You are here

function _node_import_autodetect_file_format in Node import 5

Returns an autodetected file format or '' if none found.

1 call to _node_import_autodetect_file_format()
_node_import_start_validate in ./node_import.module

File

./node_import.module, line 779
This modules provides a wizard at "administer >> content >> import" to import a CSV file with nodes.

Code

function _node_import_autodetect_file_format($filepath) {
  $format = '';
  foreach (_node_import_get_file_formats() as $function => $title) {
    if (function_exists($function)) {
      $row = $function($filepath, TRUE);
      if (count($row) > 1) {
        $format = $function;
        break;
      }
    }
  }
  return $format;
}