You are here

function node_import_page in Node import 5

Menu callback function.

1 string reference to 'node_import_page'
node_import_menu in ./node_import.module
Implementation of hook_menu().

File

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

Code

function node_import_page() {

  // Include the API.
  include_once './' . drupal_get_path('module', 'node_import') . '/node_import.api.inc';

  // Load hooks for supported modules.
  node_import_load_supported();
  $edit = array_merge((array) $_SESSION['node_import'], (array) $_POST);

  // Validate the form.
  if ($_SESSION['node_import_page'] && $_POST) {
    $function = $_SESSION['node_import_page'] . '_validate';
    $function($_POST['op'], $edit);
  }
  else {
    $_SESSION['node_import_page'] = '_node_import_start';
  }

  // This prevents drupal_get_form() from performing extra validation.
  unset($_POST);

  // Create the new page.
  $output = drupal_get_form($_SESSION['node_import_page'], $edit);

  // Save everything back to the session.
  $_SESSION['node_import'] = $edit;
  return $output;
}