You are here

function import_do_import_page in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6

Same name and namespace in other branches
  1. 6.2 import/merci_import.php \import_do_import_page()

Perform imports for the JS version and return progress.

1 call to import_do_import_page()
merci_import.php in import/merci_import.php
Administrative page for adding MERCI bucket/resource content types and items.

File

import/merci_import.php, line 407
Administrative page for adding MERCI bucket/resource content types and items.

Code

function import_do_import_page() {
  global $conf;

  // HTTP Post required
  if ($_SERVER['REQUEST_METHOD'] != 'POST') {
    drupal_set_message('HTTP Post is required.', 'error');
    drupal_set_title('Error');
    return '';
  }

  // Error handling: if PHP dies, the output will fail to parse as JSON, and
  // the Javascript will tell the user to continue to the op=error page.
  list($percentage, $message) = import_do_imports();
  print drupal_to_js(array(
    'status' => TRUE,
    'percentage' => $percentage,
    'message' => $message,
  ));
}