Index: supported/node.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_import/supported/Attic/node.inc,v
retrieving revision 1.11.2.1
diff -u -r1.11.2.1 node.inc
--- supported/node.inc	6 Feb 2007 09:20:05 -0000	1.11.2.1
+++ supported/node.inc	3 May 2007 02:45:39 -0000
@@ -87,7 +87,7 @@
       $node->date = $date;
     }
     else {
-      $errors[] = t('The date %date is not a valid date.', array('%date' => theme('placeholder', $node->date)));
+      $errors[] = t('The date %date is not a valid date.', array('%date' => $node->date));
       unset($node->date);
     }
   }
@@ -102,7 +102,7 @@
       $node->date = $date;
     }
     else {
-      $errors[] = t('The date %date is not a valid date.', array('%date' => theme('placeholder', $author['date'])));
+      $errors[] = t('The date %date is not a valid date.', array('%date' => $author['date']));
     }
   }
 
@@ -161,7 +161,7 @@
   else if ($unique_title) {
     $count = db_fetch_object(db_query("SELECT count(*) cnt FROM {node} WHERE title = '%s' AND type = '%s'", $node->title, $node->type));
     if ($count->cnt > 0) {
-      $errors[] = t('The node title %title is not unique for this node type.', array('%title' => theme('placeholder', $node->title)));
+      $errors[] = t('The node title %title is not unique for this node type.', array('%title' => $node->title));
     }
   }
 
@@ -212,7 +212,7 @@
     $node[$option] = 1;
   }
   $node = (object)$node;
-  $node_form = (array) node_form_array($node);
+  $node_form = node_form($node);
 
   // We only care about a part of this node_form.
   $form = array();
Index: supported/taxonomy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_import/supported/Attic/taxonomy.inc,v
retrieving revision 1.6.2.1
diff -u -r1.6.2.1 taxonomy.inc
--- supported/taxonomy.inc	27 Apr 2007 09:54:33 -0000	1.6.2.1
+++ supported/taxonomy.inc	3 May 2007 02:45:39 -0000
@@ -124,7 +124,7 @@
     }
   }
 
-  if (module_exist('category')) {
+  if (module_exists('category')) {
     $node->category = $taxonomy;
   }
   else {
@@ -221,7 +221,7 @@
       '#tree' => TRUE,
     );
 
-    if (module_exist('category')) {
+    if (module_exists('category')) {
       $node = (object)array(
         'type' => $type,
         'category' => _node_import_taxonomy_form2node($taxonomy),
Index: supported/event.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_import/supported/Attic/event.inc,v
retrieving revision 1.3.2.1
diff -u -r1.3.2.1 event.inc
--- supported/event.inc	23 Feb 2007 07:10:36 -0000	1.3.2.1
+++ supported/event.inc	3 May 2007 02:45:39 -0000
@@ -53,7 +53,7 @@
       }
       unset($node->$whatdate);
     }
-    if (module_exist('jscalendar')) {
+    if (module_exists('jscalendar')) {
       // jscalendar.module supplies $node->{$what.'_date'} and event.module
       // always uses that when jscalendar is enabled. So we need to set
       // it. The format is: YYYY.MM.DD.hh.mm.ss (where dots are ignored).
Index: supported/cck/content.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_import/supported/cck/Attic/content.inc,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 content.inc
--- supported/cck/content.inc	6 Feb 2007 09:20:05 -0000	1.1.2.2
+++ supported/cck/content.inc	3 May 2007 02:45:39 -0000
@@ -38,7 +38,7 @@
 function content_node_import_types() {
   $types = array();
   foreach (content_types() as $id => $type) {
-    $types[$id] = $type['label'];
+    $types[$id] = $type['name'];
   }
   return $types;
 }
@@ -110,6 +110,11 @@
                   if (is_numeric($value) && date_is_valid($value, DATE_UNIX)) {
                     $value = date_unix2iso($value);
                   }
+                  // If the imported date is a (partial) ISO date, convert it
+                  // to date's ISO date.
+                  else if (($date_array = date_iso2array($value)) != 'ERROR') {
+                    $value = date_array2iso($date_array);
+                  }
                   // Otherwise, use strtotime and unix2iso to convert 
                   // partial ISO or text date into full ISO.
                   else {
@@ -117,7 +122,7 @@
                   }
                 }
                 else {
-                  // is this already a unix timestamp? If not try strototime.
+                  // Is this already a unix timestamp? If not try strototime.
                   if (!is_numeric($value) || !date_is_valid($value, DATE_UNIX)) {
                     $value = strtotime($value);
                   }
@@ -126,14 +131,32 @@
               break;
 
             case 'nodereference':
-              if (($nid = node_import_nodereference($value))) {
-                $value = $nid;
+              // If $value is numeric use it, otherwise
+              // find a node title that matches and get nid.
+              if (intval($value) > 0) {
+                $value = intval($value);
+              }
+              else {
+                $referenced_nodes = array();
+                $sql = "SELECT nid, title FROM {node} WHERE title SOUNDS LIKE '%s'";
+                $result = db_query($sql, $value);
+                $record_found = db_fetch_object($result);
+                if ($record_found) {
+                  $value = $record_found->nid;
+                }
               }
               break;
 
             case 'userreference':
-              if (($uid = node_import_userreference($value))) {
-                $value = $uid;
+              // If $value is numeric use it, otherwise
+              // find a user name that matches and get uid.
+              if (intval($value) > 0) {
+                $value = intval($value);
+              }
+              else {
+                if (($account = user_load(array('name' => $author['name'])))) {
+                  $value = $account->uid;
+                }
               }
               break;
 
Index: node_import.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_import/Attic/node_import.module,v
retrieving revision 1.50.2.3
diff -u -r1.50.2.3 node_import.module
--- node_import.module	27 Apr 2007 09:54:33 -0000	1.50.2.3
+++ node_import.module	3 May 2007 02:45:39 -0000
@@ -12,9 +12,6 @@
  */
 function node_import_help($section) {
   switch ($section) {
-    case 'admin/modules#description':
-      return t('Import nodes from a CSV or TSV file.');
-
     case 'admin/help#node_import':
       $output = '<p>'. t('The node import module enables importing of nodes of any type into your site using comma separated values format (CSV) or tab separated values format (TSV). One possible use is with contact manager to import lists of contacts. Users want to be able to import content from other systems into their site.') .'</p>';
       $output .= '<p>'. t('Node import accepts a CSV or TSV file as input. CSV or TSV files can be generated using spreadsheet programs. Your CSV or TSV file must contain field names in its first row. These field names can be anything; except when using <a href="%external-http-drupal-org-node-24614">raw data</a> import type. Modules, such as contact_manager, will add additional import types.', array('%external-http-drupal-org-node-24614' => 'http://drupal.org/node/24614')) .'</p>';
@@ -36,10 +33,10 @@
   $links = array();
   if ($may_cache) {
     $links[] = array(
-      'path' => 'admin/node/node_import', 
-      'title' => t('import'), 
-      'callback' => 'node_import_page', 
-      'weight' => 5, 
+      'path' => 'admin/content/node_import',
+      'title' => t('Import content'),
+      'description' => t('Import nodes from a CSV or TSV file.'),
+      'callback' => 'node_import_page',
       'access' => user_access('import nodes'),
     );
   }
@@ -60,10 +57,13 @@
   // Include the API.
   include_once(drupal_get_path('module', 'node_import') . '/node_import.api.inc');
 
-  $edit = array_merge((array)$_SESSION['node_import'], (array)$_POST['edit']);
+  // Loads the hooks for the supported modules.
+  node_import_load_supported();
+
+  $edit = array_merge((array)$_SESSION['node_import'], (array)$_POST);
 
   // This prevents drupal_get_form() from performing extra validation.
-  unset($_POST['edit']);
+  unset($_POST);
 
   // validate the form
   if ($_SESSION['node_import_page'] && $_POST) {
@@ -75,7 +75,7 @@
   }
 
   // create the new page
-  $output = $_SESSION['node_import_page']($edit);
+  $output = drupal_get_form($_SESSION['node_import_page'], $edit);
 
   // save everything back to the session
   $_SESSION['node_import'] = $edit;
@@ -140,10 +140,8 @@
     '#type' => 'submit',
     '#value' => t('Next (mapping)'),
   );
-  $form['#method'] = 'post';
-  $form['#action'] = 0;
   $form['#attributes'] = array('enctype' => 'multipart/form-data');
-  return drupal_get_form('node_import_start', $form);
+  return $form;
 }
 
 function _node_import_start_validate($op, &$edit) {
@@ -151,17 +149,20 @@
   global $base_url;
 
   // Delete an existing file if needed.
-  if ($op == t('Use a different file')) {
-    file_delete($edit['file']->path);
+  if ($edit['op'] == t('Use a different file')) {
+    file_delete($edit['file']->filepath);
     unset($edit['file']);
+    unset($_SESSION['node_import']['file']);
     unset($edit['filename']);
+    unset($_SESSION['node_import']['filename']);
     unset($edit['file_format']);
-    unset($edit['match']);
-    unset($edit['global']);
+    unset($_SESSION['node_import']['file_format']);
     unset($edit['errors']);
+    unset($_SESSION['node_import']['errors']);
   }
-  else if ($op == t('Next (mapping)')) {
-    // If there is an uploaded file save it to drupal.node_import.{site url}.{uid} in the temporary directory.
+  else if ($edit['op'] == t('Next (mapping)')) {
+    // If there is an uploaded file, save it to
+    // drupal.node_import.{site_url}.{uid} in the temporary directory.
     $file = file_save_upload('file');
     if ($file) {
       $edit['filename'] = $file->filename;
@@ -189,6 +190,11 @@
       form_set_error('file_format', t('You need to select a format from the list.'));
     }
 
+    if (!$edit['type']) {
+      form_set_error('type', t('You must select a content type.'));
+      return;
+    }
+
     if ($edit['type'] == 'node_import') {
       $_SESSION['node_import_page'] = '_node_import_preview';
     }
@@ -218,7 +224,7 @@
   $form[] = array(
     '#type' => 'item',
     '#title' => t('Type'),
-    '#value' => node_get_name($edit['type']),
+    '#value' => node_get_types('name', $edit['type']),
   );
 
   if ($edit['type'] != 'node_import') {
@@ -270,7 +276,7 @@
     '#value' => t('Next (options)'),
   );
 
-  return drupal_get_form('node_import_mapping', $form);
+  return $form;
 }
 
 function _node_import_mapping_validate($op, &$edit) {
@@ -302,12 +308,12 @@
   $form[] = array(
     '#type' => 'item',
     '#title' => t('Type'),
-    '#value' => node_get_name($edit['type']),
+    '#value' => node_get_types('name', $edit['type']),
   );
 
   if ($edit['type'] != 'node_import') {
     // load the previously filled in values of the global fields
-    $global_values = array_merge((array) $_SESSION['node_import'], (array) $_POST['edit']);
+    $global_values = array_merge((array)$_SESSION['node_import'], (array)$_POST);
     $global_values = isset($global_values['global']) ? $global_values['global'] : array();
 
     if ($global = module_invoke_all('node_import_global', $edit['type'], $global_values)) {
@@ -331,7 +337,7 @@
     '#value' => t('Next (preview)'),
   );
 
-  return drupal_get_form('node_import_options', $form);
+  return $form;
 }
 
 function _node_import_options_validate($op, &$edit) {
@@ -362,7 +368,7 @@
   $form[] = array(
     '#type' => 'item',
     '#title' => t('Type'),
-    '#value' => node_get_name($edit['type']),
+    '#value' => node_get_types('name', $edit['type']),
   );
   $form[] = array(
     '#type' => 'markup',
@@ -399,7 +405,7 @@
     '#value' => t('Apply (import nodes)'),
   );
 
-  return drupal_get_form('node_import_preview', $form);
+  return $form;
 }
 
 function _node_import_preview_validate($op, &$edit) {
@@ -438,7 +444,7 @@
   $form[] = array(
     '#type' => 'item',
     '#title' => t('Type'),
-    '#value' => node_get_name($edit['type']),
+    '#value' => node_get_types('name', $edit['type']),
   );
 
   $form[] = array(
@@ -461,7 +467,7 @@
     '#value' => $output,
   );
 
-  return drupal_get_form('node_import_import', $form);
+  return $form;
 }
 
 function _node_import_import_validate($op, &$edit) {
@@ -534,22 +540,26 @@
   return _node_import_import_validate($op, $edit);
 }
 
-/************************************************************************
- * Function to do the actual import and creation of nodes
- ************************************************************************/
-
-function _node_import_get_nodes(
-  $filepath,                             // Full path to the file to import
-  $type,                                 // Node content type
-  $match,                                // Array of mappings
-  $global,                               // Array of global values
-  $preview,                              // Number of entries to preview or 0 to do the import
-  &$error_rows,                          // Will return a list of error rows
-  $get_row = '_node_import_csv_get_row'  // Function used to get one row
-) {
-
-  $style = base_path() . drupal_get_path('module', 'node_import') .'/node_import.css';
-  drupal_set_html_head(theme('stylesheet_import', $style));
+/**
+ * Import and create nodes.
+ * 
+ * @param string $filepath
+ *   Full path to the file to import.
+ * @param string $type
+ *   Node content type.
+ * @param array $match
+ *   Array of mappings.
+ * @param array $global
+ *   Array of global values.
+ * @param int $preview
+ *   Number of entries to preview or 0 to do the import.
+ * @param array $error_rows
+ *   Returns a list of error rows.
+ * @param string $get_row
+ *   Function used to get one row.
+ */
+function _node_import_get_nodes($filepath, $type, $match, $global, $preview, &$error_rows, $get_row = '_node_import_csv_get_row') {
+  drupal_add_css(drupal_get_path('module', 'node_import') .'/node_import.css');
 
   $header = $get_row($filepath, TRUE);
 
@@ -628,7 +638,7 @@
     // See if we are allowed to create this node. This is again only for
     // "raw input".
     if (!node_access('create', $node)) {
-      $errors[] = t('You are not authorized to create a node of type %type.', array('%type' => theme('placeholder', node_get_name($node))));
+      $errors[] = t('You are not authorized to create a node of type %type.', array('%type' => theme('placeholder', node_get_types('name', $node))));
     }
 
     // Ok, we're done. Preview the node or save it (if no errors).
@@ -668,10 +678,10 @@
 
   if (!$preview) {
     if (count($error_rows)) {
-      drupal_set_message(t("%errors Click 'Download rows with errors' for a CSV file of the failed rows.", array('%errors' => format_plural(count($error_rows), 'There was 1 error.', 'There were %count errors.'))));
+      drupal_set_message(t("!errors Click 'Download rows with errors' for a CSV file of the failed rows.", array('!errors' => format_plural(count($error_rows), t('There was 1 error.'), t('There were @count errors.')))));
       $error_rows = array_merge(array($header), $error_rows);
     }
-    drupal_set_message(format_plural($success, 'Successfully imported 1 node.', 'Successfully imported %count nodes.'));
+    drupal_set_message(format_plural($success, 'Successfully imported 1 node.', 'Successfully imported @count nodes.'));
   }
   
   return $output;
@@ -690,7 +700,7 @@
       unset($select['#description']);
       $row = array();
       $row[] = $title;
-      $row[] = form_render($select);
+      $row[] = drupal_render($select);
       $row[] = $samples;
       $data[] = $row;
     }
Index: node_import.api.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_import/Attic/node_import.api.inc,v
retrieving revision 1.8.2.1
diff -u -r1.8.2.1 node_import.api.inc
--- node_import.api.inc	6 Feb 2007 09:20:05 -0000	1.8.2.1
+++ node_import.api.inc	3 May 2007 02:45:39 -0000
@@ -15,16 +15,15 @@
   static $loaded = FALSE;
   if (!$loaded) {
     $path = drupal_get_path('module', 'node_import') . '/supported';
-    $files = system_listing('.*\.inc$', $path, 'name', 0);
+    $files = drupal_system_listing('.*\.inc$', $path, 'name', 0);
     foreach ($files as $module_name => $file) {
-      if (module_exist($module_name)) {
+      if (module_exists($module_name)) {
         include_once($file->filename);
       }
     }
     $loaded = TRUE;
   }
 }
-node_import_load_supported();
 
 /**
  * Get a list of supported nodes types.
Index: node_import.info
===================================================================
RCS file: node_import.info
diff -N node_import.info
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ node_import.info	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,4 @@
+; $Id$
+name = "Node Import"
+description = "Import nodes from a CSV or TSV file."
+package = "Development"
