--- taxonomy_csv.module 2008-04-19 18:12:13.000000000 -0400 +++ taxonomy_csv_new.module 2008-11-11 18:18:00.000000000 -0500 @@ -8,6 +8,7 @@ define('TAXONOMY_CSV_SEMICOLON', 1); define('TAXONOMY_CSV_IGNORE', 0); define('TAXONOMY_CSV_FIELDS', 1); define('TAXONOMY_CSV_CHILDREN', 2); +define('TAXONOMY_CSV_WEIGHTS', 3); /** * Implementation of hook_help(). @@ -74,6 +75,7 @@ function taxonomy_csv_import() { TAXONOMY_CSV_IGNORE => t('Ignore'), TAXONOMY_CSV_FIELDS => t('Term description, term synonyms (may be empty)'), TAXONOMY_CSV_CHILDREN => t('Child term names (hierarchical vocabularies only)'), + TAXONOMY_CSV_WEIGHTS => t('Term weights'), ), '#default_value' => TAXONOMY_CSV_IGNORE, '#description' => t('The first column is always imported as the term name. This option determines how additional columns will be imported. If your CSV file only contains one column, this option will be ignored.'), @@ -205,6 +207,14 @@ function taxonomy_csv_import_line($line, $parent = $term['tid']; } } + else if ($options['columns'] == TAXONOMY_CSV_WEIGHTS) { + $term = array( + 'name' => $line[0], + 'vid' => $options['vid'], + 'weight' => $line[1], + ); + taxonomy_csv_import_term($term, $options['update']); + } else if (!empty($line[0])) { $term = array( 'name' => $line[0],