--- uc_store.orig Wed Jul 30 16:16:06 2008 +++ uc_store.module Mon Sep 1 21:07:29 2008 @@ -1060,6 +1060,7 @@ function uc_country_import_form() { '#title' => t('Country'), '#options' => is_array($import_list) ? $import_list : array(t('-None available-')), '#disabled' => is_array($import_list) ? FALSE : TRUE, + '#multiple' => TRUE, ); $form['import_button'] = array( '#type' => 'submit', @@ -1074,21 +1075,23 @@ function uc_country_import_form() { } function uc_country_import_form_submit($form_id, $form_values) { - $file = $form_values['import_file']; + $files = $form_values['import_file']; - $pieces = explode('_', substr($file, 0, strlen($file) - 4)); - $country_id = $pieces[count($pieces) - 2]; - $version = $pieces[count($pieces) - 1]; - $country = substr($file, 0, strlen($file) - strlen($country_id) - strlen($version) - 6); + foreach ($files as $file) { + $pieces = explode('_', substr($file, 0, strlen($file) - 4)); + $country_id = $pieces[count($pieces) - 2]; + $version = $pieces[count($pieces) - 1]; + $country = substr($file, 0, strlen($file) - strlen($country_id) - strlen($version) - 6); - require_once(drupal_get_path('module', 'uc_store') .'/countries/'. $file); - $func = $country .'_install'; - if (function_exists($func)) { - $func(); - drupal_set_message(t('Country file !file imported.', array('!file' => $file))); - } - else { - drupal_set_message(t('Country file had no install function.')); + require_once(drupal_get_path('module', 'uc_store') .'/countries/'. $file); + $func = $country .'_install'; + if (function_exists($func)) { + $func(); + drupal_set_message(t('Country file !file imported.', array('!file' => $file))); + } + else { + drupal_set_message(t('Country file had no install function.')); + } } }