You are here

function _node_import_options in Node import 5

2 string references to '_node_import_options'
_node_import_mapping_validate in ./node_import.module
_node_import_preview_validate in ./node_import.module

File

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

Code

function _node_import_options(&$edit) {
  $form = array();
  $form[] = array(
    '#type' => 'item',
    '#title' => t('File'),
    '#value' => $edit['filename'] . ' (' . format_size($edit['file']->filesize) . ') ',
  );
  $file_formats = _node_import_get_file_formats();
  $form[] = array(
    '#type' => 'item',
    '#title' => t('File format'),
    '#value' => $file_formats[$edit['file_format']],
  );
  $form[] = array(
    '#type' => 'item',
    '#title' => t('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);
    $global_values = isset($global_values['global']) ? $global_values['global'] : array();
    if ($global = module_invoke_all('node_import_global', $edit['type'], $global_values)) {
      $form['global'] = $global;
      $form['global']['#tree'] = TRUE;
    }
    else {
      $form['global'] = array(
        '#type' => 'markup',
        '#value' => t('<p>There are no global options you can set.</p>'),
      );
    }
  }
  $form[] = array(
    '#type' => 'submit',
    '#value' => t('Back'),
  );
  $form[] = array(
    '#type' => 'submit',
    '#value' => t('Next (preview)'),
  );
  return $form;
}