Index: importexportapi.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/importexportapi/importexportapi.info,v retrieving revision 1.2.2.1 diff -u -p -r1.2.2.1 importexportapi.info --- importexportapi.info 25 Mar 2007 22:19:56 -0000 1.2.2.1 +++ importexportapi.info 6 Apr 2009 15:06:23 -0000 @@ -2,3 +2,4 @@ name = Import Export API description = Allows data entities in Drupal to be imported and exported in a variety of formats. package = Import Export API +core = 6.x Index: importexportapi.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/importexportapi/importexportapi.install,v retrieving revision 1.5 diff -u -p -r1.5 importexportapi.install --- importexportapi.install 5 Nov 2006 07:03:29 -0000 1.5 +++ importexportapi.install 6 Apr 2009 15:06:23 -0000 @@ -11,103 +11,122 @@ * Implementation of hook_install(). */ function importexportapi_install() { - switch ($GLOBALS['db_type']) { - case 'mysql': - case 'mysqli': - db_query('CREATE TABLE {importexportapi_db_put_map} ( - put_map_id int(10) NOT NULL auto_increment, - put_id int(10) NOT NULL default \'0\', - entity varchar(255) NOT NULL default \'\', - field varchar(255) NOT NULL default \'\', - value_old int(10) NOT NULL default \'0\', - value_new int(10) NOT NULL default \'0\', - PRIMARY KEY (put_map_id), - KEY (put_id) - ) /*!40100 DEFAULT CHARACTER SET utf8 */ - '); - db_query('CREATE TABLE {importexportapi_db_put_map_alt} ( - put_map_alt_id int(10) NOT NULL auto_increment, - put_id int(10) NOT NULL default \'0\', - entity varchar(255) NOT NULL default \'\', - field varchar(255) NOT NULL default \'\', - alt_field varchar(255) NOT NULL default \'\', - value_alt varchar(255) NOT NULL default \'\', - value_key int(10) NOT NULL default \'0\', - PRIMARY KEY (put_map_alt_id), - KEY (put_id) - ) /*!40100 DEFAULT CHARACTER SET utf8 */ - '); - break; - case 'pgsql': - db_query('CREATE TABLE {importexportapi_db_put_map} ( - put_map_id SERIAL, - put_id integer NOT NULL default \'0\', - entity varchar(255) NOT NULL default \'\', - field varchar(255) NOT NULL default \'\', - value_old integer NOT NULL default \'0\', - value_new integer NOT NULL default \'0\', - PRIMARY KEY (put_map_id) - ) - '); - db_query('CREATE INDEX {importexportapi_db_put_map}_put_id_idx - ON {importexportapi_db_put_map} (put_id) - '); - db_query('CREATE TABLE {importexportapi_db_put_map_alt} ( - put_map_alt_id SERIAL, - put_id integer NOT NULL default \'0\', - entity varchar(255) NOT NULL default \'\', - field varchar(255) NOT NULL default \'\', - alt_field varchar(255) NOT NULL default \'\', - value_alt varchar(255) NOT NULL default \'\', - value_key integer NOT NULL default \'0\', - PRIMARY KEY (put_map_alt_id) - ) - '); - db_query('CREATE INDEX {importexportapi_db_put_map_alt}_put_id_idx - ON {importexportapi_db_put_map_alt} (put_id) - '); + // Create tables + drupal_install_schema('importexportapi'); + //drupal_install_schema('importexportapi_db_put_map'); + //drupal_install_schema('importexportapi_db_put_map_alt'); +} + +/** + * Implementation of hook_install(). + */ +function importexportapi_uninstall() { + // Drop tables + drupal_uninstall_schema('importexportapi'); + //drupal_uninstall_schema('importexportapi_db_put_map'); + //drupal_uninstall_schema('importexportapi_db_put_map_alt'); +} + - break; - } +/** + * Implementation of hook_schema(). + */ +function importexportapi_schema() { + $schema['importexportapi_db_put_map'] = array( + 'fields' => array( + 'put_map_id' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'auto_increment'), + 'put_id' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0), + 'entity' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => ''), + 'field' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => ''), + 'value_old' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0), + 'value_new' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0) + ), + 'indexes' => array( + 'put_map_id' => array('put_map_id') + ), + 'primary key' => array('put_id') + ); + $schema['importexportapi_db_put_map_alt'] = array( + 'fields' => array( + 'put_map_alt_id' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'auto_increment'), + 'put_id' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0), + 'entity' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => ''), + 'field' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => ''), + 'alt_field' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default'), + 'value_alt' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => 0), + 'value_key' => array( + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0) + ), + 'indexes' => array( + 'put_id' => array('put_id') + ), + 'primary key' => array('put_map_alt_id') + ); + return $schema; } function importexportapi_update_1() { - switch ($GLOBALS['db_type']) { - case 'mysql': - case 'mysqli': - db_query('CREATE TABLE {importexportapi_db_put_map_alt} ( - put_map_alt_id int(10) NOT NULL auto_increment, - put_id int(10) NOT NULL default \'0\', - entity varchar(255) NOT NULL default \'\', - field varchar(255) NOT NULL default \'\', - alt_field varchar(255) NOT NULL default \'\', - value_alt varchar(255) NOT NULL default \'\', - value_key int(10) NOT NULL default \'0\', - PRIMARY KEY (put_map_alt_id), - KEY (put_id) - ) /*!40100 DEFAULT CHARACTER SET utf8 */ - '); - break; - - case 'pgsql': - db_query('CREATE TABLE {importexportapi_db_put_map_alt} ( - put_map_alt_id SERIAL, - put_id integer NOT NULL default \'0\', - entity varchar(255) NOT NULL default \'\', - field varchar(255) NOT NULL default \'\', - alt_field varchar(255) NOT NULL default \'\', - value_alt varchar(255) NOT NULL default \'\', - value_key integer NOT NULL default \'0\', - PRIMARY KEY (put_map_id) - ) - '); - db_query('CREATE INDEX {importexportapi_db_put_map_alt}_put_id_idx - ON {importexportapi_db_put_map_alt} (put_id) - '); - break; - } + $ret = array(); - db_query('ALTER TABLE {importexportapi_put_map} RENAME TO {importexportapi_db_put_map}'); + db_add_field($ret, 'db_put_map_alt', 'put_map_alt_id', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'auto_increment')); + db_add_field($ret, 'db_put_map_alt', 'put_id', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)); + db_add_field($ret, 'db_put_map_alt', 'entity', array('type' => 'varchar', 'not null' => TRUE, 'default')); + db_add_field($ret, 'db_put_map_alt', 'field', array('type' => 'varchar', 'not null' => TRUE, 'default')); + db_add_field($ret, 'db_put_map_alt', 'alt_field', array('type' => 'varchar', 'not null' => TRUE, 'default')); + db_add_field($ret, 'db_put_map_alt', 'value_alt', array('type' => 'varchar', 'not null' => TRUE, 'default' => 0)); + db_add_field($ret, 'db_put_map_alt', 'value_key', array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)); + db_add_index($ret, 'db_put_map_alt', 'put_map_alt_id', array('put_map_alt_id')); - return array(); + return $ret;; } Index: importexportapi.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/importexportapi/importexportapi.module,v retrieving revision 1.53 diff -u -p -r1.53 importexportapi.module --- importexportapi.module 8 Feb 2007 13:30:28 -0000 1.53 +++ importexportapi.module 6 Apr 2009 15:06:24 -0000 @@ -18,8 +18,8 @@ define('IMPORTEXPORTAPI_DEPENDENCY_TIMEO /** * Implementation of hook_help(). */ -function importexportapi_help($section) { - switch ($section) { +function importexportapi_help($path, $arg) { + switch ($path) { case 'admin/help#importexportapi': return t('The import / export API module allows data entities in Drupal to be imported and exported in a variety of formats.'); } @@ -612,7 +612,6 @@ function importexportapi_get_engines($ty } } } - if (isset($format)) { return isset($engines[$type][$format]) ? $engines[$type][$format] : NULL; } @@ -657,7 +656,6 @@ function importexportapi_get_data($entit if (!isset($def)) { $def = importexportapi_get_def(NULL, TRUE); } - // If no 'get' format has been specified, then use the 'source' format of the // first available entity (default 'source' format is 'db'). if (!isset($get_format)) { @@ -673,7 +671,6 @@ function importexportapi_get_data($entit if (!function_exists($function)) { return NULL; } - // Run the 'get' operations. $data = array(); $entities = array_flip($entities); Index: definitions/importexportapi_block.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/importexportapi/definitions/importexportapi_block.inc,v retrieving revision 1.4.4.1 diff -u -p -r1.4.4.1 importexportapi_block.inc --- definitions/importexportapi_block.inc 25 Mar 2007 22:19:56 -0000 1.4.4.1 +++ definitions/importexportapi_block.inc 6 Apr 2009 15:06:24 -0000 @@ -27,11 +27,11 @@ function block_def() { '#db_table' => 'boxes', '#key' => TRUE ); - $def['body'] = array( + $def['body'] = array( '#title' => t('Body'), '#db_table' => 'boxes' ); - $def['info'] = array( + $def['info'] = array( '#title' => t('Description'), '#unique' => TRUE, '#db_table' => 'boxes' @@ -127,7 +127,6 @@ function _block_get_def() { $def['title'] = array( '#title' => t('Title') ); - $def['roles'] = array( '#type' => 'array', '#title' => t('Roles'), @@ -136,7 +135,6 @@ function _block_get_def() { '#csv_plural' => 'blocks-roles', '#xml_mapping' => 'role' ); - $def['roles']['module'] = array( '#title' => t('Responsible module'), '#reference_entity' => 'block', Index: engines/importexportapi_db_put.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/importexportapi/engines/importexportapi_db_put.inc,v retrieving revision 1.29 diff -u -p -r1.29 importexportapi_db_put.inc --- engines/importexportapi_db_put.inc 7 Feb 2007 13:09:25 -0000 1.29 +++ engines/importexportapi_db_put.inc 6 Apr 2009 15:06:24 -0000 @@ -127,7 +127,7 @@ function importexportapi_db_put($data, $ // marked as 'unique'. If any values do already exist for these fields, // then abort this query altogether. if ($is_insert && !empty($unique_fields)) { - $unique_fields_sql = 'SELECT * FROM '. $into .' WHERE '. implode(' OR ', $unique_fields['sql']); + $unique_fields_sql = 'SELECT * FROM {'. $into .'} WHERE '. implode(' OR ', $unique_fields['sql']); $result = db_fetch_object(db_query($unique_fields_sql, $unique_fields['values'])); if (!empty($result)) { @@ -208,7 +208,7 @@ function _importexportapi_db_put_sequenc $field_put = $field['#put']; if ($field_put['#db_uses_sequences'] && $GLOBALS['db_type'] != 'pgsql') { - $new_id = db_next_id($table .'_'. $field_put['#db_field_unaliased']); + $new_id = db_last_insert_id($table, $field_put['#db_field_unaliased']); } else { switch ($GLOBALS['db_type']) { @@ -256,7 +256,7 @@ function _importexportapi_db_put_sequenc if ($field_put['#db_uses_sequences'] && $GLOBALS['db_type'] != 'pgsql') { $sequence_name = $table .'_'. $field_put['#db_field_unaliased']; - $result = db_fetch_object(db_query("SELECT id FROM {sequences} WHERE name = '$sequence_name'")); + $result = db_fetch_object(db_query("SELECT id FROM {sequences} WHERE name = '%s'", $sequence_name)); if (!empty($result)) { $curr_value = (int) $result->id; @@ -265,7 +265,7 @@ function _importexportapi_db_put_sequenc } } else { - db_query("INSERT INTO {sequences} (name, id) VALUES ('$sequence_name', %d)", $value); + db_query("INSERT INTO {sequences} (name, id) VALUES ('%s', %d)", $sequence_name, $value); } } elseif ($GLOBALS['db_type'] == 'pgsql') { @@ -474,8 +474,8 @@ function _importexportapi_db_put_resolve if (!empty($result) && isset($result->$ref_db_field) && $result->$ref_db_field !== '') { // We managed to resolve the alternate key to an actual 'key' // value - now, copy the actual 'key' value to the 'key' field. - importexportapi_string_typecast($ref_field['#type'], $result->$ref_db_field); - $data[$key_index]['#value'] = $result->$ref_db_field; + importexportapi_string_typecast($ref_field['#type'], $result->$ref_db_field); + $data[$key_index]['#value'] = $result->$ref_db_field; // Record the alternate key that we used in the // '#db_resolved_alt_key' attribute of the 'key' field. @@ -575,7 +575,7 @@ function _importexportapi_db_put_generat $value_old = NULL; $key_provided = isset($value); - $key_already_exists = (bool) db_num_rows(db_query('SELECT '. $key_put['#db_field_unaliased'] .' FROM '. $into .' WHERE '. $key_put['#db_field_unaliased'] .' = '. $placeholder_map[$key_field['#type']], $value)); + $key_already_exists = (bool) db_result(db_query('SELECT COUNT('. $key_put['#db_field_unaliased'] .') FROM {'. $into .'} WHERE '. $key_put['#db_field_unaliased'] .' = '. $placeholder_map[$key_field['#type']], $value)); $update_existing = $key_put['#db_update_existing']; $generate_id = $key_put['#db_generate_id']; $force_generate_id = $key_put['#db_force_generate_id']; @@ -672,7 +672,7 @@ function _importexportapi_db_put_generat // Alternate key fields need to be updated in the database // immediately, otherwise duplicate key errors can occur. - $sql = 'SELECT '. $key_put['#db_field_unaliased'] .' FROM '. $into .' WHERE '. $alt_key_db_field .' = '. $placeholder_map[$alt_key_field['#type']]; + $sql = 'SELECT '. $key_put['#db_field_unaliased'] .' FROM {'. $into .'} WHERE '. $alt_key_db_field .' = '. $placeholder_map[$alt_key_field['#type']]; $result = db_fetch_object(db_query($sql, $alt_key_field['#value'])); if (!empty($result) && (!isset($result->$alt_key_db_field) || $result->$alt_key_db_field === '')) { @@ -874,7 +874,7 @@ function _importexportapi_db_put_maps_sa $into = '{importexportapi_db_put_map}'; $sql = ''; - $check_sql = 'SELECT * FROM '. $into ." WHERE put_id = %d AND entity = '%s' AND field = '%s' AND value_old = %d"; + $check_sql = 'SELECT * FROM {'. $into ."} WHERE put_id = %d AND entity = '%s' AND field = '%s' AND value_old = %d"; $result = db_fetch_object(db_query($check_sql, $put_id, $entity_index, $field_path, $value_old)); $is_insert = empty($result); @@ -893,7 +893,7 @@ function _importexportapi_db_put_maps_sa $into = '{importexportapi_db_put_map_alt}'; $sql = ''; - $check_sql = 'SELECT * FROM '. $into ." WHERE put_id = %d AND entity = '%s' AND field = '%s' AND alt_field = '%s' AND value_alt = '%s'"; + $check_sql = 'SELECT * FROM {'. $into ."} WHERE put_id = %d AND entity = '%s' AND field = '%s' AND alt_field = '%s' AND value_alt = '%s'"; $result = db_fetch_object(db_query($check_sql, $put_id, $entity_index, $field_path, $key_field, $value_old)); $is_insert = empty($result); Index: ui/importexportui.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/importexportapi/ui/importexportui.info,v retrieving revision 1.3.2.1 diff -u -p -r1.3.2.1 importexportui.info --- ui/importexportui.info 25 Mar 2007 22:19:56 -0000 1.3.2.1 +++ ui/importexportui.info 6 Apr 2009 15:06:24 -0000 @@ -2,4 +2,5 @@ name = Import Export UI description = Provides a user interface for importing and exporting data in a Drupal site. Requires the importexportapi module. package = Import Export API -dependencies = importexportapi +dependencies[] = importexportapi +core = 6.x Index: ui/importexportui.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/importexportapi/ui/importexportui.module,v retrieving revision 1.11.2.1 diff -u -p -r1.11.2.1 importexportui.module --- ui/importexportui.module 25 Mar 2007 22:19:56 -0000 1.11.2.1 +++ ui/importexportui.module 6 Apr 2009 15:06:24 -0000 @@ -9,19 +9,19 @@ /** * Implementation of hook_help(). */ -function importexportui_help($section) { +function importexportui_help($path, $arg) { $op = ''; - if (strpos($section, 'admin/build/import') !== FALSE) { - $section = 'admin/build/import'; + if (strpos($path, 'admin/build/import') !== FALSE) { + $path = 'admin/build/import'; $op = 'import'; } - elseif (strpos($section, 'admin/build/export') !== FALSE) { - $section = 'admin/build/export'; + elseif (strpos($path, 'admin/build/export') !== FALSE) { + $path = 'admin/build/export'; $op = 'export'; } - switch ($section) { + switch ($path) { case 'admin/help#importexportui': return t('The import / export UI module provides a user interface for importing and exporting data in a Drupal site in a variety of formats. It requires the importexportapi module, which it relies on for performing all of the actual work of executing import and export operations.'); @@ -33,7 +33,6 @@ function importexportui_help($section) { if (!empty($entities)) { $page = 'field mappings'; } - return _importexportui_get_help_message($page, $op); } } @@ -41,25 +40,22 @@ function importexportui_help($section) { /** * Implementation of hook_menu(). */ -function importexportui_menu($may_cache) { - $items = array(); +function importexportui_menu() { + $items['admin/build/export'] = array( + 'title' => 'Export', + 'description' => 'Create a user interface for exporting data from the site.', + 'page callback' => 'importexportui_page', + 'page arguments' => array('export'), + 'access arguments' => array('perform data exports') + ); - if ($may_cache) { - $items[] = array( - 'path' => 'admin/build/export', - 'title' => t('Export'), - 'callback' => 'importexportui_page', - 'callback arguments' => array('export'), - 'access' => user_access('perform data exports') - ); - $items[] = array( - 'path' => 'admin/build/import', - 'title' => t('Import'), - 'callback' => 'importexportui_page', - 'callback arguments' => array('import'), - 'access' => user_access('perform data imports') - ); - } + $items['admin/build/import'] = array( + 'title' => 'Import', + 'description' => 'Create a user interface for importing data to the site.', + 'page callback' => 'importexportui_page', + 'page arguments' => array('import'), + 'access arguments' => array('perform data imports') + ); return $items; } @@ -87,9 +83,9 @@ function importexportui_page($op, $entit * The initial selection form that the user is presented with on the import and * export pages. */ -function importexportui_initial_selection_form($op) { - $form = array(); +function importexportui_initial_selection_form(&$form_state, $op) { + $form = array(); $form['entities'] = array( '#type' => 'checkboxes', '#title' => t('Entities to @op', array('@op' => $op)), @@ -116,27 +112,28 @@ function importexportui_initial_selectio /** * Redirects the user from the initial selection form to the mapping form page. */ -function importexportui_initial_selection_form_submit($form_id, $form_values) { +function importexportui_initial_selection_form_submit($form, &$form_state) { $entities = NULL; $engine = NULL; $op = arg(2); - if (!empty($form_values['entities'])) { - $entities = implode(',', array_filter($form_values['entities'])); + if (!empty($form_state['values']['entities'])) { + $entities = implode(',', array_filter($form_state['values']['entities'])); } - if (!empty($form_values['engine'])) { - $engine = $form_values['engine']; + if (!empty($form_state['values']['engine'])) { + $engine = $form_state['values']['engine']; } if (!empty($entities) && !empty($engine)) { - return 'admin/build/'. $op .'/'. $entities .'/'. $engine; + $form_state['redirect'] = 'admin/build/'. $op .'/'. $entities .'/'. $engine; + $form_state['nid'] = $node->nid; } } /** * Displays the field mappings form. */ -function importexportui_mapping_form($op, $entity_list, $engine) { +function importexportui_mapping_form(&$form_state, $op, $entity_list, $engine) { $form = array(); $def = importexportapi_get_def(NULL, TRUE); $type = ($op == 'export' ? 'put' : 'get'); @@ -295,26 +292,28 @@ function _importexportui_mapping_form(&$ * 'back'), or processes the user's custom-defined field mappings, and then * executes the import or export operation. */ -function importexportui_mapping_form_submit($form_id, $form_values) { - $op = isset($form_values['op']) ? $form_values['op'] : NULL; +function importexportui_mapping_form_submit($form, &$form_state) { + $op = isset($form_state['values']['op']) ? $form_state['values']['op'] : NULL; if (!empty($op) && $op == t('Back (initial selection)')) { - return 'admin/build/'. $form_values['ie_op']; + $form_state['redirect'] = 'admin/build/'. $form_state['values']['ie_op']; + $form_state['nid'] = $node->nid; + exit(); } - _importexportui_set_mappings($form_values); + _importexportui_set_mappings($form_state); - $function = 'importexportui_do_'. $form_values['ie_op']; + $function = 'importexportui_do_'. $form_state['values']['ie_op']; if (isset($op) && function_exists($function)) { - $function($form_values); + $function($form_state); } drupal_page_footer(); exit(); } -function importexportui_export_form($entity_list, $engine) { +function importexportui_export_form(&$form_state, $entity_list, $engine) { timer_start('importexportui'); $data = importexportapi_get_data($entity_list); $ret = importexportapi_put_data($data, $engine); @@ -360,40 +359,39 @@ function importexportui_export_form($ent /** * Performs an export operation, and outputs the results in a themed page. */ -function importexportui_do_export($form_values) { - $output .= drupal_get_form('importexportui_export_form', $form_values['entity_list'], $form_values['engine']); - $output .= _importexportui_view_links($form_values['ie_op']); +function importexportui_do_export($form_state) { + $output .= drupal_get_form('importexportui_export_form', $form_state['values']['entity_list'], $form_state['values']['engine']); + $output .= _importexportui_view_links($form_state['values']['ie_op']); print theme('page', $output); } /** * Performs an import operation, and outputs the results in a themed page. */ -function importexportui_do_import($form_values) { - $entity_list = $form_values['entity_list']; - $engine = $form_values['engine']; +function importexportui_do_import($form_state) { + $entity_list = $form_state['values']['entity_list']; + $engine = $form_state['values']['engine']; $raw = NULL; if ($engine == 'xml') { - $raw = _importexportui_get_raw_data($form_values['raw']); + $raw = _importexportui_get_raw_data($form_state['values']['raw']); } elseif ($engine == 'csv') { $raw = array(); - $raw_list = $form_values['raw_list']; + $raw_list = $form_state['values']['raw_list']; foreach ($raw_list as $raw_item) { - if (!empty($form_values['raw_'. $raw_item['id']])) { - $raw[$raw_item['csv_plural']] = _importexportui_get_raw_data($form_values['raw_'. $raw_item['id']]); + if (!empty($form_state['values']['raw_'. $raw_item['id']])) { + $raw[$raw_item['csv_plural']] = _importexportui_get_raw_data($form_state['values']['raw_'. $raw_item['id']]); } } } - $data = importexportapi_get_data($entity_list, $engine, array('raw' => $raw)); $ret = importexportapi_put_data($data, NULL, array('put_id' => 1)); $output = '
'. check_plain("$ret") .'
';; - $output .= _importexportui_view_links($form_values['ie_op']); + $output .= _importexportui_view_links($form_state['values']['ie_op']); print theme('page', $output); } @@ -474,21 +472,21 @@ function _importexportui_get_format_list /** * Processes the custom-defined field mappings, as entered by the user. */ -function _importexportui_set_mappings($form_values) { +function _importexportui_set_mappings($form_state) { $def = importexportapi_get_def(); - $entity_list = $form_values['entity_list']; - $type = $form_values['ie_type']; - $engine = $form_values['engine']; + $entity_list = $form_state['values']['entity_list']; + $type = $form_state['values']['ie_type']; + $engine = $form_state['values']['engine']; foreach ($entity_list as $entity_id) { $values = array(); - if (!empty($form_values[$entity_id .'_plural'])) { - $values["#$type"]['#'. $engine .'_plural'] = $form_values[$entity_id .'_plural']; + if (!empty($form_state['values'][$entity_id .'_plural'])) { + $values["#$type"]['#'. $engine .'_plural'] = $form_state['values'][$entity_id .'_plural']; } - if (!empty($form_values[$entity_id .'_mapping'])) { - $values["#$type"]['#'. $engine .'_mapping'] = $form_values[$entity_id .'_mapping']; + if (!empty($form_state['values'][$entity_id .'_mapping'])) { + $values["#$type"]['#'. $engine .'_mapping'] = $form_state['values'][$entity_id .'_mapping']; } if (!empty($values)) { @@ -496,7 +494,7 @@ function _importexportui_set_mappings($f } $field_ids = element_children($def[$entity_id]); - $child_fields = isset($form_values[$entity_id .'_fields']) ? $form_values[$entity_id .'_fields'] : NULL; + $child_fields = isset($form_state['values'][$entity_id .'_fields']) ? $form_state['values'][$entity_id .'_fields'] : NULL; if (!empty($field_ids) && !empty($child_fields)) { _importexportui_set_mappings_recurse($def[$entity_id], $field_ids, $child_fields, $type, $engine); @@ -507,15 +505,15 @@ function _importexportui_set_mappings($f /** * Recursively processes custom-defined field mappings. */ -function _importexportui_set_mappings_recurse($entity, $field_ids, $form_values, $type, $engine) { +function _importexportui_set_mappings_recurse($entity, $field_ids, $form_state, $type, $engine) { foreach ($field_ids as $field_id) { $values = array(); - if (!empty($form_values[$field_id .'_plural'])) { - $values["#$type"]['#'. $engine .'_plural'] = $form_values[$field_id .'_plural']; + if (!empty($form_state['values'][$field_id .'_plural'])) { + $values["#$type"]['#'. $engine .'_plural'] = $form_state['values'][$field_id .'_plural']; } - if (!empty($form_values[$field_id .'_mapping'])) { - $values["#$type"]['#'. $engine .'_mapping'] = $form_values[$field_id .'_mapping']; + if (!empty($form_state['values'][$field_id .'_mapping'])) { + $values["#$type"]['#'. $engine .'_mapping'] = $form_state['values'][$field_id .'_mapping']; } if (!empty($values)) { @@ -524,7 +522,7 @@ function _importexportui_set_mappings_re } $child_ids = element_children($entity[$field_id]); - $child_fields = isset($form_values[$field_id .'_fields']) ? $form_values[$field_id .'_fields'] : NULL; + $child_fields = isset($form_state['values'][$field_id .'_fields']) ? $form_state['values'][$field_id .'_fields'] : NULL; if (!empty($child_ids) && !empty($child_fields)) { _importexportui_set_mappings_recurse($entity[$field_id], $child_ids, $child_fields, $type, $engine);